public class QuadPrefixTree extends SpatialPrefixTree
| Modifier and Type | Class and Description |
|---|---|
static class |
QuadPrefixTree.Factory |
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MAX_LEVELS |
double |
gridH |
static int |
MAX_LEVELS_POSSIBLE |
ctx, maxLevels, UTF8| Constructor and Description |
|---|
QuadPrefixTree(com.spatial4j.core.context.SpatialContext ctx) |
QuadPrefixTree(com.spatial4j.core.context.SpatialContext ctx,
int maxLevels) |
QuadPrefixTree(com.spatial4j.core.context.SpatialContext ctx,
com.spatial4j.core.shape.Rectangle bounds,
int maxLevels) |
| Modifier and Type | Method and Description |
|---|---|
int |
getLevelForDistance(double dist)
Returns the level of the smallest grid size with a side length that is greater or equal to the provided
distance.
|
Node |
getNode(byte[] bytes,
int offset,
int len) |
Node |
getNode(com.spatial4j.core.shape.Point p,
int level) |
Node |
getNode(String token)
The cell for the specified token.
|
List<Node> |
getNodes(com.spatial4j.core.shape.Shape shape,
int detailLevel,
boolean inclParents)
Gets the intersecting & including cells for the specified shape, without exceeding detail level.
|
void |
printInfo(PrintStream out) |
getMaxLevelForPrecision, getMaxLevels, getNode, getNodesAltPoint, getSpatialContext, getWorldNode, nodesToTokenStrings, toStringpublic static final int MAX_LEVELS_POSSIBLE
public static final int DEFAULT_MAX_LEVELS
public final double gridH
public QuadPrefixTree(com.spatial4j.core.context.SpatialContext ctx,
com.spatial4j.core.shape.Rectangle bounds,
int maxLevels)
public QuadPrefixTree(com.spatial4j.core.context.SpatialContext ctx)
public QuadPrefixTree(com.spatial4j.core.context.SpatialContext ctx,
int maxLevels)
public void printInfo(PrintStream out)
public int getLevelForDistance(double dist)
SpatialPrefixTreegetLevelForDistance in class SpatialPrefixTreedist - >= 0public Node getNode(com.spatial4j.core.shape.Point p, int level)
getNode in class SpatialPrefixTreepublic Node getNode(String token)
SpatialPrefixTreeSpatialPrefixTree.getWorldNode().
Precondition: Never called when token length > maxLevel.getNode in class SpatialPrefixTreepublic Node getNode(byte[] bytes, int offset, int len)
getNode in class SpatialPrefixTreepublic List<Node> getNodes(com.spatial4j.core.shape.Shape shape, int detailLevel, boolean inclParents)
SpatialPrefixTreeNode.getSubCell(com.spatial4j.core.shape.Point). Cell subclasses
ideally implement that method with a quick implementation, otherwise, subclasses should
override this method to invoke SpatialPrefixTree.getNodesAltPoint(com.spatial4j.core.shape.Point, int, boolean).
TODO consider another approach returning an iterator -- won't build up all cells in memory.getNodes in class SpatialPrefixTreeCopyright © 2000-2012 Apache Software Foundation. All Rights Reserved.