Class ProjectionHandler

  • Direct Known Subclasses:
    WrappingProjectionHandler

    public class ProjectionHandler
    extends Object
    A class that can perform transformations on geometries to handle the singularity of the rendering CRS, deal with geometries that are crossing the dateline, and eventually wrap them around to produce a seamless continuous map effect.

    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

    Author:
    Andrea Aime - OpenGeo
    • Field Detail

      • ADVANCED_PROJECTION_DENSIFY

        public static final String ADVANCED_PROJECTION_DENSIFY
        See Also:
        Constant Field Values
      • LOGGER

        protected static final Logger LOGGER
      • validArea

        protected final Geometry validArea
      • validaAreaTester

        protected final PreparedGeometry validaAreaTester
      • datelineX

        protected double datelineX
      • targetHalfCircle

        protected double targetHalfCircle
      • queryAcrossDateline

        protected boolean queryAcrossDateline
      • geometryCRS

        protected SingleCRS geometryCRS
      • noReprojection

        protected boolean noReprojection
      • densify

        protected double densify
    • Constructor Detail

      • ProjectionHandler

        public ProjectionHandler​(CoordinateReferenceSystem sourceCRS,
                                 Envelope validAreaBounds,
                                 ReferencedEnvelope renderingEnvelope)
                          throws FactoryException
        Initializes a projection handler
        Parameters:
        sourceCRS - The source CRS
        validAreaBounds - The valid area (used to cut geometries that go beyond it)
        renderingEnvelope - The target rendering area and target CRS
        Throws:
        FactoryException
      • ProjectionHandler

        public ProjectionHandler​(CoordinateReferenceSystem sourceCRS,
                                 Geometry validArea,
                                 ReferencedEnvelope renderingEnvelope)
                          throws FactoryException
        Initializes a projection handler
        Parameters:
        sourceCRS - The source CRS
        validArea - The valid area (used to cut geometries that go beyond it)
        renderingEnvelope - The target rendering area and target CRS
        Throws:
        FactoryException
      • ProjectionHandler

        public ProjectionHandler​(CoordinateReferenceSystem sourceCRS,
                                 Geometry validArea,
                                 ReferencedEnvelope renderingEnvelope,
                                 boolean keepGeometry)
                          throws FactoryException
        Initializes a projection handler
        Parameters:
        sourceCRS - The source CRS
        validArea - The valid area (used to cut geometries that go beyond it)
        renderingEnvelope - The target rendering area and target CRS
        keepGeometry - Can be used to force the valid area to be treated as a polygon, even when it's a rectangle
        Throws:
        FactoryException