Examples of buildGeometry()


Examples of com.vividsolutions.jts.geom.GeometryFactory.buildGeometry()

        }
       
        // merge segments
        LineMerger merger = new LineMerger();
        merger.add(union);
        union = gf.buildGeometry(merger.getMergedLineStrings());
       
        return JTSUtils.getLineStrings(union);
    }
   
    /**
 
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.buildGeometry()

    // add second input's linework, if any
    if (g2 != null)
      LinearComponentExtracter.getLines(g2, lines);
    List nodedLinework = new GeometryNoder(pm).node(lines);
    // union the noded linework to remove duplicates
    Geometry nodedDedupedLinework = geomFact.buildGeometry(nodedLinework).union();
   
    // polygonize the result
    Polygonizer polygonizer = new Polygonizer();
    polygonizer.add(nodedDedupedLinework);
    Collection polys = polygonizer.getPolygons();
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.buildGeometry()

        /* Union the geometries at each contour threshold. */
        Map<Integer, Geometry> contours = Maps.newHashMap();
        for (Integer threshold : bufferLists.keys()) {
            Collection<Geometry> buffers = bufferLists.get(threshold);
            Geometry geom = geomf.buildGeometry(buffers); // make geometry collection
            geom = geom.union(); // combine all individual buffers in this contour into one
            if ( ! resultsProjected) geom = JTS.transform(geom, fromMeters);
            contours.put(threshold, geom);
        }
        return contours;
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.buildGeometry()

      final Collection<Geometry> geometries ) {
    final GeometryFactory factory = JTSFactoryFinder.getGeometryFactory(null);

    // note the following geometry collection may be invalid (say with
    // overlapping polygons)
    final Geometry geometryCollection = factory.buildGeometry(geometries);

    return geometryCollection.union();
  }

  private static Coordinate[] getWorldCoordinates(
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.buildGeometry()

    List pts = new ArrayList();

    for (int i = 0; i < nPts; i++) {
      pts.add(geomFact.createPoint(randomPointInTriangle(tri0, tri1, tri2)));
    }
    return geomFact.buildGeometry(pts);
  }

  private static Coordinate randomPointInTriangle(Coordinate p0, Coordinate p1, Coordinate p2)
  {
    double s = Math.random();
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.buildGeometry()

      double ang = 2 * Math.PI * Math.random();
      double x = centreX + r * Math.cos(ang);
      double y = centreY + r * Math.sin(ang);
      pts.add(geomFact.createPoint(new Coordinate(x, y)));
    }
    return geomFact.buildGeometry(pts);
  }

  public static Geometry randomSegments(Geometry g, int nPts) {
    Envelope env = FunctionsUtil.getEnvelopeOrDefault(g);
    GeometryFactory geomFact = FunctionsUtil.getFactoryOrDefault(g);
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.buildGeometry()

      double x1 = env.getMinX() + xLen * Math.random();
      double y1 = env.getMinY() + yLen * Math.random();
      lines.add(geomFact.createLineString(new Coordinate[] {
          new Coordinate(x0, y0), new Coordinate(x1, y1) }));
    }
    return geomFact.buildGeometry(lines);
  }

  public static Geometry randomSegmentsInGrid(Geometry g, int nPts) {
    Envelope env = FunctionsUtil.getEnvelopeOrDefault(g);
    GeometryFactory geomFact = FunctionsUtil.getFactoryOrDefault(g);
View Full Code Here

Examples of com.vividsolutions.jts.geom.GeometryFactory.buildGeometry()

        double y1 = env.getMinY() + j * yLen + yLen * Math.random();
        lines.add(geomFact.createLineString(new Coordinate[] {
            new Coordinate(x0, y0), new Coordinate(x1, y1) }));
      }
    }
    return geomFact.buildGeometry(lines);
  }

  public static Geometry randomLineString(Geometry g, int nPts) {
    Envelope env = FunctionsUtil.getEnvelopeOrDefault(g);
    GeometryFactory geomFact = FunctionsUtil.getFactoryOrDefault(g);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.