[postgis-users] Question on missing linestring involving self-intersection and MVT

Michael Keller mhk at mhkeller.com
Sat Dec 16 09:53:22 PST 2023


I could use some help on figuring out if this is a PostGIS bug or a problem with my vector tile query.

I'm trying to generate a vector tile layer of a linestring consisting of four points (you could use more than four points but this is just a simplified example). Here is the linestring in geojson (https://gist.github.com/mhkeller/9a65553c28d5063b45817b7d996b59c3)

The second and the fourth points are the same, so the line doubles back on itself. When I use this query (https://gist.github.com/mhkeller/05d7eafc43966a2b3b5b2d41784b300b) in a tile server, the third point in the line string is missing.

I've made a full but simple reproduction here: https://github.com/mhkeller/postgis-line-repro

I also tried using the dirt-simple-postgis-http-api (https://github.com/tobinbradley/dirt-simple-postgis-http-api) instead of the one I wrote and I get the same result.

However, if I generate the tiles using geojson2mvt (https://github.com/NYCPlanning/labs-geojson2mvt), the line renders correctly. A stack exchange user reported that generating the tiles with MapTiler also renders the line correctly (https://gis.stackexchange.com/questions/471851/missing-line-segment-when-serving-a-vector-tile-from-postgis#comment772175_471851).

Is this a PostGIS bug or is there something I can change on my end? Thanks for any insight.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20231216/1294e164/attachment.htm>


More information about the postgis-users mailing list