Class PrefixTreeStrategy
An abstract SpatialStrategy based on SpatialPrefixTree. The two subclasses are RecursivePrefixTreeStrategy and TermQueryPrefixTreeStrategy. This strategy is most effective as a fast approximate spatial search filter.
Characteristics:
- Can index any shape; however only RecursivePrefixTreeStrategy can effectively search non-point shapes.
- Can index a variable number of shapes per field value. This strategy can do it via multiple calls to Lucene.Net.Spatial.Prefix.PrefixTreeStrategy.CreateIndexableFields(Spatial4n.Core.Shapes.IShape) for a document or by giving it some sort of Shape aggregate (e.g. NTS WKT MultiPoint). The shape's boundary is approximated to a grid precision.
- Can query with any shape. The shape's boundary is approximated to a grid precision.
- Only Intersects is supported. If only points are indexed then this is effectively equivalent to IsWithin.
- The strategy supports MakeDistanceValueSource(IPoint, Double)
even for multi-valued data, so long as the indexed data is all points; the
behavior is undefined otherwise. However,
it will likely be removed in the future
in lieu of using another strategy with a more scalable implementation. Use of this call is the only circumstance in which a cache is used. The cache is simple but as such it doesn't scale to large numbers of points nor is it real-time-search friendly.
Implementation:
The SpatialPrefixTree does most of the work, for example returning a list of terms representing grids of various sizes for a supplied shape. An important configuration item is DistErrPct which balances shape precision against scalability. See those docs.@lucene.internal
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Lucene.Net.Spatial.dll
Syntax
[Serializable]
public abstract class PrefixTreeStrategy : SpatialStrategy
Constructors
Name | Description |
---|---|
PrefixTreeStrategy(SpatialPrefixTree, String, Boolean) |
Fields
Name | Description |
---|---|
FIELD_TYPE | Indexed, tokenized, not stored. |
m_defaultFieldValuesArrayLen | |
m_distErrPct | |
m_grid | |
m_simplifyIndexedCells |
Properties
Name | Description |
---|---|
DefaultFieldValuesArrayLen | A memory hint used by MakeDistanceValueSource(IPoint) for how big the initial size of each Document's array should be. The default is 2. Set this to slightly more than the default expected number of points per document. |
DistErrPct | The default measure of shape precision affecting shapes at index and query times. |
Grid |
Methods
Name | Description |
---|---|
CreateIndexableFields(IShape, Double) | |
MakeDistanceValueSource(IPoint, Double) |