Coordinate[] pts = CoordinateArrays.toCoordinateArray(ptList); return pts;
public Coordinate[] getVertices() { return CoordinateArrays.toCoordinateArray(adjVerts); }
/** * Sets the sites (point or vertices) which will be diagrammed * from a collection of {@link Coordinate}s. * * @param coords a collection of Coordinates. */ public void setSites(Collection coords) { // remove any duplicate points (they will cause the triangulation to fail) siteCoords = DelaunayTriangulationBuilder.unique(CoordinateArrays.toCoordinateArray(coords)); }
/** * Sets the sites (vertices) which will be triangulated * from a collection of {@link Coordinate}s. * * @param coords a collection of Coordinates. */ public void setSites(Collection coords) { // remove any duplicate points (they will cause the triangulation to fail) siteCoords = unique(CoordinateArrays.toCoordinateArray(coords)); }
private static Coordinate[] getRing(List coordList) { List closedPts = coordList; Coordinate p0 = (Coordinate) coordList.get(0); Coordinate pn = (Coordinate) coordList.get(coordList.size() - 1); if (! p0.equals2D(pn)) { closedPts = new ArrayList(coordList); closedPts.add(p0.clone()); } Coordinate[] pts = CoordinateArrays.toCoordinateArray(closedPts); return pts; }
private Coordinate[] computeBoundaryCoordinates(MultiLineString mLine) { List bdyPts = new ArrayList(); endpointMap = new TreeMap(); for (int i = 0; i < mLine.getNumGeometries(); i++) { LineString line = (LineString) mLine.getGeometryN(i); if (line.getNumPoints() == 0) continue; addEndpoint(line.getCoordinateN(0)); addEndpoint(line.getCoordinateN(line.getNumPoints() - 1)); } for (Iterator it = endpointMap.entrySet().iterator(); it.hasNext(); ) { Map.Entry entry = (Map.Entry) it.next(); Counter counter = (Counter) entry.getValue(); int valence = counter.count; if (bnRule.isInBoundary(valence)) { bdyPts.add(entry.getKey()); } } return CoordinateArrays.toCoordinateArray(bdyPts); }
Coordinate[] reducedPts = CoordinateArrays.toCoordinateArray(reducedSet);
Coordinate[] reducedPts = CoordinateArrays.toCoordinateArray(reducedSet);
public static Geometry findNodePoints(Geometry geom) { List intPts = FastNodingValidator.computeIntersections( SegmentStringUtil.extractNodedSegmentStrings(geom) ); return FunctionsUtil.getFactoryOrDefault(null) .createMultiPoint(CoordinateArrays.toCoordinateArray(intPts)); }
public static Geometry getEndPoints(Geometry g) { List endPtList = new ArrayList(); if (g instanceof LineString) { LineString line = (LineString) g; endPtList.add(line.getCoordinateN(0)); endPtList.add(line.getCoordinateN(line.getNumPoints() - 1)); } else if (g instanceof MultiLineString) { MultiLineString mls = (MultiLineString) g; for (int i = 0; i < mls.getNumGeometries(); i++) { LineString line = (LineString) mls.getGeometryN(i); endPtList.add(line.getCoordinateN(0)); endPtList.add(line.getCoordinateN(line.getNumPoints() - 1)); } } Coordinate[] endPts = CoordinateArrays.toCoordinateArray(endPtList); return (new GeometryFactory()).createMultiPoint(endPts); }
Coordinate[] coords = CoordinateArrays.toCoordinateArray(exteriorCoords); if (coords.length == 1) { ptComp = geomFact.createPoint(coords[0]);
/** * Adds a geometry component of the currently selected type, * to the currently selected geometry. * * @param coordList */ public void addComponent(List coordList) { GeometryCombiner creator = new GeometryCombiner(JTSTestBuilder.getGeometryFactory()); Geometry newGeom = null; switch(getGeometryType()) { case GeometryType.POLYGON: newGeom = creator.addPolygonRing(getGeometry(), getRing(coordList)); break; case GeometryType.LINESTRING: Coordinate[] pts = CoordinateArrays.toCoordinateArray(coordList); newGeom = creator.addLineString(getGeometry(), pts); break; case GeometryType.POINT: newGeom = creator.addPoint(getGeometry(), (Coordinate) coordList.get(0)); break; } setGeometry(newGeom); }