Class SpatialIndexing
- Namespace
- SpatialNET
- Assembly
- SpatialNET.Extensions.dll
Building and querying a SpatialNET.SpatialIndex`1 from geometries (ADR 0014).
public static class SpatialIndexingInheritance
Inherited Members
Methods
Query<T>(SpatialIndex<T>, IGeometry2D)
The items whose envelope touches or overlaps the envelope of geometry; an exact test is up to the caller.
public static IEnumerable<T> Query<T>(this SpatialIndex<T> index, IGeometry2D geometry)Parameters
indexSpatialIndex<T>-
The index.
geometryIGeometry2D-
The query geometry; an empty geometry yields nothing.
Returns
- IEnumerable<T>
Type Parameters
T-
The payload type.
Exceptions
- ArgumentNullException
-
indexorgeometryisnull.
ToSpatialIndex<T>(IEnumerable<T>, Func<T, Envelope2D>, int)
Builds an index over source, with envelopeOf giving each item's envelope.
public static SpatialIndex<T> ToSpatialIndex<T>(this IEnumerable<T> source, Func<T, Envelope2D> envelopeOf, int nodeCapacity = 16)Parameters
sourceIEnumerable<T>-
The items.
envelopeOfFunc<T, Envelope2D>-
The envelope of an item.
nodeCapacityint-
The maximum number of children per node, at least 2.
Returns
- SpatialIndex<T>
Type Parameters
T-
The item type, kept as the payload.
Exceptions
- ArgumentNullException
-
sourceorenvelopeOfisnull.
ToSpatialIndex<TGeometry>(IEnumerable<TGeometry>, int)
Builds an index over geometries, keyed by their SpatialNET.Measures.Envelope(SpatialNET.IGeometry2D).
public static SpatialIndex<TGeometry> ToSpatialIndex<TGeometry>(this IEnumerable<TGeometry> geometries, int nodeCapacity = 16) where TGeometry : IGeometry2DParameters
geometriesIEnumerable<TGeometry>-
The geometries; empty geometries are skipped.
nodeCapacityint-
The maximum number of children per node, at least 2.
Returns
- SpatialIndex<TGeometry>
Type Parameters
TGeometry-
The geometry type, kept as the payload.
Exceptions
- ArgumentNullException
-
geometriesor one of its elements isnull. - NotSupportedException
-
An element is none of the known geometry kinds.