#29 GeometryCollection.union() fails with Topp Error

open
Dr JTS
core (12)
5
2012-08-01
2012-08-01
Lars
No

Hi

I have geometry collection (The wkt in wkt_error_object.zip) that I run the union operation on and it fails with Topo Error.

geometry = (GeometryCollection) wktReader.read(wkt);
assertNotNull(geometry);
for (int i = 0; i < geometry.getNumGeometries(); i++) {
Geometry geometryN = geometry.getGeometryN(i);
assertTrue("Test that geo is valid", geometryN.isValid());
}

geometry.union();

Fails here with the following error.

com.vividsolutions.jts.geom.TopologyException: found non-noded intersection between LINESTRING ( 10.305115226768082 59.6712471421609, 10.305115226768107 59.6712471421609 ) and LINESTRING ( 10.305115226768107 59.6712471421609, 10.305115226768084 59.6712471421609 ) [ (10.305115226768107, 59.6712471421609, NaN) ]
at com.vividsolutions.jts.noding.FastNodingValidator.checkValid(FastNodingValidator.java:126)
at com.vividsolutions.jts.geomgraph.EdgeNodingValidator.checkValid(EdgeNodingValidator.java:94)
at com.vividsolutions.jts.geomgraph.EdgeNodingValidator.checkValid(EdgeNodingValidator.java:59)
at com.vividsolutions.jts.operation.overlay.OverlayOp.computeOverlay(OverlayOp.java:170)
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:62)
at com.vividsolutions.jts.operation.overlay.snap.SnapIfNeededOverlayOp.overlayOp(SnapIfNeededOverlayOp.java:25)
at com.vividsolutions.jts.geom.Geometry.union(Geometry.java:1361)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionActual(CascadedPolygonUnion.java:369)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionOptimized(CascadedPolygonUnion.java:293)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionSafe(CascadedPolygonUnion.java:274)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.binaryUnion(CascadedPolygonUnion.java:219)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.binaryUnion(CascadedPolygonUnion.java:193)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionTree(CascadedPolygonUnion.java:139)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.reduceToGeometries(CascadedPolygonUnion.java:243)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionTree(CascadedPolygonUnion.java:137)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.reduceToGeometries(CascadedPolygonUnion.java:243)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionTree(CascadedPolygonUnion.java:137)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.reduceToGeometries(CascadedPolygonUnion.java:243)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.unionTree(CascadedPolygonUnion.java:137)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.union(CascadedPolygonUnion.java:127)
at com.vividsolutions.jts.operation.union.CascadedPolygonUnion.union(CascadedPolygonUnion.java:73)
at com.vividsolutions.jts.operation.union.UnaryUnionOp.union(UnaryUnionOp.java:174)
at com.vividsolutions.jts.operation.union.UnaryUnionOp.union(UnaryUnionOp.java:93)
at com.vividsolutions.jts.geom.Geometry.union(Geometry.java:1435)
at no.skogoglandskap.AppTest.testApp(AppTest.java:58)

Lars

Discussion

  • Lars
    Lars
    2012-08-01

    a zip file with the test wkt.

     
    Attachments