Incorrectly getting `null` from `turf.intersect`
See original GitHub issueI’m trying to use turf to generate intersections of some polygons but it randomly seems to not work. For example, the polygons in this gist clearly intersect, but turf.intersect
returns null
> const turf = require('@turf/turf');
> const data = require('./data.json');
> turf.intersect(data.features[0], data.features[1])
null
https://gist.github.com/dschep/92bc5f308b8506a774ecc9482795ccdf
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Turf intersect doesn't always work with polygons
TurfJS just fails to calculate intersections with highly-detailed geometries - internally, it will truncate the precision of the geometries' ...
Read more >Turf JS Intersection issues - Stack Overflow
I am encountering some issues finding if two polygons intersect each other with turfs. What is the purpose of my ...
Read more >Advanced geospatial analysis - Turf.js
Takes two polygon or multi-polygon geometries and finds their polygonal intersection. If they don't intersect, returns null.
Read more >Turfjs使用笔记
Turf.js与Polygon,MultiPolygon,GeometryCollection相交的缓冲区:https://www.thinbug.com/q/40211522 2.Incorrectly getting null from turf.intersect ...
Read more >NULL -Aware Comparison: is [not] distinct from - Modern SQL
In SQL NULL = NULL isn't true. Use IS NOT DISTINCT FROM instead of equals (=) for null-aware comparisons.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
turf.intersect
function is just a thin && buggy layer of user-friendly encapsulation of martinez-polygon-clipping, please consider using it directly. I encountered the same issue and got it resolved with that package.Resolved in v6.3.0