public class MortonContext<P extends C2D>
extends java.lang.Object
This class holds the the maximum spatial extent and tree-depth of the implied
QuadTree-index for a MortonCode.
| Modifier and Type | Field and Description |
|---|---|
private int |
depth |
private static java.lang.String |
ERR_MSG_MAX_DEPTH |
private static java.lang.String |
ERR_MSG_NULL |
private Envelope<P> |
extent |
private double |
leafHeight |
private double |
leafWidth |
private int |
numOfDivisionsAlongAxis |
| Constructor and Description |
|---|
MortonContext(Envelope<P> extent,
int depth)
Constructs a
MortonContext with the specified extent and max. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
extentContains(Envelope<P> envelope)
Checks whether the specified
Envelope is contained in the extent. |
boolean |
extentContains(P pos)
Checks whether the specified
Point is contained in the extent. |
CoordinateReferenceSystem<?> |
getCoordinateReferenceSystem()
Returns the CrsId of the spatial extent
|
int |
getDepth()
Returns the maximum tree-depth
|
Envelope<P> |
getExtent()
Returns the spatial extent of this instance
|
(package private) double |
getLeafHeight()
Returns the height of the extent of a leaf in the QuadTree at tree-depth (lowest-level)
|
(package private) double |
getLeafWidth()
Returns the width of the extent of a leaf in the QuadTree at tree-depth (lowest-level)
|
double |
getMaxX()
Returns the maximum X-coordinate of the extent.
|
double |
getMaxY()
Returns the maximum Y-coordinate of the extent.
|
double |
getMinX()
Returns the minimum X-coordinate of the extent
|
double |
getMinY()
Returns the minimum Y-coordinate of the extent
|
(package private) int |
getNumberOfDivisionsAlongAxis()
Returns the number of subdivisions along an (X- or Y-)axis.
|
private static final java.lang.String ERR_MSG_MAX_DEPTH
private static final java.lang.String ERR_MSG_NULL
private final int depth
private final int numOfDivisionsAlongAxis
private final double leafWidth
private final double leafHeight
public double getMaxX()
public double getMaxY()
public double getMinX()
public double getMinY()
public int getDepth()
public CoordinateReferenceSystem<?> getCoordinateReferenceSystem()
int getNumberOfDivisionsAlongAxis()
The leaves of a Quadtree form a grid-cell structure that completely covers the extent. This method returns the number of subdivisions along a single axis. It is the square root of the total number of leaves.
double getLeafWidth()
double getLeafHeight()
public boolean extentContains(P pos)
Point is contained in the extent.pos - a Point valuejava.lang.IllegalArgumentException - if the specified point does not share this extent's CrsIdpublic boolean extentContains(Envelope<P> envelope)
Envelope is contained in the extent.envelope - an Envelope valuejava.lang.IllegalArgumentException - if the specified envelope does not share this extent's CrsId