question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug :intersect returns null although two polygones crosses each other

See original GitHub issue
var points1 = [[[103.06965947998805, 25.166360955441036],
    [103.06936423825272, 25.16592004745796],
    [103.06997932523149, 25.165407879620716],
    [103.06965947998805, 25.166360955441036]]];
var points2 = [[[103.06882256663783, 25.166667027669433],
    [103.06866395130692, 25.165835431757955],
    [103.06968681685834, 25.165884659624638],
    [103.06972748746756, 25.165870594527007],
    [103.06882256663783, 25.166667027669433]]];
var polygon1 = turf.polygon(points1);
var polygon2 = turf.polygon(points2);

var intersection = turf.intersect(polygon1, polygon2);

turf.intersect returns null but two polygons crosses each other

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
PawelGIXcommented, Apr 23, 2020

There is a chance to get more precision? I use this on maps and need precision of 2-3 meters

1reaction
daazb001commented, Jul 16, 2020

The version 6.2.0-alpha.2 seems to solve the problem. At least for me it works now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

turfjs intersect line and polygon - GIS Stack Exchange
The docs say that the intersect function works only with two polygons, so the error is documented.
Read more >
python - Polygon intersection error in Shapely: "shapely.geos ...
Since it prints the areas of the two polygons, I assume that the polygons are formed correctly. I also (somehow) printed the first...
Read more >
Spatial Process Results | Alteryx Help
A polygon if the two objects cover different areas. Null if the two objects are the same. Null, Any Object, The non-null object....
Read more >
Geodatabase topology rules and topology error fixes
Lines can share endpoints. This rule is used when there are lines from two layers that should never cross each other or in...
Read more >
23. Validity — Introduction to PostGIS
What's going on here? The algorithm that calculates area assumes that rings do not self-intersect. A well-behaved ring will always have the area...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found