Repository navigation
fix: expand tile envelope filter by the tile buffer - #315
Open
vincentsarago wants to merge 2 commits into
Open
vincentsarago wants to merge 2 commits into
vincentsarago wants to merge 2 commits into
Conversation
`ST_AsMVTGeom` keeps geometries up to `tile_buffer` pixels outside of the tile, but the tile filter only selected features intersecting the tile itself, so features in the buffer were never encoded (clipped lines/polygons and missing labels at tile edges). `Collection.cql_where` gets `tile_buffer` / `tile_resolution` options to expand the tile envelope (within the TMS bounds); both backends pass the MVT settings. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Stacked on #307. Independent of #314.
Why
ST_AsMVTGeomencodes geometries up toTIPG_TILE_BUFFER(default 256) pixels outside of the tile, so lines, polygon outlines and labels continue across tile edges. But the tile filter only selected features intersecting the tile itself, so features in the buffer were never part of the query, and nothing was ever drawn there. This affected both backends: lines and polygon outlines were cut at tile edges, and labels or symbols near the edges were missing.What
Collection.cql_wheregetstile_buffer(pixels) andtile_resolutionoptions. The tile envelope is expanded bytile_buffer / tile_resolutionof the tile size, in the TMS CRS, before being reprojected to the column CRS.is_valid(strict=False)) are never shrunk.PgCollection.get_tileandDuckCollection.get_tilepassmvt_settings.tile_buffer/tile_resolution.cql_wherewithout the new options behaves as before (no buffer).Martin does the same: its tile filter expands the envelope by the buffer.
Tests
tests/duck/test_tile_buffer.py(z4 tile, 256px buffer ≈ 1.4°):test_projjson_crs: the z8 tile now has 3 features instead of 1. Two of the points are just outside the tile but inside its buffer (checked against the tile bounds).cql_wherecode plus passing the two settings; there is no PostgreSQL-specific buffer test.🤖 Generated with Claude Code