Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turf-intersect: new test data with small intersection #1004

Merged
merged 1 commit into from
Oct 11, 2017

Conversation

zbyte64
Copy link
Contributor

@zbyte64 zbyte64 commented Oct 6, 2017

Had an error in my app: 'Uncaught TopologyException: found non-noded intersection between LINESTRING and LINESTRING', issue #463 recommended creating a test case with the failure and that is what this pull request does. On this branch the intersect tests fail with REGEN=true . The added geojson file defines an intersect geometry only 60 inches wide. #297 (comment) indicates that JSTS has issues with resolution and may be the cause.

@zbyte64
Copy link
Contributor Author

zbyte64 commented Oct 6, 2017

Attempted to normalize the precision as described: #357 ; issue still persists. Maybe the larger geometry has too many points spanning the small box?

@DenisCarriere
Copy link
Member

DenisCarriere commented Oct 6, 2017

Looks like there's two polygon outers in your Polygon Feature. The inner ring is outside the outer ring which means it would be an invalid Polygon (might be the reason why jsts is failing).

image

Moved vertices of the "inner" ring.

image

@zbyte64
Copy link
Contributor Author

zbyte64 commented Oct 7, 2017

Is there a function for checking this, like kinks?

@DenisCarriere
Copy link
Member

@zbyte64
Copy link
Contributor Author

zbyte64 commented Oct 9, 2017

kink doesn't report any kinks. The geometry of the lot is represented as one array in the geojson; how were you able to construct/detect the inner ring?

@DenisCarriere
Copy link
Member

DenisCarriere commented Oct 11, 2017

Oh wait... the Inner & Outer were two polygon features in a FeatureCollection 🤦‍♂️ my bad.

It does seem to be a valid GeoJSON according to https://www.mapbox.com/geojsonhint

🤔 ... looking into this.

@stebogit stebogit changed the title turf-interset: new test data with small intersection turf-intersect: new test data with small intersection Oct 11, 2017
@stebogit
Copy link
Collaborator

sorry guys, that typo was driving me crazy 🤣

DenisCarriere added a commit that referenced this pull request Oct 11, 2017
@DenisCarriere
Copy link
Member

@stebogit hilarious!

@DenisCarriere
Copy link
Member

@zbyte64 Made a quick patch fix for this issue, seems like the small inner polygon was throwing a topology error in JSTS, when truncating the precision to 4 and removing any duplicate nodes using clean-coords the smaller polygon only had 2 remaining nodes and a valid Polygon needs a minimum of 4 coordinates.

Not an ideal result, but at least it stopped crashing... 👍

🤔 I couldn't send commits to your PR, so I opened a new one here: #1011

@ilijaz
Copy link

ilijaz commented Dec 3, 2017

Terrible. Its break all my code, cause i'm try to use turf in precision farming.
Some micro polygons will to be a points. I'm very excited about #88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants