Skip to content
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

Fix d2s_tile bug #887

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions leafmap/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -14104,9 +14104,7 @@ def ee_tile_url(
return None


def d2s_tile(
url: str, titiler_endpoint: str = "https://tt.d2s.org", **kwargs: Any
) -> str:
def d2s_tile(url: str, titiler_endpoint: str = None, **kwargs: Any) -> str:
"""Generate a D2S tile URL with optional API key.

Args:
Expand All @@ -14122,6 +14120,9 @@ def d2s_tile(
ValueError: If the API key is required but not set in the environment variables.
"""

if titiler_endpoint is None:
titiler_endpoint = os.environ.get("TITILER_ENDPOINT", "https://titiler.xyz")

stats = cog_stats(url, titiler_endpoint=titiler_endpoint, **kwargs)
if "detail" in stats:
api_key = get_api_key("D2S_API_KEY")
Expand Down
Loading