Skip to content

feat: add LOCAL TMS concept - #29

Closed
vincentsarago wants to merge 3 commits into
mainfrom
feat/local-tms
Closed

vincentsarago wants to merge 3 commits into
mainfrom
feat/local-tms

Conversation

@vincentsarago

Copy link
Copy Markdown
Member

This PR drafts the concept of Local TMS, reading COG/GeoZARR using their native/internal block instead of the external (e.g WebMercatorQuad).

The goal is to offer a x/y/z interface to a dataset for Clients

@kylebarron

Copy link
Copy Markdown
Member

There still needs to be communication with the client what the local TMS is, because the client needs to know how to fetch the right tiles. But perhaps the frontend could fetch that from and endpoint that describes the local TMS of a file?

@vincentsarago

vincentsarago commented Sep 15, 2026 •

Copy link
Copy Markdown
Member Author

But perhaps the frontend could fetch that from and endpoint that describes the local TMS of a file?

exactly, that's what the /geotiff/tiles/LocalTileMatrixSet?url=path_to_geotiff.tif will return

👇

Details ``` curl http://127.0.0.1:8000/geotiff/tiles/LocalTileMatrixSet?url=tests%2Ffixtures%2Fcog.tif&f=json { "title": "tileset tiled using LocalTileMatrixSet TileMatrixSet", "dataType": "map", "crs": "http://www.opengis.net/def/crs/EPSG/0/32621", "links": [ { "href": "http://127.0.0.1:8000/geotiff/tiles/LocalTileMatrixSet?url=tests%2Ffixtures%2Fcog.tif", "rel": "self", "type": "application/json", "title": "Tileset tiled using LocalTileMatrixSet TileMatrixSet" }, { "href": "http://127.0.0.1:8000/geotiff/tiles/LocalTileMatrixSet/%7Bz%7D/%7Bx%7D/%7By%7D?url=tests%2Ffixtures%2Fcog.tif", "rel": "tile", "templated": true, "title": "Templated link for retrieving Raster tiles" }, { "href": "http://127.0.0.1:8000/geotiff/LocalTileMatrixSet?url=tests/fixtures/cog.tif", "rel": "http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme", "type": "application/json", "title": "Definition of 'LocalTileMatrixSet' tileMatrixSet" }, { "href": "http://127.0.0.1:8000/geotiff/LocalTileMatrixSet/map.html?url=tests%2Ffixtures%2Fcog.tif", "rel": "data", "type": "text/html", "title": "Map viewer for 'LocalTileMatrixSet' tileMatrixSet" } ], "tileMatrixSetLimits": [ { "tileMatrix": "0", "minTileRow": 0, "maxTileRow": 1, "minTileCol": 0, "maxTileCol": 1 }, { "tileMatrix": "1", "minTileRow": 0, "maxTileRow": 2, "minTileCol": 0, "maxTileCol": 2 }, { "tileMatrix": "2", "minTileRow": 0, "maxTileRow": 5, "minTileCol": 0, "maxTileCol": 5 }, { "tileMatrix": "3", "minTileRow": 0, "maxTileRow": 10, "minTileCol": 0, "maxTileCol": 10 }, { "tileMatrix": "4", "minTileRow": 0, "maxTileRow": 10, "minTileCol": 0, "maxTileCol": 10 } ], "boundingBox": { "lowerLeft": [ -61.28762442711404, 72.22979795551834 ], "upperRight": [ -52.301598718454485, 74.66298001264106 ], "crs": "http://www.opengis.net/def/crs/EPSG/0/4326" }, "accessConstraints": "unclassified" } ```

within the /tiles/tileMatrixSet, a specific link with "http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme" rel will point to the LocalTileMatrixSet definition 👇

Details
curl http://127.0.0.1:8000/geotiff/LocalTileMatrixSet?url=tests/fixtures/cog.tif&f=json
{
  "id": "LocalTileMatrixSet",
  "orderedAxes": [
    "X",
    "Y"
  ],
  "crs": "http://www.opengis.net/def/crs/EPSG/0/32621",
  "boundingBox": {
    "lowerLeft": [
      373185.0,
      8019284.949381611
    ],
    "upperRight": [
      639014.9492102272,
      8286015.0
    ]
  },
  "tileMatrices": [
    {
      "id": "0",
      "scaleDenominator": 5684986.08234019,
      "cellSize": 1591.796103055253,
      "cornerOfOrigin": "topLeft",
      "pointOfOrigin": [
        373185.0,
        8286015.0
      ],
      "tileWidth": 128,
      "tileHeight": 128,
      "matrixWidth": 2,
      "matrixHeight": 2
    },
    {
      "id": "1",
      "scaleDenominator": 2851029.056308744,
      "cellSize": 798.2881357664482,
      "cornerOfOrigin": "topLeft",
      "pointOfOrigin": [
        373185.0,
        8286015.0
      ],
      "tileWidth": 128,
      "tileHeight": 128,
      "matrixWidth": 3,
      "matrixHeight": 3
    },
    {
      "id": "2",
      "scaleDenominator": 1427658.1590237769,
      "cellSize": 399.7442845266575,
      "cornerOfOrigin": "topLeft",
      "pointOfOrigin": [
        373185.0,
        8286015.0
      ],
      "tileWidth": 128,
      "tileHeight": 128,
      "matrixWidth": 6,
      "matrixHeight": 6
    },
    {
      "id": "3",
      "scaleDenominator": 714366.1969532067,
      "cellSize": 200.02253514689787,
      "cornerOfOrigin": "topLeft",
      "pointOfOrigin": [
        373185.0,
        8286015.0
      ],
      "tileWidth": 128,
      "tileHeight": 128,
      "matrixWidth": 11,
      "matrixHeight": 11
    },
    {
      "id": "4",
      "scaleDenominator": 357183.09847660334,
      "cellSize": 100.01126757344893,
      "cornerOfOrigin": "topLeft",
      "pointOfOrigin": [
        373185.0,
        8286015.0
      ],
      "tileWidth": 256,
      "tileHeight": 256,
      "matrixWidth": 11,
      "matrixHeight": 11
    }
  ]
}

@vincentsarago

Copy link
Copy Markdown
Member Author

superseded by #30

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