org.apache.lucene.spatial.prefix.tree
public class QuadPrefixTree extends SpatialPrefixTree
SpatialPrefixTree
which uses a
quad tree in which an
indexed term will be generated for each cell, 'A', 'B', 'C', 'D'.Modifier and Type | Class and Description |
---|---|
static class |
QuadPrefixTree.Factory
Factory for creating
QuadPrefixTree instances with useful defaults |
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 |
---|---|
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).
|
void |
printInfo(PrintStream out) |
cellsToTokenStrings, getCell, getCells, getCells, getDistanceForLevel, getMaxLevels, getSpatialContext, getWorldCell, toString
public 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)
SpatialPrefixTree
dist
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 SpatialPrefixTree
dist
- >= 0public Cell getCell(com.spatial4j.core.shape.Point p, int level)
SpatialPrefixTree
p
at the specified level
.getCell
in class SpatialPrefixTree
public Cell getCell(String token)
SpatialPrefixTree
SpatialPrefixTree.getWorldCell()
.
Precondition: Never called when token length > maxLevel.getCell
in class SpatialPrefixTree
public Cell getCell(byte[] bytes, int offset, int len)
getCell
in class SpatialPrefixTree
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.