public final class ShapeField
extends java.lang.Object
Polygon
's and Line
's are decomposed into a triangular mesh using the Tessellator
utility class.
Each ShapeField.Triangle
is encoded by this base class and indexed as a seven dimension multi-value field.
Finding all shapes that intersect a range (e.g., bounding box), or target shape, at search time is efficient.
This class defines the static methods for encoding the three vertices of a tessellated triangles as a seven dimension point. The coordinates are converted from double precision values into 32 bit integers so they are sortable at index time.
Modifier and Type | Class and Description |
---|---|
static class |
ShapeField.DecodedTriangle
Represents a encoded triangle using
decodeTriangle(byte[], DecodedTriangle) . |
static class |
ShapeField.QueryRelation
Query Relation Types
|
static class |
ShapeField.Triangle
polygons are decomposed into tessellated triangles using
Tessellator
these triangles are encoded and inserted as separate indexed POINT fields |
Modifier and Type | Field and Description |
---|---|
(package private) static int |
BYTES
vertex coordinates are encoded as 4 byte integers
|
private static int |
MAXY_MINX_MINY_MAXX_Y_X |
private static int |
MAXY_MINX_MINY_X_Y_MAXX |
private static int |
MAXY_MINX_Y_X_MINY_MAXX |
private static int |
MINY_MINX_MAXY_MAXX_Y_X |
private static int |
MINY_MINX_Y_MAXX_MAXY_X |
private static int |
MINY_MINX_Y_X_MAXY_MAXX |
protected static FieldType |
TYPE
tessellated triangles are seven dimensions; the first four are the bounding box index dimensions
|
private static int |
Y_MINX_MINY_MAXX_MAXY_X |
private static int |
Y_MINX_MINY_X_MAXY_MAXX |
Modifier | Constructor and Description |
---|---|
private |
ShapeField() |
Modifier and Type | Method and Description |
---|---|
static void |
decodeTriangle(byte[] t,
ShapeField.DecodedTriangle triangle)
Decode a triangle encoded by
encodeTriangle(byte[], int, int, boolean, int, int, boolean, int, int, boolean) . |
static void |
encodeTriangle(byte[] bytes,
int aLat,
int aLon,
boolean abFromShape,
int bLat,
int bLon,
boolean bcFromShape,
int cLat,
int cLon,
boolean caFromShape)
A triangle is encoded using 6 points and an extra point with encoded information in three bits of how to reconstruct it.
|
static final int BYTES
protected static final FieldType TYPE
private static final int MINY_MINX_MAXY_MAXX_Y_X
private static final int MINY_MINX_Y_X_MAXY_MAXX
private static final int MAXY_MINX_Y_X_MINY_MAXX
private static final int MAXY_MINX_MINY_MAXX_Y_X
private static final int Y_MINX_MINY_X_MAXY_MAXX
private static final int Y_MINX_MINY_MAXX_MAXY_X
private static final int MAXY_MINX_MINY_X_Y_MAXX
private static final int MINY_MINX_Y_MAXX_MAXY_X
public static void encodeTriangle(byte[] bytes, int aLat, int aLon, boolean abFromShape, int bLat, int bLon, boolean bcFromShape, int cLat, int cLon, boolean caFromShape)
public static void decodeTriangle(byte[] t, ShapeField.DecodedTriangle triangle)
encodeTriangle(byte[], int, int, boolean, int, int, boolean, int, int, boolean)
.