jts
jts copied to clipboard
org.locationtech.jts.geom.TopologyException: side location conflict.
I use the jts 1.16 and sometimes will failed by contains method with this bug,
failed org.locationtech.jts.geom.TopologyException: side location conflict [ (-26.908931699420773, 170.85541495764005, NaN) ] at org.locationtech.jts.geomgraph.EdgeEndStar.propagateSideLabels(EdgeEndStar.java:286) at org.locationtech.jts.geomgraph.EdgeEndStar.computeLabelling(EdgeEndStar.java:125) at org.locationtech.jts.operation.relate.RelateComputer.labelNodeEdges(RelateComputer.java:290) at org.locationtech.jts.operation.relate.RelateComputer.computeIM(RelateComputer.java:125) at org.locationtech.jts.operation.relate.RelateOp.getIntersectionMatrix(RelateOp.java:112) at org.locationtech.jts.operation.relate.RelateOp.relate(RelateOp.java:57) at org.locationtech.jts.geom.Geometry.relate(Geometry.java:1045) at org.locationtech.jts.geom.Geometry.contains(Geometry.java:889) at
I wonder if this issue is solved in 1.17?
Yes, unfortunately spatial predicates are subject to geometric non-robustness issues in rare cases.
It's unlikely that 1.17 will fix this, since there hasn't been any work done in that area of the codebase.
It would be great if you can attach the geometries causing the problem, so that we can use them for testing in future development. I'm hoping to be able to work on a new approach for predicate evaluation that will reduce or eliminate these problems.
If I make the geometry valid use makeValid method, will this problem still occur?
Ah right, I should have asked about that. Running with invalid geometry will definitely cause that error. You should check that first.
I'm hoping that the new approach for spatial predicates will be more tolerant of invalid geometry, at least for the simpler predicates such as intersects
and contains
etc. Although there will still be an issue where invalid geometry may produce an incorrect result.
I also have this problem. found non-noded intersection between LINESTRING ( 60.554166678844076 99.26155221464131, 54.302183522617675 108.19030949739133 ) and LINESTRING ( 56.65384691165696 104.83178611580647, 55.34320364079457 103.91406381764479 ) [ (56.65384691165696, 104.83178611580647, NaN). the two LineString are valid,but jts throws this exception
I also have this problem. found non-noded intersection between LINESTRING ( 60.554166678844076 99.26155221464131, 54.302183522617675 108.19030949739133 ) and LINESTRING ( 56.65384691165696 104.83178611580647, 55.34320364079457 103.91406381764479 ) [ (56.65384691165696, 104.83178611580647, NaN). the two LineString are valid,but jts throws this exception
What operation? What are the inputs? Can't tell anything without those.
It's production enviroment error message. I can not get the inputs now. I add some logs to catch this exception, once I get the inputs i wil post here.
It would be great if you can attach the geometries causing the problem, so that we can use them for testing in future development. I'm hoping to be able to work on a new approach for predicate evaluation that will reduce or eliminate these problems.
Here are a few samples of geometries that cause side conflict errors that you can use for testing purposes. These were generated using JTS-1.18.2. slc.txt
Actually, both of the polygons in that sample data are invalid. So that's why the spatial predicates throw errors.