fix: Allow simplifying geometries in OGC Tiles API#249
fix: Allow simplifying geometries in OGC Tiles API#249guillemc23 wants to merge 6 commits intodevelopmentseed:mainfrom
Conversation
|
Those parameters were implemented only on the
Well it should be in the unit of the output CRS, we just need to make it clear in the documentation.
might be interesting to add it as well |
Yeah, you're right! I modified the docstring to match the behavior as well.
I might open a new PR if I have the time to test it 😄 |
|
Hey @vincentsarago I was wondering, why is def _select_mvt(
self,
properties: Optional[List[str]],
geometry_column: Column,
tms: TileMatrixSet,
tile: Tile,
simplify: Optional[float],
preserve_topology: Optional[bool]
):
"""Create MVT from intersecting geometries."""
geom = pg_funcs.cast(logic.V(geometry_column.name), "geometry")
if simplify:
geom = logic.Func(
"ST_SnapToGrid",
logic.Func("ST_SimplifyPreserveTopology" if preserve_topology else "ST_Simplify", geom, simplify),
simplify,
)
...If you think it's too specific for my use case, I can keep these in a custom collection |
|
@guillemc23 Let's see what @bitner has to say but using |
|
Generally, you shouldn't need to run simplify when creating vector tiles as st_asmvt already will reduce the data based on the resolution of the tile. That being said, if something is necessary to control simplification even further, I'm certainly not opposed including this, and yeah, st_simplifypreservetopology is likely safer. |
Hi everybody!
I believe there is a bug on the OGC Tiles API when simplifying the geometry. This possibility is documented in the official docs (https://developmentseed.org/tipg/user_guide/endpoints/#vector-tiles) but the behavior does not seem to be implemented.
I implemented the feature with small changes on the codebase, but I'm not sure if this is your ideal solution, though it works flawlessly. The only thing I haven't managed is to be coherent with the units, since in the other endpoints this simplify magnitude is given in degrees, but in this case it gets applied in meters (might be related with order of operations).
I would appreciate some input if on this feature :)
PS: I have noticed that
bbox_onlyis also documented but not implemented.