return new PackedCoordinateSequence.Double(path.toArray(new Coordinate[path.size()]));
CoordinateSequence netherlandsBoundaryCoordinates = new PackedCoordinateSequence.Double(new double[]{ 5.920645, 50.748480, 5.914113, 50.747530,
PackedCoordinateSequence builder = new PackedCoordinateSequence.Double( length, 3); for (int i = 0; i < length; i++) {
PackedCoordinateSequence builder = new PackedCoordinateSequence.Double( length, 3); for (int i = 0; i < length; i++) {
PackedCoordinateSequence builder = new PackedCoordinateSequence.Double( length, 3); for (int i = 0; i < length; i++) {
coords[2] = bounds.getMaxX(); coords[3] = bounds.getMaxY(); CoordinateSequence coordSeq = new PackedCoordinateSequence.Double(coords, 2); coordWriter.writeCoordinates(coordSeq, contentHandler); } catch (SAXException se) {
return new PackedCoordinateSequence.Double(path.toArray(new Coordinate[path.size()]));
coords[2] = bounds.getMaxX(); coords[3] = bounds.getMaxY(); CoordinateSequence coordSeq = new PackedCoordinateSequence.Double(coords, 2); coordWriter.writeCoordinates(coordSeq, contentHandler); } catch (SAXException se) {
/** * Creates a new instance of LineIterator * * @param ls The line string the iterator will use * @param at The affine transform applied to coordinates during iteration */ public PackedLineIterator(LineString ls, AffineTransform at, boolean generalize, float maxDistance) { if (at == null) { at = new AffineTransform(); } this.at = at; xScale = (float) Math.sqrt( (at.getScaleX() * at.getScaleX()) + (at.getShearX() * at.getShearX())); yScale = (float) Math.sqrt( (at.getScaleY() * at.getScaleY()) + (at.getShearY() * at.getShearY())); coordinates = (Double) ls.getCoordinateSequence(); coordinateCount = coordinates.size(); isClosed = ls instanceof LinearRing; this.generalize = generalize; this.maxDistance = maxDistance; }
/** * Creates a new instance of LineIterator * * @param ls The line string the iterator will use * @param at The affine transform applied to coordinates during iteration */ public PackedLineIterator(LineString ls, AffineTransform at, boolean generalize, float maxDistance) { if (at == null) { at = new AffineTransform(); } this.at = at; xScale = (float) Math.sqrt( (at.getScaleX() * at.getScaleX()) + (at.getShearX() * at.getShearX())); yScale = (float) Math.sqrt( (at.getScaleY() * at.getScaleY()) + (at.getShearY() * at.getShearY())); coordinates = (Double) ls.getCoordinateSequence(); coordinateCount = coordinates.size(); isClosed = ls instanceof LinearRing; this.generalize = generalize; this.maxDistance = maxDistance; }
/** * Returns a {@link CoordinateSequence} for the {@code coordinates} property so its handled * by a {@link GMLCoordinatesTypeBinding} at encoding time as {@code gml:coordinates} that * Ionic understands */ @Override public Object getProperty(Object object, QName name) throws Exception { Envelope e = (Envelope) object; if (GML.coordinates.equals(name)) { double[] seq = { e.getMinX(), e.getMinY(), e.getMaxX(), e.getMaxY() }; CoordinateSequence coords = new PackedCoordinateSequence.Double(seq, 2); return coords; } return null; } }
/** * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(float[], * int) */ public CoordinateSequence create(float[] packedCoordinates, int dimension) { if (type == DOUBLE) { return new PackedCoordinateSequence.Double(packedCoordinates, dimension); } else { return new PackedCoordinateSequence.Float(packedCoordinates, dimension); } }
/** * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(double[], * int) */ public CoordinateSequence create(double[] packedCoordinates, int dimension) { if (type == DOUBLE) { return new PackedCoordinateSequence.Double(packedCoordinates, dimension); } else { return new PackedCoordinateSequence.Float(packedCoordinates, dimension); } }
/** * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(com.vividsolutions.jts.geom.CoordinateSequence) */ public CoordinateSequence create(CoordinateSequence coordSeq) { if (type == DOUBLE) { return new PackedCoordinateSequence.Double(coordSeq.toCoordinateArray(), dimension); } else { return new PackedCoordinateSequence.Float(coordSeq.toCoordinateArray(), dimension); } }
/** * @see java.lang.Object#clone() */ public Object clone() { double[] clone = new double[coords.length]; System.arraycopy(coords, 0, clone, 0, coords.length); return new Double(clone, dimension); }
/** * @see com.vividsolutions.jts.geom.CoordinateSequenceFactory#create(int, int) */ public CoordinateSequence create(int size, int dimension) { if (type == DOUBLE) { return new PackedCoordinateSequence.Double(size, dimension); } else { return new PackedCoordinateSequence.Float(size, dimension); } } }