mapbox/geojson-vt

Point Lost: while three point in a line and the second point is in the dividing line of the tile(with buffer), then the point will be lost in particular level.

DeZhao-Zhang opened this issue · 0 comments

Question describe

Other data is ok, while the second point is in the dividing line of the tile(with buffer), this bug will happan

  1. while I use data as blow
{
 "type": "FeatureCollection",
 "features": [
  {
   "type": "Feature",
   "geometry": {
    "type": "Polygon",
    "coordinates": [
     [
      [20.0, 34.365234375],
      [80.0, 4.34326171875],
      [45.0, 4.34326171875],
      [20.0, 4.34326171875],
      [20.0, 34.365234375]
     ]
    ]
   },
   "properties": {
    "title": "路线一",
    "kind": 1
   }
  }
 ]
}
  1. set buffer to 0
    image

  2. the point of this triangle will lost in particular level

6abaf1931b23a7dad83c7b4dd6f7c4a

439bd6486ea6e24dfe27a3c2fff9ab5

Solusion

image

Why

  1. while the three point is in a line, the tolerance of second point is 0
  2. while clip the polygon into a child tile, old code, the first and second point have no intersect whit the axis
  3. while create a tile, the tolerance is small will be lost for simplify and cause this problem.

For merge request

#161