[PostGIS] #5654: Missing line segment with self-intersection and MVT

PostGIS trac at osgeo.org
Thu Jan 25 11:33:32 PST 2024


#5654: Missing line segment with self-intersection and MVT
-----------------------+------------------------------------
  Reporter:  mhkeller  |      Owner:  pramsey
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 3.4.2
 Component:  postgis   |    Version:  3.4.x
Resolution:            |   Keywords:  mvt, self-intersection
-----------------------+------------------------------------

Old description:

> 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 with photos 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).

New description:

 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 with photos 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).

--
Comment (by pramsey):

 In what XYZ tile address do you see the effect? All at all Z scales?
 Multiple Z scales? One? A useful repro from my PoV is a piece of SQL that
 generates an obviously wrong tile.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5654#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list