-
Notifications
You must be signed in to change notification settings - Fork 449
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
Polygonizer throws NullPointerException #691
Comments
That linework is not fully noded, as required by |
Fixed by #692 |
Thanks for the fast fix, I'll have a look at it tomorrow. |
Input to the Polygonizer must touch only at endpoints (nodes). These lines clearly violate that. Note that this also precludes input lines which share lines segments (or subsegments). This data also violates that. |
Yes, I figured the collinear edges might be the issue. MULTILINESTRING ((100 100, 200 100, 200 200, 100 200, 100 100), |
Invalid input may still produce valid output. But it also may not.... With the fix for this issue, in fact the data above also produces valid output. But these examples are outside the operating range of |
Polygonization throws NullPointerException using the following input geometry:
MULTILINESTRING ((143145039 659338416, 143146736 659338410, 143146496 659332192, 143152064 659332033, 143151920 659338391, 143153808 659338383, 143153951 659330368, 143144624 659330497, 143145039 659338416),
(143146736 659338410, 143151920 659338391, 143152064 659332033, 143146496 659332192, 143146736 659338410))
java.lang.NullPointerException: Cannot read field "y" because "p" is null
at org.locationtech.jts.algorithm.locate.IndexedPointInAreaLocator.locate(IndexedPointInAreaLocator.java:88)
at org.locationtech.jts.operation.polygonize.EdgeRing.isInRing(EdgeRing.java:261)
at org.locationtech.jts.operation.polygonize.EdgeRing.findEdgeRingContaining(EdgeRing.java:87)
at org.locationtech.jts.operation.polygonize.HoleAssigner.findShellContaining(HoleAssigner.java:106)
at org.locationtech.jts.operation.polygonize.HoleAssigner.assignHoleToShell(HoleAssigner.java:78)
at org.locationtech.jts.operation.polygonize.HoleAssigner.assignHolesToShells(HoleAssigner.java:72)
at org.locationtech.jts.operation.polygonize.HoleAssigner.assignHolesToShells(HoleAssigner.java:40)
at org.locationtech.jts.operation.polygonize.Polygonizer.polygonize(Polygonizer.java:255)
at org.locationtech.jts.operation.polygonize.Polygonizer.getGeometry(Polygonizer.java:188)
I can work around this issue by unioning the geometry prior to passing it to the Polygonizer.
The text was updated successfully, but these errors were encountered: