Class MortonContext<P extends C2D>


  • public class MortonContext<P extends C2D>
    extends Object
    A context for the calculation of Morton codes.

    This class holds the the maximum spatial extent and tree-depth of the implied QuadTree-index for a MortonCode.

    Author:
    Karel Maesen, Geovise BVBA creation-date: 2/19/13
    • Constructor Detail

      • MortonContext

        public MortonContext​(Envelope<P> extent,
                             int depth)
        Constructs a MortonContext with the specified extent and max. tree-depth
        Parameters:
        extent - the extent for this instance
        depth - the tree-depth
    • Method Detail

      • getMaxX

        public double getMaxX()
        Returns the maximum X-coordinate of the extent.
        Returns:
        the maximum X-coordinate of the extent
      • getMaxY

        public double getMaxY()
        Returns the maximum Y-coordinate of the extent.
        Returns:
        the maximum Y-coordinate of the extent
      • getMinX

        public double getMinX()
        Returns the minimum X-coordinate of the extent
        Returns:
        the minimum X-coordinate of the extent
      • getMinY

        public double getMinY()
        Returns the minimum Y-coordinate of the extent
        Returns:
        the minimum Y-coordinate of the extent
      • getDepth

        public int getDepth()
        Returns the maximum tree-depth
        Returns:
        the maximum tree-depth
      • getCoordinateReferenceSystem

        public CoordinateReferenceSystem<?> getCoordinateReferenceSystem()
        Returns the CrsId of the spatial extent
        Returns:
        the CrsId of the spatial extent
      • extentContains

        public boolean extentContains​(P pos)
        Checks whether the specified Point is contained in the extent.
        Parameters:
        pos - a Point value
        Returns:
        true if the specified point is contained in the extent, false otherwise
        Throws:
        IllegalArgumentException - if the specified point does not share this extent's CrsId
      • extentContains

        public boolean extentContains​(Envelope<P> envelope)
        Checks whether the specified Envelope is contained in the extent.
        Parameters:
        envelope - an Envelope value
        Returns:
        true if the specified envelope is contained in the extent, false otherwise
        Throws:
        IllegalArgumentException - if the specified envelope does not share this extent's CrsId
      • getExtent

        public Envelope<P> getExtent()
        Returns the spatial extent of this instance
        Returns:
        an Envelope representing the spatial extent of this instance