/** Returns the next array of <code>Coordinate</code>s in the stream. */ private Coordinate[] getCoordinates() throws IOException, ParseException { return getCoordinates(false); }
/** * 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()); }
/** * Creates a <code>LineString</code> using the next token in the stream, the provided dimension * and measures will be used to create the <code>LineString</code>. */ private LineString readLineStringText(int dimension, int measures) throws IOException, ParseException { if (measures == 0) { // default situation, capable of handle elevations but no measures return geometryFactory.createLineString(getCoordinates()); } // handle linestring subtypes with measures (elevation and measures) return geometryFactory.createLineString( buildCoordinateSequence(getCoordinates(true), dimension, measures)); }
Coordinate[] coords = getCoordinates(); coordinates.add(coords[0]); nextToken = getNextCloserOrComma(); while (nextToken.equals(COMMA)) { coords = getCoordinates(); coordinates.add(coords[0]); nextToken = getNextCloserOrComma();
/** * Creates a <code>LineString</code> using the next token in the stream. * *@return a <code>LineString</code> specified by the next token in the stream *@throws IOException * if an I/O error occurs *@throws ParseException * if an unexpected token was encountered */ private LineString readLineStringText() throws IOException, ParseException { return geometryFactory.createLineString(getCoordinates()); }
/** * 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()); }
/** * Creates a <code>MultiPoint</code> using the next token in the stream. * *@return a <code>MultiPoint</code> specified by the next token in the stream *@throws IOException * if an I/O error occurs *@throws ParseException * if an unexpected token was encountered */ private MultiPoint readMultiPointText() throws IOException, ParseException { return geometryFactory.createMultiPoint(toPoints(getCoordinates())); }