Class PolygonBound
- java.lang.Object
-
- org.apache.druid.collections.spatial.search.RectangularBound
-
- org.apache.druid.collections.spatial.search.PolygonBound
-
- All Implemented Interfaces:
Bound
public class PolygonBound extends RectangularBound
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(float[] coords)
boolean
equals(Object o)
Iterable<ImmutablePoint>
filter(Iterable<ImmutablePoint> points)
static PolygonBound
from(float[] abscissa, float[] ordinate)
static PolygonBound
from(float[] abscissa, float[] ordinate, int limit)
abscissa and ordinate contain the coordinates of polygon.float[]
getAbscissa()
byte[]
getCacheKey()
float[]
getOrdinate()
int
hashCode()
-
Methods inherited from class org.apache.druid.collections.spatial.search.RectangularBound
getLimit, getMaxCoords, getMinCoords, getNumDims, overlaps
-
-
-
-
Method Detail
-
from
public static PolygonBound from(float[] abscissa, float[] ordinate, int limit)
abscissa and ordinate contain the coordinates of polygon. abscissa[i] is the horizontal coordinate for the i'th corner of the polygon, and ordinate[i] is the vertical coordinate for the i'th corner. The polygon must have more than 2 corners, so the length of abscissa or ordinate must be equal or greater than 3. if the polygon is a rectangular, which corners are {0.0, 0.0}, {0.0, 1.0}, {1.0, 1.0}, {1.0, 0.0}, the abscissa should be {0.0, 0.0, 1.0, 1.0} and ordinate should be {0.0, 1.0, 1.0, 0.0}
-
from
public static PolygonBound from(float[] abscissa, float[] ordinate)
-
getOrdinate
public float[] getOrdinate()
-
getAbscissa
public float[] getAbscissa()
-
contains
public boolean contains(float[] coords)
- Specified by:
contains
in interfaceBound
- Overrides:
contains
in classRectangularBound
-
filter
public Iterable<ImmutablePoint> filter(Iterable<ImmutablePoint> points)
- Specified by:
filter
in interfaceBound
- Overrides:
filter
in classRectangularBound
-
getCacheKey
public byte[] getCacheKey()
- Specified by:
getCacheKey
in interfaceBound
- Overrides:
getCacheKey
in classRectangularBound
-
equals
public boolean equals(Object o)
- Overrides:
equals
in classRectangularBound
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classRectangularBound
-
-