public class EarthPartition extends java.lang.Object implements Encodable
EarthPartition
class sets up a partitioning of
earth data such that no individual partition has physical size
exceeding a user-specified tolerance. The physical size along each
dimension is measured in terms of the earth transform
distance()
metric. After construction, child
partitions may be retrieved and manipulated.Modifier | Constructor and Description |
---|---|
|
EarthPartition(EarthTransform trans,
DataLocation min,
DataLocation max,
double maxSize,
int[] maxDims)
Constructs an earth partitioning from the specified earth
transform, extents, and size tolerance.
|
protected |
EarthPartition(EarthTransform trans,
DataLocation min,
DataLocation max,
double maxSize,
int[] maxDims,
boolean isRoot)
Constructs an earth partitioning from the specified earth
transform, extents, and size tolerance.
|
|
EarthPartition(java.lang.Object obj)
Constructs an earth partitioning from the specified encoding.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(DataLocation loc)
Determines if the partition contains the specified data coordinate.
|
EarthPartition |
findPartition(DataLocation loc)
Gets the partition containing the specified data location.
|
java.lang.Object |
getData()
Gets the partition data.
|
java.lang.Object |
getEncoding()
Creates an encoding of the partition information.
|
DataLocation |
getMax()
Gets the partition maximum bounds.
|
DataLocation |
getMin()
Gets the partition minimum bounds.
|
EarthPartition[] |
getPartitions()
Gets all child partitions as an array.
|
int |
partitions()
Gets the number of child partitions.
|
void |
setData(java.lang.Object data)
Sets the partition data.
|
void |
useEncoding(java.lang.Object obj)
Constructs an earth partitioning from the specified encoding.
|
public EarthPartition(EarthTransform trans, DataLocation min, DataLocation max, double maxSize, int[] maxDims)
trans
- the earth transform to use.min
- the starting data location for partitioning.max
- the ending data location for partitioning.maxSize
- the maximum partition size in any dimension
in terms of the EarthTransform.distance(noaa.coastwatch.util.DataLocation, noaa.coastwatch.util.DataLocation)
metric.maxDims
- the maximum partition size in any dimension
in terms of data locations.protected EarthPartition(EarthTransform trans, DataLocation min, DataLocation max, double maxSize, int[] maxDims, boolean isRoot)
trans
- the earth transform to use.min
- the starting data location for partitioning.max
- the ending data location for partitioning.maxSize
- the maximum partition size in any dimension
in terms of the EarthTransform.distance(noaa.coastwatch.util.DataLocation, noaa.coastwatch.util.DataLocation)
metric.maxDims
- the maximum partition size in any dimension
in terms of data locations.isRoot
- the root flag, true if this partition is the
root of a tree or false if not.public EarthPartition(java.lang.Object obj)
getEncoding
.obj
- the object encoding.getEncoding()
public java.lang.Object getData()
public void setData(java.lang.Object data)
public DataLocation getMin()
public DataLocation getMax()
public void useEncoding(java.lang.Object obj)
getEncoding
.useEncoding
in interface Encodable
obj
- the object encoding.getEncoding()
public int partitions()
public java.lang.Object getEncoding()
getEncoding
in interface Encodable
Object[3]
array containing:
BitSet
object used for encoding partition
structure informationList
of double[]
coordinates
specifying partition boundariesList
of Object
specifying partition
datauseEncoding(java.lang.Object)
public EarthPartition[] getPartitions()
public boolean contains(DataLocation loc)
loc
- the data location to check.public EarthPartition findPartition(DataLocation loc)
loc
- the data location for searching.null
if one cannot be found.