C# Класс 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.
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
ctx Spatial4n.Core.Context.SpatialContext
maxLevels int

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
GetCell ( IPoint p, int level ) : Cell

Returns the cell containing point p at the specified level.

Приватные методы

Метод Описание
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.

Описание методов

GetCell() защищенный Метод

Returns the cell containing point p at the specified level.
protected GetCell ( IPoint p, int level ) : Cell
p IPoint
level int
Результат Cell

GetCell() публичный абстрактный Метод

public abstract GetCell ( byte bytes, int offset, int len ) : Cell
bytes byte
offset int
len int
Результат Cell

GetCell() публичный Метод

public GetCell ( byte bytes, int offset, int len, Cell target ) : Cell
bytes byte
offset int
len int
target Cell
Результат Cell

GetCell() публичный абстрактный Метод

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
Результат Cell

GetCells() публичный Метод

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
Результат IList

GetCells() публичный Метод

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. ///
Результат IList

GetDistanceForLevel() публичный Метод

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]
Результат double

GetLevelForDistance() публичный абстрактный Метод

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
Результат int

SpatialPrefixTree() публичный Метод

public SpatialPrefixTree ( SpatialContext ctx, int maxLevels ) : Spatial4n.Core.Context
ctx Spatial4n.Core.Context.SpatialContext
maxLevels int
Результат Spatial4n.Core.Context

ToString() публичный Метод

public ToString ( ) : string
Результат string

Описание свойств

ctx защищенное свойство

protected SpatialContext,Spatial4n.Core.Context ctx
Результат Spatial4n.Core.Context.SpatialContext

maxLevels защищенное свойство

protected int maxLevels
Результат int