mapbox/geojson-vt

wrong clip results

ThFischer opened this issue · 3 comments

I switched from version 2.4.0 to 3.2.1 because of a fixed issue with polygon clipping.
Unfortunately version 3.2.1 has another polygon clipping issue:

myData = {
  type: "FeatureCollection",
  features: [
    {
      type: "Feature",
      geometry: {
        type: "Polygon",
        coordinates: [[[-90, -90], [0, -90], [90, -90], [0, 0], [-90, -90]]]
        // This coordinates would be clipped correct:
        // coordinates: [[[-90, -90], [90, -90], [0, 0], [-90, -90]]]
      }
    }
  ]
};
myOptions = {
  indexMaxZoom: 0,
  maxZoom: 24,
  tolerance: 1.5,
  extent: 4096,
  buffer:0
};
geojsonvt(myData, myOptions).getTile(1, 1, 1).features[0].geometry;

Expected
The half of the shape on the eastern hemisphere
like: [[[0, 4096], [2048, 4096], [0,0], [0, 4096]]]

Results
v2.4.0: [[[0, 4096], [0,0], [0,0], [2048, 4096], [0, 4096]]] okayish
v3.2.1: [[[2048, 4096], [0, 0], [0, 0]]] wrong

BTW:
The geojson-vt demo page seems to not use the current version 3.2.1

Facing to this bug too :(

image

Is it fair to say this project is dead, if such old bugs remain un-fixed?