public int getBoundaryDimension() { if (isClosed()) { return Dimension.FALSE; } return 0; }
public boolean isClosed() { if (isEmpty()) { return false; } for (int i = 0; i < geometries.length; i++) { if (!((LineString) geometries[i]).isClosed()) { return false; } } return true; }
/** * Tests whether this ring is closed. * Empty rings are closed by definition. * * @return true if this ring is closed */ public boolean isClosed() { if (isEmpty()) { // empty LinearRings are closed by definition return true; } return super.isClosed(); }
public boolean isRing() { return isClosed() && isSimple(); }
/** * Filters linear geometries. * * geom a geometry of any type */ public void filter(Geometry geom) { if (geom instanceof LineString) { LineString line = (LineString) geom; int minSize = ((LineString) line).isClosed() ? 4 : 2; TaggedLineString taggedLine = new TaggedLineString((LineString) line, minSize); linestringMap.put(line, taggedLine); } } }
/** * Builds a geometry ({@link LineString} or {@link MultiLineString} ) * representing the sequence. * * @param sequences a List of Lists of DirectedEdges with * LineMergeEdges as their parent edges. * @return the sequenced geometry, or <code>null</code> if no sequence exists */ private Geometry buildSequencedGeometry(List sequences) { List lines = new ArrayList(); for (Iterator i1 = sequences.iterator(); i1.hasNext(); ) { List seq = (List) i1.next(); for (Iterator i2 = seq.iterator(); i2.hasNext(); ) { DirectedEdge de = (DirectedEdge) i2.next(); LineMergeEdge e = (LineMergeEdge) de.getEdge(); LineString line = e.getLine(); LineString lineToAdd = line; if (! de.getEdgeDirection() && ! line.isClosed()) lineToAdd = reverse(line); lines.add(lineToAdd); } } if (lines.size() == 0) return factory.createMultiLineString(new LineString[0]); return factory.buildGeometry(lines); }
private void validateConstruction() { if (!isEmpty() && ! super.isClosed()) { throw new IllegalArgumentException("Points of LinearRing do not form a closed linestring"); } if (getCoordinateSequence().size() >= 1 && getCoordinateSequence().size() < MINIMUM_VALID_SIZE) { throw new IllegalArgumentException("Invalid number of points in LinearRing (found " + getCoordinateSequence().size() + " - must be 0 or >= 4)"); } }
private int locate(Coordinate p, LineString l) { // bounding-box check if (! l.getEnvelopeInternal().intersects(p)) return Location.EXTERIOR; Coordinate[] pt = l.getCoordinates(); if (! l.isClosed()) { if (p.equals(pt[0]) || p.equals(pt[pt.length - 1]) ) { return Location.BOUNDARY; } } if (CGAlgorithms.isOnLine(p, pt)) return Location.INTERIOR; return Location.EXTERIOR; }
static public boolean isClosed(Geometry arg0) { if (!(arg0 instanceof LineString)) return false; LineString _this = (LineString) arg0; return _this.isClosed(); }
public int getBoundaryDimension() { if (isClosed()) { return Dimension.FALSE; } return 0; }
static public boolean isClosed(Geometry arg0) { LineString _this = (LineString) arg0; return _this.isClosed(); }
private Geometry boundaryLineString(LineString line) { if (geom.isEmpty()) { return getEmptyMultiPoint(); } if (line.isClosed()) { // check whether endpoints of valence 2 are on the boundary or not boolean closedEndpointOnBoundary = bnRule.isInBoundary(2); if (closedEndpointOnBoundary) { return line.getStartPoint(); } else { return geomFact.createMultiPoint((Coordinate[]) null); } } return geomFact.createMultiPoint(new Point[]{ line.getStartPoint(), line.getEndPoint() }); } }
public static Boolean isClosed(GeometryType geom) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof LineString)) { return false; } LineString lineString = ((LineString)g); return lineString.isClosed(); }
public boolean isClosed() { if (isEmpty()) { return false; } for (int i = 0; i < geometries.length; i++) { if (!((LineString) geometries[i]).isClosed()) { return false; } } return true; }
public static Boolean isClosed(GeometryType geom) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof LineString)) { return false; } LineString lineString = ((LineString)g); return lineString.isClosed(); }
public static Boolean isRing(GeometryType geom) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof LineString)) { return false; } LineString lineString = ((LineString)g); return lineString.isClosed() && lineString.isSimple(); }
public static Boolean isRing(GeometryType geom) throws FunctionExecutionException { Geometry g = getGeometry(geom); if (!(g instanceof LineString)) { return false; } LineString lineString = ((LineString)g); return lineString.isClosed() && lineString.isSimple(); }
@Override public Item item(final QueryContext qc, final InputInfo ii) throws QueryException { final Geometry geo = geo(0, qc, LINE, Q_GML_LINEARRING, Q_GML_LINESTRING, Q_GML_MULTILINESTRING); return Bln.get(geo instanceof LineString ? ((LineString) geo).isClosed() : ((MultiLineString) geo).isClosed()); } }
@Override public Geometry getGeometry() { final LineString line = JTSUtil.toLineString(this); if(line.isSimple() && line.isClosed()) { return JTSUtil.toLinearRing(this); } return line; }
private void validateConstruction() { if (!isEmpty() && ! super.isClosed()) { throw new IllegalArgumentException("Points of LinearRing do not form a closed linestring"); } if (getCoordinateSequence().size() >= 1 && getCoordinateSequence().size() < MINIMUM_VALID_SIZE) { throw new IllegalArgumentException("Invalid number of points in LinearRing (found " + getCoordinateSequence().size() + " - must be 0 or >= 4)"); } }