Skip to content

mhkeller/postgis-line-repro

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PostGIS Line Bug Reproduction

Install

npm install

Bug description

I'm hosting a table of four points in PostGIS and querying it to create a vector tile layer of a line connecting the points. See the create-table.js for table creation and data.

The second and third points in the table are the same.

The linestring as GeoJSON is this:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "coordinates": [
          [
            -74.002571106,
            40.741008759
          ],
          [
            -73.986976624,
            40.741008759
          ],
          [
            -73.974761963,
            40.729633331
          ],
          [
            -73.986976624,
            40.741008759
          ]
        ],
        "type": "LineString"
      }
    }
  ]
}

The problem is when I load the vector tile layer in MapLibre or Mapbox GL JS, the third point does not show up. If points 2 and 4 are not identical, then it shows the line properly so I think the problem is with the line double backing on itself but I can't figure out why or how to fix it.

Here's what the line should look like:

Correct line

Versus what it actually does (disregard line style)

Bug line

Steps to reproduce

  1. Rename .env.sample to .env and add your postgres connection credentials
  2. Add your own basemap layer in index.html
  3. Create the table and load data with node create-table.js
  4. Run the tile server with npm run tile-server
  5. Run the web server with npm run web-server

Navigate to http://127.0.0.1:8080

You'll see this:

Bug

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published