Skip to content

Conversation

@Auspicus
Copy link

@Auspicus Auspicus commented Jan 17, 2026

notes

  • if the COG is aligned to the mercator grid aka. "Web Friendly" (each chunk in the file starts and ends at the boundaries of a martin tile), for instance by using gdal_translate cog.tif cog_aligned.tif -of COG -co TILING_SCHEME=GoogleMapsCompatible, reading a tile could be a lot more efficient as we can skip re-projecting pixels from file model space to the grid
  • this PR adds a requirement for the COG to be projected in EPSG:3857 which seemed to have been required before but was not enforced, the OGC COG spec makes no such assertion but we probably don't want to have to support re-projecting COGs written in arbitrary CRS. downloading a sample COG from AWS USDA NAIP mirror which was projected in NAD83 (EPSG:26910) doesn't work with the current assumptions without prior reprojection to EPSG:3857
  • this PR removes the previous ability to read a COG source using arbitrary model space indexing (where /cog_source/0/0/0 does not align with expected mercator tiles) which is not backwards compatible but since this feature is unstable, perhaps this is OK?
  • it appears that the full COG file is loaded into memory (which can be > 4GB with the BIGTIFF extension) and might be avoidable as COGs are assumed to be tiled in chunks of 256x256 or 512x512 so theoretically each tile request only needs to load up to 4 tiles at worst and 1 tile at best (depending on boundaries)

@Auspicus Auspicus changed the title Allow requesting tiles from COG sources using WebMercator convention behind auto_webmercator config option feat(martin): Allow requesting tiles from COG sources using WebMercator convention behind auto_webmercator config option Jan 17, 2026
@Auspicus Auspicus marked this pull request as draft January 17, 2026 07:37
@Auspicus Auspicus changed the title feat(martin): Allow requesting tiles from COG sources using WebMercator convention behind auto_webmercator config option feat(martin): Allow requesting tiles from COG sources using standard WebMercator tile ZXY indexing Jan 17, 2026
@Auspicus Auspicus changed the title feat(martin): Allow requesting tiles from COG sources using standard WebMercator tile ZXY indexing feat(martin): Allow requesting tiles from COG sources using standard WebMercator tile ZXY indexing, expose COG extent and tileSize in TileJSON Jan 17, 2026
@Auspicus Auspicus changed the title feat(martin): Allow requesting tiles from COG sources using standard WebMercator tile ZXY indexing, expose COG extent and tileSize in TileJSON feat(martin): Allow requesting tiles from COG sources using standard WebMercator tile ZXY indexing, expose COG bounds and tileSize in TileJSON Jan 17, 2026
@Auspicus Auspicus changed the title feat(martin): Allow requesting tiles from COG sources using standard WebMercator tile ZXY indexing, expose COG bounds and tileSize in TileJSON feat(martin): Change tile path semantics for COG sources to match other sources, expose COG bounds and tileSize in TileJSON Jan 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants