This issue is due to the nearly-coincident line segments present in the two
geometries, which due to finite-precision arithmetic can cause problems
with topology computation.
Reducing precision often helps in cases like this (if it's tolerable),
since it moves the vertices slightly and thus makes the lines less nearly
parallel. You can't just change the PrecisionModel, however - you need to
explicitly reduce the precision (round) the vertices. You can use the
GeometryPrecisionReducer to do this after geometry construction, or just
round them before they are used in the geometry.
This said, I don't get this error in the JTS 1.13 TestBuilder. Which
version of JTS are you using?
On Wed, Feb 19, 2014 at 4:07 AM, Adrien Bonnin <[email protected]>wrote:
> Hi,
>
> I am working with JTS to calculate operations on polygons and an
> TopologyException is raised when an intersection is made :
>
> 2014-02-19 12:01:30 044 ERROR side location conflict [ (945465.3907834652,
> 108978.7237009895, 0.0) ]. Cause:
> com.vividsolutions.jts.geom.TopologyException: side location conflict [
> (945465.3907834652, 108978.7237009895, 0.0) ]
> at
> com.vividsolutions.jts.geomgraph.EdgeEndStar.propagateSideLabels(EdgeEndStar.java:300)
> at
> com.vividsolutions.jts.geomgraph.EdgeEndStar.computeLabelling(EdgeEndStar.java:136)
> at
> com.vividsolutions.jts.geomgraph.DirectedEdgeStar.computeLabelling(DirectedEdgeStar.java:127)
> at
> com.vividsolutions.jts.operation.overlay.OverlayOp.computeLabelling(OverlayOp.java:373)
> at
> com.vividsolutions.jts.operation.overlay.OverlayOp.computeOverlay(OverlayOp.java:173)
> at
> com.vividsolutions.jts.operation.overlay.OverlayOp.getResultGeometry(OverlayOp.java:127)
> at
> com.vividsolutions.jts.operation.overlay.OverlayOp.overlayOp(OverlayOp.java:66)
> at
> com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.getResultGeometry(SnapIfNeededOverlayOp.java:96)
> at
> com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(SnapIfNeededOverlayOp.java:58)
> at com.vividsolutions.jts.geom.Geometry.intersection(Geometry.java:1342)
> ...
>
> Polygons used for this example are :
>
> POLYGON ((945676.742 107913.905, 945580.695 107922.561, 944158 109225.715,
> 945166.1 108302.32, 945465.391 108978.724, 944762.64 111032.56, 949387.627
> 110607.526, 949167.865 110210.04, 948381.51 109462.291, 947367.542
> 108540.108, 946739.7 108231.188, 946567.363 108152.87, 946532.472
> 108141.733, 946383.039 108100.018, 945676.742 107913.905))
>
> POLYGON ((940171.345 97133.194, 926837.989 100713.551, 932310.126
> 120552.93, 943770.11 113933.302, 945465.391 108978.724, 940381.271
> 97488.032, 941426.71 99889.297, 941778.918 101034.166, 941803.252
> 101127.022, 941803.713 101134.036, 941890.17 103534.535, 941827.928
> 103819.171, 940877.193 106167.236, 939866.645 107349.233, 939829.873
> 107251.828, 940163.79 97177.349, 940171.345 97133.194))
>
>
>
> The problem comes from the point 4 :
>
>
>
> I think the exception has something to do with the precision or something
> like that. Precision doesn't really matter in the project so I tried to use
> the PrecisionModel without sucesss and I am not sure that is the correct
> solution.
>
> Do you know if there is a way to avoid such exception and to perform
> intersection ?
>
>
>
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user