public abstract class SpatialHelper extends Object
SpatialFieldBridgeByHash
,
SpatialFieldBridgeByRange
Modifier and Type | Method and Description |
---|---|
static int |
findBestSpatialHashLevelForSearchRange(double searchRange)
If point are searched at d distance from a point, a certain spatial hash cell level will problem spatial hash
cell that are big enough to contain the search area but the smallest possible.
|
static String |
formatFieldName(int spatialHashLevel,
String fieldName) |
static String |
formatLatitude(String fieldName) |
static String |
formatLongitude(String fieldName) |
static String |
formatSpatialHashCellId(int xIndex,
int yIndex) |
static int |
getCellIndex(double coordinate,
double range,
int spatialHashLevel)
Generate a Cell Index on one axis
|
static String |
getSpatialHashCellId(Point point,
int spatialHashLevel)
Generate a spatial hash cell id (with both cell index on both dimension in it) for a position
|
static List<String> |
getSpatialHashCellsIds(Coordinates center,
double radius,
int spatialHashLevel)
Generate a spatial hash cell ids list for the bounding box of a circular search area
|
static List<String> |
getSpatialHashCellsIds(Point lowerLeft,
Point upperRight,
int spatialHashLevel)
Generate a spatial hash cell ids list covered by a bounding box
|
static boolean |
isSpatialField(String fieldName) |
static boolean |
isSpatialFieldLatitude(String fieldName) |
static boolean |
isSpatialFieldLongitude(String fieldName) |
static double[] |
projectToIndexSpace(Point point)
Project a degree latitude/longitude point into a sinusoidal projection planar space for spatial hash cell ids
computation
|
static String |
stripSpatialFieldSuffix(String fieldName) |
public static int getCellIndex(double coordinate, double range, int spatialHashLevel)
coordinate
- position to compute the Index forrange
- range of the axis (-pi,pi)/(-90,90) => 2*pi/180 e.gspatialHashLevel
- Hox many time the range has been split in twopublic static String getSpatialHashCellId(Point point, int spatialHashLevel)
point
- position to compute the spatial hash cell id forspatialHashLevel
- Hox many time the dimensions have been split in twopublic static List<String> getSpatialHashCellsIds(Point lowerLeft, Point upperRight, int spatialHashLevel)
lowerLeft
- lower left corner of the bounding boxupperRight
- upper right corner of the bounding boxspatialHashLevel
- spatial hash level of the wanted cell idspublic static List<String> getSpatialHashCellsIds(Coordinates center, double radius, int spatialHashLevel)
center
- center of the search arearadius
- radius of the search areaspatialHashLevel
- spatial hash level of the wanted cell idspublic static int findBestSpatialHashLevelForSearchRange(double searchRange)
searchRange
- search range to be covered by the spatial hash cellspublic static double[] projectToIndexSpace(Point point)
point
- point to be projectedpublic static boolean isSpatialField(String fieldName)
public static boolean isSpatialFieldLatitude(String fieldName)
public static boolean isSpatialFieldLongitude(String fieldName)
public static String formatSpatialHashCellId(int xIndex, int yIndex)
Copyright © 2006-2017 Red Hat, Inc. All Rights Reserved