PYR1-1786 Set vector tile layers to 1x1 metatiling - #102
Merged
Merged
Conversation
GeoServer 2.27 (GEOS-12037) started routing vector tiles through the same metatile as rasters, measured against the WMS max rendering memory. One 4x4 metatile of fire-history pulls 16,623 of its 17,579 features to paint a tile that needs 57, so GeoServer aborts and GWC answers 400 for every tile in the metatile. Fire perimeters stopped drawing. GeoServer auto-creates these tile layers from the gwc-gs*.xml defaults, which set 4x4, and geosync is the only thing that knows the layers exist. 1. Add rest-api/update-cached-layer-metatiling, which sets the metatile size while keeping the mime formats and grid subsets GeoServer already holds and setting no TIME filter 2. Add core/file-specs->vector-gwc-specs for the geopackage and shapefile stores, alongside the imagemosaic filter that feeds the TIME filter updates 3. Walk those layers back to 1x1 after registering them
danielhvs
force-pushed
the
PYR1-1786-vector-tile-metatiling
branch
from
September 22, 2026 22:38
318c26e to
5f05f2b
Compare
The old test timed a 5ms Thread/sleep inside a with-redefs stub to assert peak concurrency was 1, which made it slow, timing-dependent, and really an assertion about mapv rather than about our code. 1. Extract cached-layer-delete-ok? so the accept/reject decision is a pure function of the status code, returning a boolean rather than the set hit 2. Test it on plain values: no stub, no sleep, no timing This drops the sequential-execution assertion. The reason to stay sequential is still recorded in the delete-cached-layers! docstring.
lambdatronic
approved these changes
Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
Register vector tile layers with a 1x1 metatile instead of the 4x4 GeoServer gives them by default. Fire perimeters stopped drawing on development because every vector tile request for
fire-detections_fire-history:fire-historyreturned a GWC 400.GeoServer 2.27 (GEOS-12037, commit
b46c98a9, 2026-01-16) started routing vector tiles through the same metatile as rasters, measured against the WMS max rendering memory. The class is absent in 2.26.x and earlier, which is why production on 2.19.6 never saw this.rest-api/update-cached-layer-metatilingsets the metatile size while keeping the mime formats and grid subsets GeoServer already holds, and sets no TIME filter - vector stores carry no time dimensioncore/file-specs->vector-gwc-specsselects the geopackage and shapefile stores, alongside the existing imagemosaic filter that feeds the TIME filter updatesadd-directory-to-workspace-aux!walks those layers back to 1x1 after registering themWhy geosync
GeoServer auto-creates the tile layer for a vector store from the
gwc-gs*.xmldefaults, which putapplication/vnd.mapbox-vector-tilefirst and the metatile at 4x4. Lowering that default inpyrecast-gcp-deploymentwould also strip metatiling from every raster layer on the same GeoServer, where 4x4 has been correct for years. geosync is the only thing that knows which layers are vector.The existing
update-cached-layerwas not reusable: it hardcodes png/jpeg mime formats, which would dropmapbox-vector-tileand break the client, and it writes a TIME regex filter these layers have no dimension for.The numbers
Counted against
/srv/gis/fire_detections/fire-history/fire-history.gpkgfor the failing tile z=5 col=4 row=11:At that zoom the metatile swallows 95% of the CONUS dataset to paint one Pacific Northwest tile.
Related Issues
Closes PYR1-1786
Testing
Module Impacted
GWC tile layer registration for geopackage and shapefile stores.
Steps
clojure -M:test-runner- 8 tests, 35 assertions, including the two newrest-api-testcases andfile-specs->vector-gwc-specs-testclj-kondo --lint src test- 0 errors, 0 warningsmetaWidthHeightto 1x1 for the fire-history tile layer, which is what this code now does at registrationcatalina.outforMVT metatile memory cap exceededDesired Outcome
All eight previously-failing tiles return HTTP 200 with vector tile payloads from 4.5 KB to 2.2 MB, and no
MVT metatile memory cap exceededappears afterwards. Both confirmed on development.Not exercised: the geosync code path itself against a live GeoServer. The GeoServer admin credential was unavailable in this session, so step 3 set the tile layer config directly rather than through this code. The REST body it produces is covered by the unit tests.
Screenshots
N/A - the visible change is fire perimeters drawing again.