C# Class Lucene.Net.Spatial.Prefix.Tree.SpatialPrefixTree

A Spatial Prefix Tree, or Trie, which decomposes shapes into prefixed strings at variable lengths corresponding to variable precision. Each string corresponds to a spatial region. Implementations of this class should be thread-safe and immutable once initialized.
Afficher le fichier Open project: apache/lucenenet Class Usage Examples

Protected Properties

Свойство Type Description
ctx Spatial4n.Core.Context.SpatialContext
maxLevels int

Méthodes publiques

Méthode Description
GetCell ( byte bytes, int offset, int len ) : Cell
GetCell ( byte bytes, int offset, int len, Cell target ) : Cell
GetCell ( string token ) : Cell

The cell for the specified token.

The cell for the specified token. The empty string should be equal to WorldCell. Precondition: Never called when token length > maxLevel.

GetCells ( IPoint p, int detailLevel, bool inclParents ) : IList

A Point-optimized implementation of GetCells(Shape, int, bool, bool). That method in facts calls this for points. This implementation depends on GetCell(string) being fast, as its called repeatedly when incPlarents is true.

GetCells ( IShape shape, int detailLevel, bool inclParents, bool simplify ) : IList

Gets the intersecting cells for the specified shape, without exceeding detail level.

Gets the intersecting cells for the specified shape, without exceeding detail level. If a cell is within the query shape then it's marked as a leaf and none of its children are added. This implementation checks if shape is a IPoint and if so returns GetCells(Point, int, bool).

GetDistanceForLevel ( int level ) : double

Given a cell having the specified level, returns the distance from opposite corners.

Given a cell having the specified level, returns the distance from opposite corners. Since this might very depending on where the cell is, this method may over-estimate.

GetLevelForDistance ( double dist ) : int

Returns the level of the largest grid in which its longest side is less than or equal to the provided distance (in degrees).

Returns the level of the largest grid in which its longest side is less than or equal to the provided distance (in degrees). Consequently 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.

SpatialPrefixTree ( SpatialContext ctx, int maxLevels ) : Spatial4n.Core.Context
ToString ( ) : string

Méthodes protégées

Méthode Description
GetCell ( IPoint p, int level ) : Cell

Returns the cell containing point p at the specified level.

Private Methods

Méthode Description
CellsToTokenStrings ( ICollection cells ) : IList
RecursiveGetCells ( Cell cell, IShape shape, int detailLevel, bool inclParents, bool simplify, IList result ) : bool

Returns true if cell was added as a leaf.

Returns true if cell was added as a leaf. If it wasn't it recursively descends.

Method Details

GetCell() protected méthode

Returns the cell containing point p at the specified level.
protected GetCell ( IPoint p, int level ) : Cell
p IPoint
level int
Résultat Cell

GetCell() public abstract méthode

public abstract GetCell ( byte bytes, int offset, int len ) : Cell
bytes byte
offset int
len int
Résultat Cell

GetCell() public méthode

public GetCell ( byte bytes, int offset, int len, Cell target ) : Cell
bytes byte
offset int
len int
target Cell
Résultat Cell

GetCell() public abstract méthode

The cell for the specified token.
The cell for the specified token. The empty string should be equal to WorldCell. Precondition: Never called when token length > maxLevel.
public abstract GetCell ( string token ) : Cell
token string
Résultat Cell

GetCells() public méthode

A Point-optimized implementation of GetCells(Shape, int, bool, bool). That method in facts calls this for points. This implementation depends on GetCell(string) being fast, as its called repeatedly when incPlarents is true.
public GetCells ( IPoint p, int detailLevel, bool inclParents ) : IList
p IPoint
detailLevel int
inclParents bool
Résultat IList

GetCells() public méthode

Gets the intersecting cells for the specified shape, without exceeding detail level.
Gets the intersecting cells for the specified shape, without exceeding detail level. If a cell is within the query shape then it's marked as a leaf and none of its children are added. This implementation checks if shape is a IPoint and if so returns GetCells(Point, int, bool).
public GetCells ( IShape shape, int detailLevel, bool inclParents, bool simplify ) : IList
shape IShape the shape; non-null
detailLevel int the maximum detail level to get cells for
inclParents bool /// if true then all parent cells of leaves are returned /// too. The top world cell is never returned. ///
simplify bool /// for non-point shapes, this will simply/aggregate sets of /// complete leaves in a cell to its parent, resulting in /// ~20-25% fewer cells. ///
Résultat IList

GetDistanceForLevel() public méthode

Given a cell having the specified level, returns the distance from opposite corners.
Given a cell having the specified level, returns the distance from opposite corners. Since this might very depending on where the cell is, this method may over-estimate.
public GetDistanceForLevel ( int level ) : double
level int [1 to maxLevels]
Résultat double

GetLevelForDistance() public abstract méthode

Returns the level of the largest grid in which its longest side is less than or equal to the provided distance (in degrees).
Returns the level of the largest grid in which its longest side is less than or equal to the provided distance (in degrees). Consequently 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.
public abstract GetLevelForDistance ( double dist ) : int
dist double >= 0
Résultat int

SpatialPrefixTree() public méthode

public SpatialPrefixTree ( SpatialContext ctx, int maxLevels ) : Spatial4n.Core.Context
ctx Spatial4n.Core.Context.SpatialContext
maxLevels int
Résultat Spatial4n.Core.Context

ToString() public méthode

public ToString ( ) : string
Résultat string

Property Details

ctx protected_oe property

protected SpatialContext,Spatial4n.Core.Context ctx
Résultat Spatial4n.Core.Context.SpatialContext

maxLevels protected_oe property

protected int maxLevels
Résultat int