Package org.geotools.renderer.crs
Class WrappingProjectionHandler
- Object
-
- ProjectionHandler
-
- WrappingProjectionHandler
-
public class WrappingProjectionHandler extends ProjectionHandler
AProjectionHandler
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
Fields Modifier and Type Field Description static double
DATELINE_PROXIMITY_TOLERANCE
The tolerance to consider a geometry without touching both datelines.static String
DATELINE_WRAPPING_CHECK_ENABLED
protected static String
PREFLIPPED_OBJECT
The user data key to indicate that the geometry was pre-flipped-
Fields 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
Constructors Constructor Description WrappingProjectionHandler(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isDatelineWrappingCheckEnabled()
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.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 Detail
-
PREFLIPPED_OBJECT
protected static final String PREFLIPPED_OBJECT
The user data key to indicate that the geometry was pre-flipped- See Also:
- Constant Field Values
-
DATELINE_PROXIMITY_TOLERANCE
public static final double DATELINE_PROXIMITY_TOLERANCE
The 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:
- Constant Field Values
-
DATELINE_WRAPPING_CHECK_ENABLED
public static final String DATELINE_WRAPPING_CHECK_ENABLED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
setProjectionParameters
public 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)- Overrides:
setProjectionParameters
in classProjectionHandler
-
preProcess
public Geometry preProcess(Geometry geometry) throws TransformException, FactoryException
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
public Geometry postProcess(MathTransform mt, Geometry geometry)
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
public boolean requiresProcessing(Geometry geometry)
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
-
-