public class ProjectionHandler extends Object
This basic implementation will cut the geometries that get outside of the area of validity of the projection (as provided by the constructor) WARNING: this API is not finalized and is meant to be used by StreamingRenderer only
Modifier and Type | Field and Description |
---|---|
protected double |
datelineX |
protected static double |
EPS |
protected SingleCRS |
geometryCRS |
protected static Logger |
LOGGER |
protected boolean |
noReprojection |
protected boolean |
queryAcrossDateline |
protected double |
radius |
protected ReferencedEnvelope |
renderingEnvelope |
protected CoordinateReferenceSystem |
sourceCRS |
protected CoordinateReferenceSystem |
targetCRS |
protected PreparedGeometry |
validaAreaTester |
protected Geometry |
validArea |
protected ReferencedEnvelope |
validAreaBounds |
Constructor and Description |
---|
ProjectionHandler(CoordinateReferenceSystem sourceCRS,
Envelope validAreaBounds,
ReferencedEnvelope renderingEnvelope)
Initializes a projection handler
|
ProjectionHandler(CoordinateReferenceSystem sourceCRS,
Geometry validArea,
ReferencedEnvelope renderingEnvelope)
Initializes a projection handler
|
Modifier and Type | Method and Description |
---|---|
protected void |
accumulateTransforms(MathTransform mt,
List<MathTransform> elements) |
protected void |
addGeometries(List<Geometry> geoms,
GeometryCollection collection,
String geometryType)
Private method for adding to the input List only the
Geometry objects of the input GeometryCollection which belongs to the
defined geometryType |
protected void |
computeDatelineX() |
protected MathTransform |
concatenateTransforms(List<MathTransform> datumShiftChain) |
List<ReferencedEnvelope> |
getQueryEnvelopes()
Returns a set of envelopes that will be used to query the data given the specified rendering
envelope and the current query envelope
|
ReferencedEnvelope |
getRenderingEnvelope()
Returns the current rendering envelope
|
MathTransform |
getRenderingTransform(MathTransform mt)
Can modify/wrap the transform to handle specific projection issues
|
CoordinateReferenceSystem |
getSourceCRS() |
protected List<ReferencedEnvelope> |
getSourceEnvelopes(ReferencedEnvelope renderingEnvelope) |
ReferencedEnvelope |
getValidAreaBounds()
Returns the area where the transformation from source to target is valid, expressed in the
source coordinate reference system, or null if there is no limit
|
protected Geometry |
intersect(Geometry geometry,
Geometry mask,
CoordinateReferenceSystem geometryCRS) |
protected void |
mergeEnvelopes(List<ReferencedEnvelope> envelopes) |
Geometry |
postProcess(MathTransform mt,
Geometry geometry)
Processes the geometry already projected to the target SRS.
|
Geometry |
preProcess(Geometry geometry)
Pre processes the geometry, e.g. cuts it, splits it, etc. in its native srs.
|
protected void |
reprojectEnvelopes(CoordinateReferenceSystem queryCRS,
List<ReferencedEnvelope> envelopes) |
boolean |
requiresProcessing(Geometry geometry)
Returns true if the geometry needs special handling
|
protected void |
setCentralMeridian(double centralMeridian) |
protected ReferencedEnvelope |
transformEnvelope(ReferencedEnvelope envelope,
CoordinateReferenceSystem targetCRS) |
protected static final double EPS
protected static final Logger LOGGER
protected ReferencedEnvelope renderingEnvelope
protected final ReferencedEnvelope validAreaBounds
protected final Geometry validArea
protected final PreparedGeometry validaAreaTester
protected final CoordinateReferenceSystem sourceCRS
protected final CoordinateReferenceSystem targetCRS
protected double datelineX
protected double radius
protected boolean queryAcrossDateline
protected SingleCRS geometryCRS
protected boolean noReprojection
public ProjectionHandler(CoordinateReferenceSystem sourceCRS, Envelope validAreaBounds, ReferencedEnvelope renderingEnvelope) throws FactoryException
sourceCRS
- The source CRSvalidAreaBounds
- The valid area (used to cut geometries that go beyond it)renderingEnvelope
- The target rendering area and target CRSFactoryException
public ProjectionHandler(CoordinateReferenceSystem sourceCRS, Geometry validArea, ReferencedEnvelope renderingEnvelope) throws FactoryException
sourceCRS
- The source CRSvalidArea
- The valid area (used to cut geometries that go beyond it)renderingEnvelope
- The target rendering area and target CRSFactoryException
public ReferencedEnvelope getRenderingEnvelope()
public CoordinateReferenceSystem getSourceCRS()
public List<ReferencedEnvelope> getQueryEnvelopes() throws TransformException, FactoryException
TransformException
FactoryException
protected List<ReferencedEnvelope> getSourceEnvelopes(ReferencedEnvelope renderingEnvelope) throws TransformException, FactoryException
TransformException
FactoryException
protected ReferencedEnvelope transformEnvelope(ReferencedEnvelope envelope, CoordinateReferenceSystem targetCRS) throws TransformException, FactoryException
TransformException
FactoryException
protected void reprojectEnvelopes(CoordinateReferenceSystem queryCRS, List<ReferencedEnvelope> envelopes) throws TransformException, FactoryException
TransformException
FactoryException
protected void mergeEnvelopes(List<ReferencedEnvelope> envelopes)
public boolean requiresProcessing(Geometry geometry)
public Geometry preProcess(Geometry geometry) throws TransformException, FactoryException
TransformException
FactoryException
protected Geometry intersect(Geometry geometry, Geometry mask, CoordinateReferenceSystem geometryCRS)
public MathTransform getRenderingTransform(MathTransform mt) throws FactoryException
FactoryException
protected MathTransform concatenateTransforms(List<MathTransform> datumShiftChain)
protected void accumulateTransforms(MathTransform mt, List<MathTransform> elements)
public Geometry postProcess(MathTransform mt, Geometry geometry)
mt
- optional reverse transformation to facilitate unwrappingpublic ReferencedEnvelope getValidAreaBounds()
protected void setCentralMeridian(double centralMeridian)
protected void computeDatelineX()
Copyright © 1996–2018 Geotools. All rights reserved.