Package org.geotools.renderer.crs
Class WrappingProjectionHandler
Object
ProjectionHandler
WrappingProjectionHandler
A
ProjectionHandler
for projections that do warp in the East/West direction, it will replicate the geometries
generating a Google Maps like effect- Author:
- Andrea Aime - OpenGeo
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final double
The tolerance to consider a geometry without touching both datelines.static final String
protected static final String
The user data key to indicate that the geometry was pre-flippedFields inherited from class ProjectionHandler
ADVANCED_PROJECTION_DENSIFY, datelineX, DEFAULT_DENSIFICATION_LIMIT, DENSIFICATION_LIMIT_KEY, densify, EPS, geometryCRS, LOGGER, noReprojection, queryAcrossDateline, renderingEnvelope, sourceAxisOrder, sourceCRS, targetAxisOrder, targetCRS, targetHalfCircle, validaAreaTester, validArea, validAreaBounds
-
Constructor Summary
ConstructorsConstructorDescriptionWrappingProjectionHandler
(ReferencedEnvelope renderingEnvelope, ReferencedEnvelope validArea, CoordinateReferenceSystem sourceCrs, double centralMeridian, int maxWraps) Provides the strategy with the area we want to render and its CRS (the SPI lookup will do this step) -
Method Summary
Modifier and TypeMethodDescriptionboolean
postProcess
(MathTransform mt, Geometry geometry) Processes the geometry already projected to the target SRS.preProcess
(Geometry geometry) Pre processes the geometry, e.g. cuts it, splits it, etc. in its native srs.boolean
requiresProcessing
(Geometry geometry) Returns true if the geometry needs special handlingvoid
setDatelineWrappingCheckEnabled
(boolean datelineWrappingCheckEnabled) Enables the check using the "half world" heuristic on the input geometries, if larger it assumes they spanned the dateline.void
setProjectionParameters
(Map<String, Object> projectionParameters) Set one of the supported projection parameters: - datelineWrappingCheckEnabled (boolean) if false disables the heuristic for dateline wrapping check (true by default)Methods inherited from class ProjectionHandler
accumulateTransforms, addGeometries, computeDatelineX, concatenateTransforms, densify, getProjectedEnvelope, getQueryEnvelopes, getRenderingEnvelope, getRenderingTransform, getSourceCRS, getSourceEnvelopes, getValidArea, getValidAreaBounds, intersect, mergeEnvelopes, reprojectEnvelopes, setCentralMeridian, transformEnvelope
-
Field Details
-
PREFLIPPED_OBJECT
The user data key to indicate that the geometry was pre-flipped- See Also:
-
DATELINE_PROXIMITY_TOLERANCE
public static final double DATELINE_PROXIMITY_TOLERANCEThe tolerance to consider a geometry without touching both datelines. Derived using trial and error. Any smaller and Antarctica-like polygons are incorrectly tagged.- See Also:
-
DATELINE_WRAPPING_CHECK_ENABLED
- See Also:
-
-
Constructor Details
-
WrappingProjectionHandler
public WrappingProjectionHandler(ReferencedEnvelope renderingEnvelope, ReferencedEnvelope validArea, CoordinateReferenceSystem sourceCrs, double centralMeridian, int maxWraps) throws FactoryException Provides the strategy with the area we want to render and its CRS (the SPI lookup will do this step)- Throws:
FactoryException
-
-
Method Details
-
setProjectionParameters
Set one of the supported projection parameters: - datelineWrappingCheckEnabled (boolean) if false disables the heuristic for dateline wrapping check (true by default)- Overrides:
setProjectionParameters
in classProjectionHandler
-
preProcess
Description copied from class:ProjectionHandler
Pre processes the geometry, e.g. cuts it, splits it, etc. in its native srs. May return null if the geometry is not to be drawn- Overrides:
preProcess
in classProjectionHandler
- Throws:
TransformException
FactoryException
-
postProcess
Description copied from class:ProjectionHandler
Processes the geometry already projected to the target SRS. May return null if the geometry is not to be drawn.- Overrides:
postProcess
in classProjectionHandler
- Parameters:
mt
- optional reverse transformation to facilitate unwrapping
-
requiresProcessing
Description copied from class:ProjectionHandler
Returns true if the geometry needs special handling- Overrides:
requiresProcessing
in classProjectionHandler
-
isDatelineWrappingCheckEnabled
public boolean isDatelineWrappingCheckEnabled() -
setDatelineWrappingCheckEnabled
public void setDatelineWrappingCheckEnabled(boolean datelineWrappingCheckEnabled) Enables the check using the "half world" heuristic on the input geometries, if larger it assumes they spanned the dateline. Enabled by default
-