Skip to content

TiTiler URL Helpers

Generate tile, preview, and statistics URLs for use with a TiTiler instance.

Info

abovepy does not depend on TiTiler. These helpers only construct URLs — you bring your own TiTiler deployment (or use the public endpoint at https://titiler.xyz).

from abovepy.titiler import cog_tile_url

url = cog_tile_url("https://kyfromabove.s3.amazonaws.com/dem-phase3/N123E456.tif")
# Use the returned TileJSON URL in MapLibre GL JS or Leaflet

titiler

TiTiler URL helpers — generates tile URLs for web map integration.

This package provides URL builders for TiTiler and TiTiler-pgSTAC instances. All functions are re-exported here for backward compatibility.

cog_tile_url(cog_url, titiler_endpoint=DEFAULT_TITILER_ENDPOINT)

Generate a TiTiler tile URL for a COG.

Parameters:

Name Type Description Default
cog_url str

URL to the Cloud-Optimized GeoTIFF.

required
titiler_endpoint str

TiTiler service URL.

DEFAULT_TITILER_ENDPOINT

Returns:

Type Description
str

TileJSON URL for use with MapLibre/Leaflet.

cog_preview_url(cog_url, titiler_endpoint=DEFAULT_TITILER_ENDPOINT, max_size=1024)

Generate a TiTiler preview image URL.

Parameters:

Name Type Description Default
cog_url str

URL to the COG.

required
titiler_endpoint str

TiTiler service URL.

DEFAULT_TITILER_ENDPOINT
max_size int

Maximum dimension in pixels.

1024

Returns:

Type Description
str

Preview PNG URL.

cog_stats_url(cog_url, titiler_endpoint=DEFAULT_TITILER_ENDPOINT)

Generate a TiTiler statistics URL for a COG.

Parameters:

Name Type Description Default
cog_url str

URL to the COG.

required
titiler_endpoint str

TiTiler service URL.

DEFAULT_TITILER_ENDPOINT

Returns:

Type Description
str

Statistics JSON URL.