@Override public Coordinate getCoordinateCopy( int index ) { Point point = points.get( index ); return new Coordinate( point.get0(), point.get1(), point.get2() ); }
@Override public void getCoordinate( int index, Coordinate coord ) { if ( index < points.size() && index >= 0 ) { Point point = points.get( index ); coord.x = point.get0(); coord.y = point.get1(); coord.z = point.get2(); } }
@Override public Coordinate[] toCoordinateArray() { Coordinate[] coords = new Coordinate[size()]; int i = 0; for ( Point p : this ) { coords[i++] = new Coordinate( p.get0(), p.get1() ); } return coords; }
@Override public Coordinate[] toCoordinateArray() { Coordinate[] coords = new Coordinate[size()]; int i = 0; for ( Point p : this ) { coords[i++] = new Coordinate( p.get0(), p.get1() ); } return coords; }
@Override public Coordinate[] toCoordinateArray() { Coordinate[] coords = new Coordinate[size()]; int i = 0; for ( Point p : this ) { coords[i++] = new Coordinate( p.get0(), p.get1() ); } return coords; }
@Override public Envelope expandEnvelope( Envelope env ) { for ( Point p : this ) { env.expandToInclude( p.get0(), p.get1() ); } return env; }
private Collection<Coordinate> getCoordinates( LineStringSegment lsSegment ) { Points points = lsSegment.getControlPoints(); List<Coordinate> coordinates = new ArrayList<Coordinate>( points.size() ); for ( Point point : points ) { coordinates.add( new Coordinate( point.get0(), point.get1(), point.get2() ) ); } return coordinates; } }
@Override public Coordinate getCoordinateCopy( int index ) { Point point = get( index ); return new Coordinate( point.get0(), point.get1(), point.get2() ); }
@Override public Coordinate getCoordinateCopy( int index ) { Point point = get( index ); return new Coordinate( point.get0(), point.get1(), point.get2() ); }
@Override public Coordinate getCoordinate( int index ) { Point point = get( index ); return new Coordinate( point.get0(), point.get1(), point.get2() ); }
@Override public Coordinate getCoordinateCopy( int index ) { Point point = get( index ); return new Coordinate( point.get0(), point.get1(), point.get2() ); }
@Override public Coordinate getCoordinate( int index ) { Point point = get( index ); return new Coordinate( point.get0(), point.get1(), point.get2() ); }
@Override public void getCoordinate( int index, Coordinate coord ) { Point point = get( index ); coord.x = point.get0(); coord.y = point.get1(); coord.z = point.get2(); }
@Override public void getCoordinate( int index, Coordinate coord ) { Point point = get( index ); coord.x = point.get0(); coord.y = point.get1(); coord.z = point.get2(); }
private Envelope copyEnvelope( Envelope envelopeToCopy ) { if ( envelopeToCopy != null ) { Point min = envelopeToCopy.getMin(); Point max = envelopeToCopy.getMax(); ICRS crs = envelopeToCopy.getCoordinateSystem(); return GEOM_FACTORY.createEnvelope( min.get0(), min.get1(), max.get0(), max.get1(), crs ); } return null; }
private boolean isDefaultBBox() { Envelope env = getDefaultBBox(); return ( Math.abs( bbox.getSpan0() - env.getSpan0() ) < 1E-11 ) && ( Math.abs( bbox.getSpan1() - env.getSpan1() ) < 1E-11 ) && ( Math.abs( bbox.getMin().get0() - env.getMin().get0() ) < 1E-11 ) && ( Math.abs( bbox.getMin().get1() - env.getMin().get1() ) < 1E-11 ) && ( Math.abs( bbox.getMin().get2() - env.getMin().get2() ) < 1E-11 ); }
/** * * @return the raster reference of this tilefile */ public RasterGeoReference getEnvelope() { // rb: should the axis of the crs not been taken into account? return new RasterGeoReference( location, xRes, yRes, env.getMin().get0(), env.getMax().get1() ); }
private Polygon calculateClippingArea( final Envelope bbox, final int width ) { double resolution = bbox.getSpan0() / width; double delta = resolution * 100; double[] minCords = new double[] { bbox.getMin().get0() - delta, bbox.getMin().get1() - delta }; double[] maxCords = new double[] { bbox.getMax().get0() + delta, bbox.getMax().get1() + delta }; Point min = new DefaultPoint( null, bbox.getCoordinateSystem(), null, minCords ); Point max = new DefaultPoint( null, bbox.getCoordinateSystem(), null, maxCords ); Envelope enlargedBBox = new DefaultEnvelope( min, max ); return (Polygon) Geometries.getAsGeometry( enlargedBBox ); }
/** * @return string representation of the envelope */ protected String envelopeString() { String epsg = ""; if ( getEnvelope().getCoordinateSystem() != null ) { epsg = getEnvelope().getCoordinateSystem().getAlias(); } return epsg + " " + getEnvelope().getMin().get0() + " " + getEnvelope().getMin().get1() + " " + getEnvelope().getMax().get0() + " " + getEnvelope().getMax().get1(); }