dartclub / turf_dart

A turf.js-like geospatial analysis library working with GeoJSON, written in pure Dart.
https://pub.dev/packages/turf
MIT License
62 stars 28 forks source link

lineIntersect on Polygon has unexpected result #173

Open jsiedentop opened 4 months ago

jsiedentop commented 4 months ago

lineIntersect on polygons leads to unexpected result. In TurfJs we get all 3 points of the polygon, in TurfDart we only get one Point.

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -53.57208251953125,
              28.287451910503744
            ],
            [
              -53.33038330078125,
              28.29228897739706
            ],
            [
              -53.34136962890625,
              28.430052892335723
            ],
            [
              -53.57208251953125,
              28.287451910503744
            ]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": {},
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [
              -53.57208251953125,
              28.287451910503744
            ],
            [
              -53.34136962890625,
              28.430052892335723
            ],
            [
              -53.33038330078125,
              28.29228897739706
            ],
            [
              -53.57208251953125,
              28.287451910503744
            ]
          ]
        ]
      }
    }
  ]
}
jsiedentop commented 4 months ago

could be related to #150