public class ZCurvePartitioner extends Partitioner
| Modifier and Type | Field and Description |
|---|---|
protected Rectangle |
mbr
MBR of the input file
|
protected static int |
Resolution |
protected long[] |
zSplits
Upper bound of all partitions
|
| Constructor and Description |
|---|
ZCurvePartitioner()
A default constructor to be able to dynamically instantiate it
and deserialize it
|
| Modifier and Type | Method and Description |
|---|---|
static long |
computeZ(Rectangle mbr,
double x,
double y)
Computes the Z-order of a point relative to a containing rectangle
|
static long |
computeZOrder(long x,
long y)
Computes the Z-order (Morton order) of a two-dimensional point.
|
void |
createFromPoints(Rectangle mbr,
Point[] points,
int numPartitions)
Populate this partitioner for a set of points and number of partitions
|
protected void |
createFromZValues(long[] zValues,
int partitions)
Create a ZCurvePartitioner from a list of points
|
static Rectangle |
getMBR(Rectangle mbr,
long zMin,
long zMax) |
static java.awt.Rectangle |
getMBRInteger(long zMin,
long zMax)
Compute the minimal bounding rectangle MBR of a range on the Z-curve.
|
CellInfo |
getPartition(int id)
Returns the details of a specific partition given its ID.
|
CellInfo |
getPartitionAt(int index)
Returns the detail of a partition given its position starting from zero
and ending at partitionCount() - 1
|
int |
getPartitionCount()
Returns total number of partitions
|
int |
overlapPartition(Shape shape)
Returns only one overlapping partition.
|
void |
overlapPartitions(Shape shape,
ResultCollector<java.lang.Integer> matcher)
Overlap a shape with partitions and calls a matcher for each overlapping
partition.
|
void |
readFields(java.io.DataInput in) |
static void |
uncomputeZ(Rectangle mbr,
long z,
Point outPoint)
Reverse the computation of the Z-value and returns x and y dimensions
|
static long |
unComputeZOrder(long morton) |
static java.awt.Point |
unComputeZOrder(long morton,
java.awt.Point point) |
void |
write(java.io.DataOutput out) |
getPartitioner, setPartitionerprotected Rectangle mbr
protected long[] zSplits
protected static final int Resolution
public ZCurvePartitioner()
public void createFromPoints(Rectangle mbr, Point[] points, int numPartitions)
PartitionercreateFromPoints in class Partitionerprotected void createFromZValues(long[] zValues,
int partitions)
vsample - inMBR - partitions - public static long computeZ(Rectangle mbr, double x, double y)
mbr - x - y - public static void uncomputeZ(Rectangle mbr, long z, Point outPoint)
mbr - x - y - public static long computeZOrder(long x,
long y)
x - - integer value of the x-axis (cannot exceed Integer.MAX_VALUE)y - - integer value of the y-axis (cannot exceed Integer.MAX_VALUE)public static java.awt.Point unComputeZOrder(long morton,
java.awt.Point point)
public static long unComputeZOrder(long morton)
public static java.awt.Rectangle getMBRInteger(long zMin,
long zMax)
zMin - zMax - public void write(java.io.DataOutput out)
throws java.io.IOException
java.io.IOExceptionpublic void readFields(java.io.DataInput in)
throws java.io.IOException
java.io.IOExceptionpublic int getPartitionCount()
PartitionergetPartitionCount in class Partitionerpublic void overlapPartitions(Shape shape, ResultCollector<java.lang.Integer> matcher)
PartitioneroverlapPartitions in class Partitionerpublic int overlapPartition(Shape shape)
PartitioneroverlapPartition in class Partitionerpublic CellInfo getPartitionAt(int index)
PartitionergetPartitionAt in class Partitionerpublic CellInfo getPartition(int id)
PartitionergetPartition in class Partitioner