Conversation
There was a problem hiding this comment.
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.
| """ | ||
| if titiler_endpoint is None: | ||
| if titiler_endpoint is not None and titiler_endpoint.lower() == "local": | ||
| titiler_endpoint, _, _ = run_titiler(show_logs=False) |
There was a problem hiding this comment.
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, | ||
| ): |
There was a problem hiding this comment.
Mixing implicit and explicit returns may indicate an error, as implicit returns always return None.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
🚀 Deployed on https://6914db35fc18842ffd1acb55--opengeos.netlify.app |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Add support for creating local TiTiler endpoint * Remove jupyter-duckdb * Update pyproject.toml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update endpoint * Update mkdocs.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.