Skip to content

Add hakunapi-tiles-core, the OGC API - Tiles model and tiles configuration - #238

Merged
jampukka merged 1 commit into
nlsfi:mainfrom
jampukka:tiles/core
Oct 16, 2026
Merged

jampukka merged 1 commit into
nlsfi:mainfrom
jampukka:tiles/core

Conversation

@jampukka

@jampukka jampukka commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

New community module (src-community/hakunapi-tiles-core, depends only on hakunapi-core). It is the model and configuration for OGC API - Tiles; nothing serves tiles yet. The servlet, the tile sources and the generator come in later PRs, so several classes here have no caller until then.

Key classes:

  • Tileset model (concept, not a class)
    • A tile layer is an id plus the tile matrix sets it is published in; a source turns an address (matrix set, matrix, row, col) into a Tile
    • Vector and map (raster) layers are separate, mirroring /collections/{id}/tiles and /map/tiles
  • VectorTileSource / MapTileSource
    • ServiceLoader extension points, the data-plane counterpart of SimpleSource; a source parses its own tiles.layers.<id>.* keys into a layer and later serves its tiles
  • Tile / BytesTile / BodyTile
    • A tile is an address, a media type and something that can write itself; BytesTile holds finished bytes, BodyTile a lazy TileBody so a generating source encodes straight into the response
  • TileMatrixSet / TileMatrix / DefaultTileMatrixSetRegistry
    • OGC 17-083r4 tiling schemes; the registry is seeded with WebMercatorQuad and the sets named in configuration
  • TilesConfigParser
    • Wraps HakunaConfigParser so core stays free of the tiles model; derives matrix sizes from extent and resolution and rejects sets that are not a whole number of tiles per level
  • TileLocator / AcceleratedTileLayer / AcceleratedTilesets
    • For stores where a tile is one contiguous run in a file: location kept in memory as a packed offset and length, so a front end can send the byte range itself
    • Accelerated means we can utilize sendfile()
  • ZoomRoutedVectorTileSource / ZoomBacking
    • zoom-routed-vector: one layer backed by several sources by zoom range, optionally extracting one MVT layer from a backing's tile (MvtLayerExtract); a zoom no backing covers answers with an empty tile rather than 404
  • schemas
    • TileJSON and OGC tileset documents, plain getter classes as elsewhere in the repo

Behaviour changes:

  • ConformanceClass gains the OGC API - Tiles and tile matrix set URIs. Nothing claims them yet, so /conformance is unchanged
  • HakunaConfigParser gains getProperties(), so ZoomRoutedVectorTileSource can derive a parser for its backings. The returned object is the shared one and must not be mutated

@jampukka
jampukka merged commit 72494db into nlsfi:main Oct 16, 2026
2 checks passed
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.

1 participant