public class GeohashPrefixTree extends SpatialPrefixTree
| Modifier and Type | Class and Description |
|---|---|
static class |
GeohashPrefixTree.Factory
Factory for creating
GeohashPrefixTree instances with useful defaults |
ctx, maxLevels, UTF8| Constructor and Description |
|---|
GeohashPrefixTree(com.spatial4j.core.context.SpatialContext ctx,
int maxLevels) |
| Modifier and Type | Method and Description |
|---|---|
Cell |
getCell(byte[] bytes,
int offset,
int len) |
Cell |
getCell(com.spatial4j.core.shape.Point p,
int level)
Returns the cell containing point
p at the specified level. |
Cell |
getCell(String token)
The cell for the specified token.
|
int |
getLevelForDistance(double dist)
Returns the level of the largest grid in which its longest side is less
than or equal to the provided distance (in degrees).
|
static int |
getMaxLevelsPossible()
Any more than this and there's no point (double lat & lon are the same).
|
cellsToTokenStrings, getCell, getCells, getCells, getDistanceForLevel, getMaxLevels, getSpatialContext, getWorldCell, toStringpublic GeohashPrefixTree(com.spatial4j.core.context.SpatialContext ctx,
int maxLevels)
public static int getMaxLevelsPossible()
public int getLevelForDistance(double dist)
SpatialPrefixTreedist acts as an error epsilon declaring the amount of detail needed in the
grid, such that you can get a grid with just the right amount of
precision.getLevelForDistance in class SpatialPrefixTreedist - >= 0public Cell getCell(com.spatial4j.core.shape.Point p, int level)
SpatialPrefixTreep at the specified level.getCell in class SpatialPrefixTreepublic Cell getCell(String token)
SpatialPrefixTreeSpatialPrefixTree.getWorldCell().
Precondition: Never called when token length > maxLevel.getCell in class SpatialPrefixTreepublic Cell getCell(byte[] bytes, int offset, int len)
getCell in class SpatialPrefixTreeCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.