Hi guys! I want to cut the field(Multipolygon from the array of polygons,~ about 20000 of polygons) to another field(Multipolygon from shapefile) boundary.
I try the following: /Geometry shapeMultipolygon = (Geometry) ((SimpleFeatureImpl) shapeFeature).getDefaultGeometry(); List<Geometry> geometries = new ArrayList<Geometry>(); for (;;) { //start loop with adding Polygon to List //some code with counting coordinates Coordinate[] coords = new Coordinate[]{leftUp, rightUp, rightDown, leftDown, leftUp}; LinearRing tmpRing = geometryFactory.createLinearRing(coords); geometries.add(geometryFactory.createPolygon(tmpRing, null)); //end loop } Geometry geometry = geometryFactory.buildGeometry(geometries); Geometry intersected = shapeMultipolygon.intersection(geometry);//there is the TopologyException / http://pastie.org/private/hmwcl1cgfzwcuxkwaizba Code at pastie And I get *com.vividsolutions.jts.geom.TopologyException: no outgoing dirEdge found* ( http://pastie.org/private/n3yvvxdumv1onptcq7gria full stacktrace ). Googled a lot about thism but can`t find the solution. Also, it works ok(no exception) but very long time(about 150 seconds) if I cut single Polygons one by one. Is there any other approaches of cutting Multipolygon to another geometry boundary? Thank you, Dmitry. -- View this message in context: http://osgeo-org.1560.n6.nabble.com/intersection-difference-between-Multipolygons-tp4994706.html Sent from the geotools-gt2-users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ GeoTools-GT2-Users mailing list GeoTools-GT2-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users