tegola icon indicating copy to clipboard operation
tegola copied to clipboard

Use slippy.Grid to support tiles in different projections systems

Open ear7h opened this issue 5 years ago • 4 comments

This issue is for a design of using the new slippy.Grid in tegola, in order for it to output multiple projection systems. Implementation of this functionality would close #243, #267, and #660.

Some issues to consider for this design are:

  1. where should the output projection system be specified? (url query string, config, command line?)
  2. where in the code should the conversion take place? and how should the info from (1) get there?
  3. Depending on (1) how should the cache work?
    • the same /:map/:layer/:z/:x/:y could have multiple tiles with different projections

(I'll post my own later this week)

ear7h avatar Jan 22 '20 19:01 ear7h

I know @jj0hns0n has some opinions on this with some of the work he's been prototyping.

ARolek avatar Jan 22 '20 20:01 ARolek

@ear7h lets have a quick chat in slack. Definitely have some opinions about 1 & 3 based on work for the OGC testbed.

jj0hns0n avatar Jan 24 '20 13:01 jj0hns0n

After talking to @jj0hns0n it looks like we should add support for OGC API tiles. It looks like:

{
    "description": "OGC API Tiles",
    "links": [
        {
            "href": "http://tiles.example.com/maps/{tileMatrixSetId}/{tileMatrix}/{tileCol}/{tileRow}.pbf",
            "rel": "item",
            "title": "Mapbox vector tiles",
            "type": "application/vnd.mapbox-vector-tile"
        }
    ],
    "tileMatrixSetLinks": [
        {
            "tileMatrixSet": "WorldCRS84Quad",
            "tileMatrixSetURI": "http://schemas.opengis.net/tms/1.0/json/examples/WorldCRS84Quad.json"
        },
        {
            "tileMatrixSet": "WebMercatorQuad",
            "tileMatrixSetURI": "http://schemas.opengis.net/tms/1.0/json/examples/WebMercatorQuad.json"
        }
    ],
    "title": "OGC-API-Tiles"
}

This format is helpful in understanding how one client might deal with multiple projection systems. One rule we that should guide the implementation is each served tile set must have the same srid for all of its layers but, a map configured in tegola can result in multiple served tile sets. An implementation might entail:

  • In the config, a map would have a projections array parameter to take all the SRIDs
    • there would also be configurations like srid_format and srid_query to tell tegola how the the composite map name (name + srid) will be constructed or the name of the url query var respectively (the two options are mutually exclusive).
  • an array of SRIDs would be part of each atlas.Map
    • a single atlas.Map might actually return multiple maps for serving as a tilejson/ogc api
    • the srid becomes part of the key in the cache
  • Projection conversion would happen in atlas.Map.EncodeMVTile where there is currently a check for it

ear7h avatar Jan 24 '20 22:01 ear7h