Class VectorSourceExtensions
Extension methods on IVectorSource that let callers benefit from a persistent spatial index without depending on IVectorSourceWithIndex at their call sites.
public static class VectorSourceExtensions
- Inheritance
-
VectorSourceExtensions
- Inherited Members
Methods
QueryByExtent(IVectorSource, BoundingBox)
Convenience: query the source's features by extent, using its spatial index when available and falling back to GetFeatures(BoundingBox?) otherwise.
public static IReadOnlyList<Feature> QueryByExtent(this IVectorSource source, BoundingBox extent)
Parameters
sourceIVectorSourceextentBoundingBox
Returns
Remarks
Sources that already route GetFeatures(extent) through
the index (like S101VectorSource)
see no behaviour change from calling this — it's provided so
callers holding only an IVectorSource reference
don't need to know whether the source is index-backed.
TryGetIndex(IVectorSource)
Returns the source's spatial index when it exposes one, or null otherwise. Sources implementing IVectorSourceWithIndex are the current opt-in path; every other IVectorSource returns null and callers should fall back to the linear GetFeatures(BoundingBox?) scan.
public static IVectorSpatialIndex? TryGetIndex(this IVectorSource source)
Parameters
sourceIVectorSource