Skip to content

Make COG web friendly #1820

@sharkAndshark

Description

@sharkAndshark

WebMercatorQuad is the most popular tile grid. Almost all clients (maplibre, OL, Mapbox, etc) take it as default.

It would be better if martin could support it like:

Configuration

cog:
  # default false. 
  # When enabled, martin would take the requested tile index(/{z}/{x}/{y}) as tile index of webmercatorquad, and martin will finish the clipping and warping internally.
  # It only works when the projection of COG file it's 3857
  web_friendly: true

Tilejson

Martin would create a mapping between the inner custom tilegrid of cog file and the WebMercatorQuad.

The min/max zoom would be updated then.

/cog_source


{
//  "maxzoom": 3, Before web_friendly enabled
//  "minzoom": 0,  Before web_friendly enabled
 "maxzoom": 14,   // after web_friendly enabled
 "minzoom":  11,  // after web_friendly enabled
  "tilejson": "3.0.0",
  "tiles": [
    "http://localhost:3111/cog_source/{z}/{x}/{y}"
  ]
}

No any tilejson Compatibility got broken here and the most popular projection and tilegrid got supported then.

Titiler support WebMercatorQuad for COG either and even more custom tilegrid can be added, and its enpoint is flexible like /cog/tiles/{tileMatrixSetId}/{z}/{x}/{y}[@{scale}x][.{format}], see https://developmentseed.org/titiler/endpoints/cog/#api

Metadata

Metadata

Assignees

Labels

cogRelated to Cloud Optimised GeoTIFFs

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions