/** * Creates a <code>LinearRing</code> using the next token in the stream. * * @return a <code>LinearRing</code> specified by the next token in the stream * @throws IOException if an I/O error occurs * @throws ParseException if the coordinates used to create the <code>LinearRing</code> do not * form a closed linestring, or if an unexpected token was encountered */ private LinearRing readLinearRingText() throws IOException, ParseException { return geometryFactory.createLinearRing(getCoordinates()); }
private LinearRing readLinearRing() throws IOException { int size = dis.readInt(); CoordinateSequence pts = readCoordinateSequenceRing(size); return factory.createLinearRing(pts); }
private Polygon readCurvePolygonText() throws IOException, ParseException { String nextToken = getNextEmptyOrOpener(); if (nextToken.equals(EMPTY)) { return geometryFactory.createCurvePolygon( geometryFactory.createLinearRing(new Coordinate[] {}), new LinearRing[] {}); } if (!nextToken.equals(L_PAREN)) { parseError("Ring expected"); } LinearRing shell = readCurvedLinearRingText(); ArrayList holes = new ArrayList(); nextToken = getNextCloserOrComma(); while (nextToken.equals(COMMA)) { LinearRing hole = readCurvedLinearRingText(); holes.add(hole); nextToken = getNextCloserOrComma(); } LinearRing[] array = new LinearRing[holes.size()]; return geometryFactory.createCurvePolygon(shell, (LinearRing[]) holes.toArray(array)); }
/** * Creates a <code>Polygon</code> using the next token in the stream. * * @return a <code>Polygon</code> specified by the next token in the stream * @throws ParseException if the coordinates used to create the <code>Polygon</code> shell and * holes do not form closed linestrings, or if an unexpected token was encountered. * @throws IOException if an I/O error occurs */ private Polygon readPolygonText() throws IOException, ParseException { String nextToken = getNextEmptyOrOpener(); if (nextToken.equals(EMPTY)) { return geometryFactory.createPolygon( geometryFactory.createLinearRing(new Coordinate[] {}), new LinearRing[] {}); } ArrayList holes = new ArrayList(); LinearRing shell = readLinearRingText(); nextToken = getNextCloserOrComma(); while (nextToken.equals(COMMA)) { LinearRing hole = readLinearRingText(); holes.add(hole); nextToken = getNextCloserOrComma(); } LinearRing[] array = new LinearRing[holes.size()]; return geometryFactory.createPolygon(shell, (LinearRing[]) holes.toArray(array)); }
public static LinearRing linearRing() { return gf.createLinearRing( new Coordinate[] { new Coordinate(1, 1), new Coordinate(2, 2), new Coordinate(3, 3), new Coordinate(1, 1) }); }
CoordinateSequences.ensureValidRing( gf.getCoordinateSequenceFactory(), coordSeq); ring = gf.createLinearRing(coordSeq); } else if (INTERPRETATION == 2) { CoordinateSequence coordSeq = Coordinate max = ext.getCoordinate(1); ring = gf.createLinearRing( new Coordinate[] { min,