/** * @see com.vividsolutions.jts.geom.CoordinateSequence#getCoordinate(int) */ public void getCoordinate(int i, Coordinate coord) { coord.x = getOrdinate(i, 0); coord.y = getOrdinate(i, 1); if (dimension > 2) coord.z = getOrdinate(i, 2); }
/** * Sets the second ordinate of a coordinate in this sequence. * * @param index the coordinate index * @param value the new ordinate value */ public void setY(int index, double value) { coordRef = null; setOrdinate(index, 1, value); }
/** * @see com.vividsolutions.jts.geom.CoordinateSequence#toCoordinateArray() */ public Coordinate[] toCoordinateArray() { Coordinate[] coords = getCachedCoords(); // testing - never cache if (coords != null) return coords; coords = new Coordinate[size()]; for (int i = 0; i < coords.length; i++) { coords[i] = getCoordinateInternal(i); } coordRef = new SoftReference(coords); return coords; }
/** * @see com.vividsolutions.jts.geom.CoordinateSequence#getCoordinate(int) */ public Coordinate getCoordinate(int i) { Coordinate[] coords = getCachedCoords(); if(coords != null) return coords[i]; else return getCoordinateInternal(i); } /**
length, 3); for (int i = 0; i < length; i++) { builder.setOrdinate(i, 0, buffer.getDouble()); builder.setOrdinate(i, 1, buffer.getDouble()); builder.setOrdinate(i, 2, Double.NaN); builder.setOrdinate(1, 0, builder.getOrdinate(0, 0)); builder.setOrdinate(1, 1, builder.getOrdinate(1, 0)); builder.setOrdinate(1, 2, Double.NaN); lines[part].setOrdinate(i, 2, buffer.getDouble());
/** * @see org.opengis.geometry.coordinate.DirectPosition#getCoordinate() */ public double[] getCoordinate() { return new double[]{ sequence.getX(offset), sequence.getY(offset), sequence.getOrdinate(offset, CoordinateSequence.Z)}; }
private CoordinateSequence transformInternal( PackedCoordinateSequence sequence, MathTransform transform ) throws TransformException{ start.setSequence(sequence); for(int i=0; i<sequence.size();i++ ){ start.setOffset(i); try { transform.transform(start, start); } catch (MismatchedDimensionException e) { throw new TransformException( "", e); } } return sequence; }
/** * @see com.vividsolutions.jts.geom.CoordinateSequence#getCoordinate(int) */ public Coordinate getCoordinateCopy(int i) { return getCoordinateInternal(i); }
length, 3); for (int i = 0; i < length; i++) { builder.setOrdinate(i, 0, buffer.getDouble()); builder.setOrdinate(i, 1, buffer.getDouble()); builder.setOrdinate(i, 2, Double.NaN); builder.setOrdinate(1, 0, builder.getOrdinate(0, 0)); builder.setOrdinate(1, 1, builder.getOrdinate(1, 0)); builder.setOrdinate(1, 2, Double.NaN); lines[part].setOrdinate(i, 2, buffer.getDouble());
/** * @see org.opengis.geometry.coordinate.DirectPosition#getCoordinates() */ public double[] getCoordinates() { return new double[]{ sequence.getX(offset), sequence.getY(offset), sequence.getOrdinate(offset, CoordinateSequence.Z)}; }
/** * @see com.vividsolutions.jts.geom.CoordinateSequence#getCoordinate(int) */ public Coordinate getCoordinate(int i) { Coordinate[] coords = getCachedCoords(); if(coords != null) return coords[i]; else return getCoordinateInternal(i); } /**
private CoordinateSequence transformInternal( PackedCoordinateSequence sequence, MathTransform transform ) throws TransformException{ start.setSequence(sequence); for(int i=0; i<sequence.size();i++ ){ start.setOffset(i); try { transform.transform(start, start); } catch (MismatchedDimensionException e) { throw new TransformException( "", e); } } return sequence; }
/** * @see com.vividsolutions.jts.geom.CoordinateSequence#getCoordinate(int) */ public Coordinate getCoordinateCopy(int i) { return getCoordinateInternal(i); }
length, 3); for (int i = 0; i < length; i++) { builder.setOrdinate(i, 0, buffer.getDouble()); builder.setOrdinate(i, 1, buffer.getDouble()); builder.setOrdinate(i, 2, Double.NaN); builder.setOrdinate(1, 0, builder.getOrdinate(0, 0)); builder.setOrdinate(1, 1, builder.getOrdinate(1, 0)); builder.setOrdinate(1, 2, Double.NaN); lines[part].setOrdinate(i, 2, buffer.getDouble());
/** * Sets the first ordinate of a coordinate in this sequence. * * @param index the coordinate index * @param value the new ordinate value */ public void setX(int index, double value) { coordRef = null; setOrdinate(index, 0, value); }
/** * @see com.vividsolutions.jts.geom.CoordinateSequence#getX(int) */ public double getX(int index) { return getOrdinate(index, 0); }
/** * @see com.vividsolutions.jts.geom.CoordinateSequence#toCoordinateArray() */ public Coordinate[] toCoordinateArray() { Coordinate[] coords = getCachedCoords(); // testing - never cache if (coords != null) return coords; coords = new Coordinate[size()]; for (int i = 0; i < coords.length; i++) { coords[i] = getCoordinateInternal(i); } coordRef = new SoftReference(coords); return coords; }
/** * @see org.opengis.geometry.coordinate.DirectPosition#setOrdinate(int, double) */ public void setOrdinate( int arg0, double arg1 ) throws IndexOutOfBoundsException { sequence.setOrdinate(offset, arg0, arg1); }
/** * @see com.vividsolutions.jts.geom.CoordinateSequence#getY(int) */ public double getY(int index) { return getOrdinate(index, 1); }
/** * Sets the second ordinate of a coordinate in this sequence. * * @param index the coordinate index * @param value the new ordinate value */ public void setY(int index, double value) { coordRef = null; setOrdinate(index, 1, value); }