-
-
Notifications
You must be signed in to change notification settings - Fork 443
Add support for creating local TiTiler endpoint #1256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for creating a local TiTiler endpoint, enabling users to run TiTiler as a background service within their Python environment for visualizing Cloud Optimized GeoTIFFs (COGs).
- Added a new
run_titiler()function that starts a local TiTiler server on an available port - Integrated the new functionality with the existing
check_titiler_endpoint()function to support "local" as an endpoint option - Added new optional dependency group
[titiler]with required packagestitileranduvicorn
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pyproject.toml | Added titiler and uvicorn dependencies to raster extras and created new titiler optional dependency group; added jupyter-duckdb to duckdb extras |
| mkdocs.yml | Added navigation entries for new local_titiler notebooks |
| leafmap/stac.py | Implemented run_titiler() function and modified check_titiler_endpoint() to support local TiTiler instances |
| leafmap/maplibregl.py | Imported run_titiler function for maplibre interface |
| leafmap/foliumap.py | Imported run_titiler function for folium interface |
| docs/notebooks/109_local_titiler.ipynb | Added example notebook demonstrating local TiTiler server usage with default leafmap |
| docs/maplibre/local_titiler.ipynb | Added example notebook demonstrating local TiTiler server usage with maplibre backend |
| docs/maplibre/overview.md | Added documentation section for the new local TiTiler server feature |
Comments suppressed due to low confidence (1)
leafmap/stac.py:2613
- The function always returns
Nonewhenreturn_titiler_endpoint=False(the default), but the docstring states it returnstuple: (endpoint, port, process). This inconsistency could confuse users. Either update the docstring to indicate it returnsNoneby default ortuplewhenreturn_titiler_endpoint=True, or change the default behavior to always return the tuple.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
leafmap/stac.py
Outdated
| """ | ||
| if titiler_endpoint is None: | ||
| if titiler_endpoint is not None and titiler_endpoint.lower() == "local": | ||
| titiler_endpoint, _, _ = run_titiler(show_logs=False) |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call to run_titiler(show_logs=False) expects a tuple return value, but run_titiler returns None when return_titiler_endpoint=False (its default). This will cause an error attempting to unpack None. You should pass return_titiler_endpoint=True to ensure the tuple is returned: titiler_endpoint, _, _ = run_titiler(show_logs=False, return_titiler_endpoint=True)
| titiler_endpoint, _, _ = run_titiler(show_logs=False) | |
| titiler_endpoint, _, _ = run_titiler(show_logs=False, return_titiler_endpoint=True) |
| def run_titiler( | ||
| show_logs: bool = False, | ||
| start_port: int = 8000, | ||
| max_port: int = 8100, | ||
| return_titiler_endpoint: bool = False, | ||
| ): |
Copilot
AI
Nov 12, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mixing implicit and explicit returns may indicate an error, as implicit returns always return None.
Co-authored-by: Copilot <[email protected]>
|
🚀 Deployed on https://6914db35fc18842ffd1acb55--opengeos.netlify.app |
Co-authored-by: Copilot <[email protected]>
* Add support for creating local TiTiler endpoint * Remove jupyter-duckdb * Update pyproject.toml Co-authored-by: Copilot <[email protected]> * Update endpoint * Update mkdocs.yml Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Copilot <[email protected]>
No description provided.