Package com.vividsolutions.jts.triangulate

Examples of com.vividsolutions.jts.triangulate.ConformingDelaunayTriangulationBuilder


      SimplePolygonXZ polygon,
      Collection<SimplePolygonXZ> holes,
      Collection<LineSegmentXZ> segments,
      Collection<VectorXZ> points) {
     
    ConformingDelaunayTriangulationBuilder triangulationBuilder =
      new ConformingDelaunayTriangulationBuilder();
   
    List<Geometry> constraints =
      new ArrayList<Geometry>(1 + holes.size() + segments.size());
   
    constraints.add(polygonXZToJTSPolygon(polygon));
   
    for (SimplePolygonXZ hole : holes) {
      constraints.add(polygonXZToJTSPolygon(hole));
    }
   
    for (LineSegmentXZ segment : segments) {
      constraints.add(lineSegmentXZToJTSLineString(segment));
    }
   
    ArrayList<Point> jtsPoints = new ArrayList<Point>();
    for (VectorXZ p : points) {
      CoordinateSequence coordinateSequence =
        new CoordinateArraySequence(new Coordinate[] {
            vectorXZToJTSCoordinate(p)});
      jtsPoints.add(new Point(coordinateSequence, GF));
    }
   
    triangulationBuilder.setSites(
        new GeometryCollection(jtsPoints.toArray(EMPTY_GEOM_ARRAY), GF));
    triangulationBuilder.setConstraints(
        new GeometryCollection(constraints.toArray(EMPTY_GEOM_ARRAY), GF));
    triangulationBuilder.setTolerance(0.01);
   
    /* run triangulation */
   
    Geometry triangulationResult = triangulationBuilder.getTriangles(GF);
   
    /* interpret the resulting polygons as triangles,
     * filter out those which are outside the polygon or in a hole */
   
    Collection<PolygonWithHolesXZ> trianglesAsPolygons =
View Full Code Here


   *     the concave hull
   */
  private Geometry concaveHull() {
   
    // triangulation: create a DelaunayTriangulationBuilder object 
    ConformingDelaunayTriangulationBuilder cdtb = new ConformingDelaunayTriangulationBuilder();

    // add geometry collection
    cdtb.setSites(this.geometries);
   
    QuadEdgeSubdivision qes = cdtb.getSubdivision();
   
    Collection<QuadEdge> quadEdges = qes.getEdges();
    List<QuadEdgeTriangle> qeTriangles = QuadEdgeTriangle.createOn(qes);
    Collection<com.vividsolutions.jts.triangulate.quadedge.Vertex> qeVertices =
      qes.getVertices(false);
View Full Code Here

TOP

Related Classes of com.vividsolutions.jts.triangulate.ConformingDelaunayTriangulationBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.