Feature Store
Persistent backing for cached feature data. Supports both shapes that the source layer may produce:
Bulk — every row in one stream (WFS, Shapefile).
Tile-addressed — rows keyed by
(z, x, y)(OsmBuildings).
One GPKG features table backs both. Tile-addressed rows carry (z, x, y) columns populated; bulk rows leave them NULL. The store knows nothing about the schema beyond "rows keyed by tile or by insertion order" — CachedFeatureRow is the wire format both paths use.
Inheritors
Functions
Drop a tile entry from the store.
Apply cachePolicy now. Idempotent / unbounded → no-op.
Read every bulk row ((z, x, y) IS NULL) in insertion order.
Read rows for one tile, or null if the tile is absent (cache miss). An empty flow distinguishes "tile cached with zero rows" from "tile not cached". sector is the tile's true geographic bounds for the spatial query; null → derive Web-Mercator slippy bounds from (z, x, y) (back-compat for slippy-keyed tiles).
Epoch-millis the tile at (z, x, y) was last written, for stale-while-revalidate. Default null = freshness isn't tracked (the store opts out of SWR — its tiles are served but never background-refreshed).
Atomically replace every bulk row with the supplied flow. Existing tile-addressed rows are left untouched.
Persist sector as the store's content bounding box — the data-availability extent a bulk download records (e.g. gpkg_contents). Default no-op for stores without one.
Atomically replace rows for one tile. Pass an empty flow to record "tile has no features" — that's the negative cache for ocean / empty Overpass responses. sector is the tile's true geographic bounds (null → slippy bounds from (z, x, y)).