found non-noded intersection between LINESTRING
See original GitHub issueI ran into the following error, when calling turf.intersect(poly, point1)
"found non-noded intersection between LINESTRING ( 180 -84.71338, -179.942499 -84.721443 ) and LINESTRING ( -143.107718 -85.040752, -142.892279 -84.570497 ) [ (-142.96105271343765, -84.720614586011) ]"
A bit of background:
I am using a combination of turf and turf-multipolygon, with the geojson outline at http://openlayers.org/en/v3.8.2/examples/data/geojson/countries.geojson
My code looks something as follows:
features = countryOutlines.features;
for (i=0; i<features.length; i++) {
if ( features[i].geometry.type === 'MultiPolygon' ) {
for (j=0; j<features[i].geometry.coordinates.length; j++) {
poly = turf.polygon(features[i].geometry.coordinates[j]);
try {
if (turf.intersect(poly, point1)) {
return features[i].properties.name;
}
} catch (e) {
console.error(e, features[i].id, j);
}
}
} else {
poly = turf.polygon(features[i].geometry.coordinates[0]);
if (turf.intersect(poly, point1)) {
return features[i].properties.name;
}
}
}
The issue happens with the entry for Antartica (ATA). Should the intersect function be dealing with situation or is there a function that would ‘correct’ the data for this situation?
BTW I did modify turf-multipolygon for use in browser based JS:
turf.multipolygon = function(coordinates, properties) {
if (!coordinates) {
throw new Error('No coordinates passed');
}
return {
"type": "Feature",
"geometry": {
"type": "MultiPolygon",
"coordinates": coordinates
},
"properties": properties || {}
};
};
Issue Analytics
- State:
- Created 8 years ago
- Comments:20 (5 by maintainers)
Top Results From Across the Web
Fixing non-noded intersection problem using PostGIS
Error performing intersection: TopologyException: found non-noded intersection between LINESTRING (571304 310990, 568465 264611) and LINESTRING (568465 ...
Read more >found non-noded intersection between LINESTRING - Usage ...
Bug report Sometimes when running cell detection (qupath.imagej.detect.cells.WatershedCellDetection) in the parallel tiled mode it will fail ...
Read more >NetTopology 'found non-noded intersection' Exception when ...
NetTopology 'found non-noded intersection' Exception when determining the difference between two specific geometries. Save this question. Show ...
Read more >ST_Difference(g1,g2) throws lwgeom_difference: GEOS Error ...
select ST_Intersection( '', '' ); ERROR: XX000: lwgeom_intersection: GEOS Error: TopologyException: found non-noded intersection between LINESTRING (303308 ...
Read more >Re: [JPP-Devel] How to avoid non-noded intersection error in ...
However, I get still a similar error found non-noded intersection between LINESTRING ( 130.83397613647227 -0.012151767294376153, ...
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 Free
Top 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
The non-noded intersection error is thrown when self-intersecting polygons are detected. These polygons are invalid, since the interiors & exteriors of the hulls are ambiguous.
I’m seeing this relatively often. The cause for me is that the underlying library, JSTS, loses some coordinate accuracy when converting to and back from JSTS’s own format. After this apparently two “identical” coordinates end up being slightly different:
I got the error from dissolve. My workaround is to specify a different PrecisionModel from the default one used. I had to fork turf-dissolve and turf-union for this (note the different API for union).