Package org.geotools.renderer.crs
Class WrappingProjectionHandler
- Object
-
- ProjectionHandler
-
- WrappingProjectionHandler
-
public class WrappingProjectionHandler extends ProjectionHandler
AProjectionHandlerfor 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 doubleDATELINE_PROXIMITY_TOLERANCEThe tolerance to consider a geometry without touching both datelines.static StringDATELINE_WRAPPING_CHECK_ENABLEDprotected static StringPREFLIPPED_OBJECTThe 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 booleanisDatelineWrappingCheckEnabled()GeometrypostProcess(MathTransform mt, Geometry geometry)Processes the geometry already projected to the target SRS.GeometrypreProcess(Geometry geometry)Pre processes the geometry, e.g. cuts it, splits it, etc. in its native srs.booleanrequiresProcessing(Geometry geometry)Returns true if the geometry needs special handlingvoidsetDatelineWrappingCheckEnabled(boolean datelineWrappingCheckEnabled)Enables the check using the "half world" heuristic on the input geometries, if larger it assumes they spanned the dateline.voidsetProjectionParameters(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:
setProjectionParametersin classProjectionHandler
-
preProcess
public Geometry preProcess(Geometry geometry) throws TransformException, FactoryException
Description copied from class:ProjectionHandlerPre 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:
preProcessin classProjectionHandler- Throws:
TransformExceptionFactoryException
-
postProcess
public Geometry postProcess(MathTransform mt, Geometry geometry)
Description copied from class:ProjectionHandlerProcesses the geometry already projected to the target SRS. May return null if the geometry is not to be drawn.- Overrides:
postProcessin classProjectionHandler- Parameters:
mt- optional reverse transformation to facilitate unwrapping
-
requiresProcessing
public boolean requiresProcessing(Geometry geometry)
Description copied from class:ProjectionHandlerReturns true if the geometry needs special handling- Overrides:
requiresProcessingin 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
-
-