Opened 13 days ago

Last modified 7 days ago

#5717 new defect

ST_AsMVTGeom simplification causing partial LINESTRING to be returned in query

Reported by: mikestrong Owned by: pramsey
Priority: medium Milestone: PostGIS 3.4.3
Component: postgis Version: 3.4.x
Keywords: ST_AsMVTGeom Cc:

Description

Description: We have identified a critical use case in our geospatial modeling where linestring geometries loop back on themselves. This functionality is essential for the accuracy of our models.

Issue: When querying our database to generate Mapbox vector tiles, we observe an excessive simplification of these linestrings. This issue results in geometries where segments are completely missing.

Sample Query Demonstrating the Issue:

SELECT

ST_AsMVTGeom(

ST_GeomFromText('LINESTRING (19095.0221602251 6834858.945857642, 19041.721639571162 6834839.288850678, 18971.562253433633 6834858.544009158, 19041.721639571162 6834839.288850678, 19095.0221602251 6834858.945857642)'), ST_TileEnvelope(17, 65598, 43181), 8192, clip_geom ⇒ false

)

It might be beneficial to introduce an adjustable parameter for controlling the level of simplification, akin to the ST_Simplify tolerance option. Such a feature would provide greater flexibility and precision in managing how geometries are simplified, ensuring accurate rendering of complex linestrings.

Change History (2)

comment:1 by mikestrong, 13 days ago

Summary: ST_AsMVTGeom simplification causing partial LINESTRING to be displayedST_AsMVTGeom simplification causing partial LINESTRING to be returned in query

comment:2 by robe, 7 days ago

Milestone: PostGIS 3.4.3

We recently addressed something which sounds similar to your case at #5654. I haven't confirmed it fixes your issue.

Note: See TracTickets for help on using tickets.