private Geometry simplify( Geometry geometry ) { if ( simplifier == null ) { return geometry; } GeometryType type = geometry.getGeometryType(); if ( type == ENVELOPE || type == COMPOSITE_GEOMETRY ) { return geometry; } return simplifier.simplify( geometry ); }
/** * @param ps * @param b * @param index * @throws SQLException */ private Envelope getEnvelope( float[] location, float width, float height, float depth ) { return geomFac.createEnvelope( new double[] { location[0], location[1], location[2] }, new double[] { location[0] + width, location[1] + depth, location[2] + height }, null ); }
private LinearRing transform( Ring ring, Transformation trans ) throws TransformationException { if ( ring != null ) { // TODO DefaultRing.getAsLineString currently returns an UnsupportedOpertionException // interior.getAsLineString().getControlPoints(), Points cP = ring.getControlPoints(); Points tcP = transform( cP, trans ); return geomFactory.createLinearRing( ring.getId(), getTargetCRS(), tcP ); } return null; }
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; }
/** * @param crs */ public void setCoordinateSystem( ICRS crs ) { this.crs = crs; bbox = fac.createEnvelope( bbox.getMin().getAsArray(), bbox.getMax().getAsArray(), crs ); }
private Envelope transform( Envelope bbox, ICRS targetCrs ) throws IllegalArgumentException, TransformationException, UnknownCRSException { if ( targetCrs.equals( bbox.getEnvelope().getCoordinateSystem() ) ) { return bbox; } GeometryTransformer transformer = new GeometryTransformer( targetCrs ); return transformer.transform( bbox ); } }
private Envelope getDefaultBBox() { return new GeometryFactory().createEnvelope( new double[] { -sphereSize, -sphereSize, -sphereSize }, new double[] { sphereSize, sphereSize, sphereSize }, null ); }
private Envelope transformEnvelopeIntoQuerySrs( ICRS querySrs, Envelope env ) throws TransformationException, UnknownCRSException { GeometryTransformer transformer = new GeometryTransformer( querySrs ); return transformer.transform( env ); }
private Envelope mergeEnvelope( final Envelope existing, final Envelope additional ) { if ( existing == null ) { return additional; } if ( additional == null || additional.getCoordinateDimension() < 2 ) { return existing; } return existing.merge( additional ); }
private Geometry transform( Envelope envelope, Transformation trans ) throws TransformationException { return transform( envelope, trans, 20 ); }
@Override public Geometry process( Geometry inputGeometry, Map<String, Object> params ) { return inputGeometry.getCentroid(); }
private SurfacePatch inspect( SurfacePatch patch ) { SurfacePatch inspected = patch; for ( GeometryInspector inspector : inspectors ) { inspected = inspector.inspect( inspected ); } return inspected; }
@Override public boolean isSFSCompliant() { for ( Geometry member : this ) { if ( !( member.isSFSCompliant() ) ) { return false; } } return true; }
/** * @param crs */ public void setCoordinateSystem( ICRS crs ) { this.crs = crs; if ( envelope != null ) { // rb: this is not correct, the values of the envelope should be converted to the given crs, shouldn't they. this.envelope = geomFactory.createEnvelope( envelope.getMin().getAsArray(), envelope.getMax().getAsArray(), crs ); } }
/** * @param translationVector * @param coordinateSystem * @return a default 3d envelope at 0,0 from the scene. */ private static Envelope createDefaultEnvelope( double[] translationVector, ICRS coordinateSystem ) { return geomFac.createEnvelope( new double[] { 0, 0, 0 }, new double[] { DEFAULT_SPAN, DEFAULT_SPAN, DEFAULT_SPAN }, coordinateSystem ); }
private Geometry simplify( Geometry geometry ) { if ( simplifier == null ) { return geometry; } GeometryType type = geometry.getGeometryType(); if ( type == ENVELOPE || type == COMPOSITE_GEOMETRY ) { return geometry; } return simplifier.simplify( geometry ); }
private CurveSegment inspect( CurveSegment segment ) { CurveSegment inspected = segment; for ( GeometryInspector inspector : inspectors ) { inspected = inspector.inspect( inspected ); } return inspected; }
@Override public boolean isSFSCompliant() { for ( Geometry member : this ) { if ( !( member.isSFSCompliant() ) ) { return false; } } return true; }
protected Geometry inspect( Geometry geom ) { Geometry inspected = geom; for ( GeometryInspector inspector : inspectors ) { inspected = inspector.inspect( inspected ); } return inspected; }
protected Points inspect( Points points ) { Points inspected = points; for ( GeometryInspector inspector : inspectors ) { inspected = inspector.inspect( inspected ); } return inspected; }