public abstract class SpatialHelper extends Object
SpatialFieldBridgeByQuadTree
,
SpatialFieldBridgeByRange
Modifier and Type | Method and Description |
---|---|
static int |
findBestQuadTreeLevelForSearchRange(double searchRange)
If point are searched at d distance from a point, a certain quad tree cell level will problem quad tree cell
that are big enough to contain the search area but the smallest possible.
|
static String |
formatFieldName(int quadTreeLevel,
String fieldName) |
static String |
formatLatitude(String fieldName) |
static String |
formatLongitude(String fieldName) |
static String |
formatQuadTreeCellId(int xIndex,
int yIndex) |
static int |
getCellIndex(double coordinate,
double range,
int quadTreeLevel)
Generate a Cell Index on one axis
|
static String |
getQuadTreeCellId(Point point,
int quadTreeLevel)
Generate a Quad Tree Cell Id (with both Cell Index on both dimension in it) for a position
|
static List<String> |
getQuadTreeCellsIds(Coordinates center,
double radius,
int quadTreeLevel)
Generate a Quad Tree Cell Ids List for the bounding box of a circular search area
|
static List<String> |
getQuadTreeCellsIds(Point lowerLeft,
Point upperRight,
int quadTreeLevel)
Generate a Quad Tree Cell Ids List covered by a bounding box
|
static double[] |
projectToIndexSpace(Point point)
Project a degree latitude/longitude point into a sinusoidal projection planar space for quad tree cell ids
computation
|
public static int getCellIndex(double coordinate, double range, int quadTreeLevel)
coordinate
- position to compute the Index forrange
- range of the axis (-pi,pi)/(-90,90) => 2*pi/180 e.gquadTreeLevel
- Hox many time the range has been split in twopublic static String getQuadTreeCellId(Point point, int quadTreeLevel)
point
- position to compute the Quad Tree Cell Id forquadTreeLevel
- Hox many time the dimensions have been split in twopublic static List<String> getQuadTreeCellsIds(Point lowerLeft, Point upperRight, int quadTreeLevel)
lowerLeft
- lower left corner of the bounding boxupperRight
- upper right corner of the bounding boxquadTreeLevel
- quad tree level of the wanted cell idspublic static List<String> getQuadTreeCellsIds(Coordinates center, double radius, int quadTreeLevel)
center
- center of the search arearadius
- radius of the search areaquadTreeLevel
- Quad Tree level of the wanted cell idspublic static int findBestQuadTreeLevelForSearchRange(double searchRange)
searchRange
- search range to be covered by the quad tree cellspublic static double[] projectToIndexSpace(Point point)
point
- point to be projectedpublic static String formatQuadTreeCellId(int xIndex, int yIndex)
Copyright © 2006–2015 Hibernate. All rights reserved.