go-spatial / tegola

Tegola is a Mapbox Vector Tile server written in Go
http://tegola.io/
MIT License
1.3k stars 198 forks source link

Use slippy.Grid to support tiles in different projections systems #668

Open ear7h opened 4 years ago

ear7h commented 4 years ago

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)

ARolek commented 4 years ago

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

jj0hns0n commented 4 years ago

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

ear7h commented 4 years ago

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:

tomass commented 2 months ago

Wouldn't it be simpler if tegola would simply support ONE projection per installation (or one projection per map)? If I understand correctly, upon receiving a request of tile: "scale/x/y" you have to calculate extent of the tile and use it for postgis mvt call?

You could specify tileMatrix info mentioned above in this issue in configuration file (basically extent and scale:resolutions info, tilesize) and that would be enough to calculate tile extent?