Re: [Jts-topo-suite-user] Delaunay Triangulation Snapping Tolerance
Brought to you by:
dr_jts
From: Martin D. <mtn...@gm...> - 2013-12-05 17:04:26
|
Ok, mystery solved, I think. The constraints need to be segment-unique - in other words, there cannot be any duplicate segments in the set of constraint edges. So you will have to run a dissolve on your input constraints. The LineDissolver class will do this. When I do this I can use a tolerance of 0 and it completes. I've updated the Javadoc to mention this requirement. On Wed, Dec 4, 2013 at 10:31 AM, Brian Sanjeewa Rupasinghe < ji...@gm...> wrote: > Hi, > > I used the following method for the triangulation. I use polygons as > constraints as well. Input Geometry is multipoint of all polygon vertices. > Then polygons are used as constraints in a GeometryCollection. Was it > because i used polygon geometry itself as constraints rather than its line > segments? > > public static Geometry TriangulationBuilder (MultiPoint mp, > ArrayList<Geometry> alg, double tolerance) > { > GeometryFactory gf = new GeometryFactory(); > ConformingDelaunayTriangulationBuilder cdtb = new > ConformingDelaunayTriangulationBuilder(); > //constriant geometry > Geometry consegs = gf.buildGeometry(alg); > //GeometryCollection g_cp = (GeometryCollection) > gf.createGeometryCollection(als); > //set sites for triangulation > cdtb.setSites(mp); > //set constraints > cdtb.setConstraints(consegs); > //set tolerance -0.00001 > cdtb.setTolerance(tolerance); > //Retrieving triangles > Geometry Trigeom = cdtb.getTriangles(gf); > return Trigeom; > } > > |