RtreeSpatialIndex¶
Namespace: ThinkGeo.Core
Rtree is a facade class of MapSuiteRtree.
public class RtreeSpatialIndex : SpatialIndex, System.IDisposable
Inheritance object → SpatialIndex → RtreeSpatialIndex
Implements IDisposable
Properties¶
PathFilename¶
Gets or sets the PathFilename.
public string PathFilename { get; set; }
Property Value¶
ReadWriteMode¶
Gets or sets the ReadWriteMode.
public FileAccess ReadWriteMode { get; set; }
Property Value¶
DataFormat¶
Gets or sets the DataFormat.
public RtreeSpatialIndexDataFormat DataFormat { get; }
Property Value¶
HasIdx¶
Gets or sets the HasIdx.
public bool HasIdx { get; }
Property Value¶
PageSize¶
Property PageSize.
public int PageSize { get; }
Property Value¶
IsOpen¶
Gets a value indicating whether the index is currently open.
public bool IsOpen { get; }
Property Value¶
CanDelete¶
Gets a value indicating whether this index supports deleting entries.
public bool CanDelete { get; protected set; }
Property Value¶
Constructors¶
RtreeSpatialIndex()¶
DefauLb constructor.
public RtreeSpatialIndex()
RtreeSpatialIndex(string)¶
Initializes a new instance of the RtreeSpatialIndex class.
public RtreeSpatialIndex(string pathFilename)
Parameters¶
pathFilename string
RtreeSpatialIndex(string, FileAccess)¶
Initializes a new instance of the RtreeSpatialIndex class.
public RtreeSpatialIndex(string pathFilename, FileAccess readWriteMode)
Parameters¶
pathFilename string
readWriteMode FileAccess
Methods¶
Finalize()¶
Releases resources held by the RtreeSpatialIndex class.
protected void Finalize()
Returns¶
Dispose()¶
This method is targeting releasing or resetting unmanaged resources.
public void Dispose()
Returns¶
OnStreamLoading(StreamLoadingEventArgs)¶
Performs on stream loading.
protected void OnStreamLoading(StreamLoadingEventArgs e)
Parameters¶
e StreamLoadingEventArgs
The stream to read from or write to.
Returns¶
RefreshCache()¶
Performs refresh cache.
public void RefreshCache()
Returns¶
DeleteCore(Feature)¶
Provides the overridable implementation that performs delete.
protected void DeleteCore(Feature feature)
Parameters¶
feature Feature
The feature.
Returns¶
AddCore(Feature)¶
Provides the overridable implementation that adds an item to the collection.
protected void AddCore(Feature feature)
Parameters¶
feature Feature
The feature.
Returns¶
GetFeatureIdsIntersectingBoundingBoxCore(RectangleShape)¶
Provides the overridable implementation that returns the IDs of the features available in the underlying data source.
protected Collection<string> GetFeatureIdsIntersectingBoundingBoxCore(RectangleShape boundingBox)
Parameters¶
boundingBox RectangleShape
The bounding box used to constrain the query.
Returns¶
Collection<string>
The result of the operation.
GetFeatureIdsWithinBoundingBox(RectangleShape)¶
Returns the IDs of the features available in the underlying data source.
public Collection<string> GetFeatureIdsWithinBoundingBox(RectangleShape boundingBox)
Parameters¶
boundingBox RectangleShape
The bounding box used to constrain the query.
Returns¶
Collection<string>
The result of the operation.
GetFeatureIdsWithinBoundingBoxCore(RectangleShape)¶
Provides the overridable implementation that returns the IDs of the features available in the underlying data source.
protected Collection<string> GetFeatureIdsWithinBoundingBoxCore(RectangleShape boundingBox)
Parameters¶
boundingBox RectangleShape
The bounding box used to constrain the query.
Returns¶
Collection<string>
The result of the operation.
GetFeatureIdsContainingRectangleShape(RectangleShape)¶
Returns the IDs of the features available in the underlying data source.
public Collection<string> GetFeatureIdsContainingRectangleShape(RectangleShape boundingBox)
Parameters¶
boundingBox RectangleShape
The bounding box used to constrain the query.
Returns¶
Collection<string>
The result of the operation.
GetFeatureIdsContainingRectangleShapeCore(RectangleShape)¶
Provides the overridable implementation that returns the IDs of the features available in the underlying data source.
protected Collection<string> GetFeatureIdsContainingRectangleShapeCore(RectangleShape rectangleShape)
Parameters¶
rectangleShape RectangleShape
The rectangle that defines the area of interest.
Returns¶
Collection<string>
The result of the operation.
GetFeatureIdsNearestTo(PointShape, int)¶
Returns the IDs of the features available in the underlying data source.
public Collection<string> GetFeatureIdsNearestTo(PointShape pointShape, int maxReturningCount)
Parameters¶
pointShape PointShape
The point shape.
maxReturningCount int
The max returning count.
Returns¶
Collection<string>
The result of the operation.
GetFeatureIdsNearestToCore(PointShape, int)¶
Provides the overridable implementation that returns the IDs of the features available in the underlying data source.
protected Collection<string> GetFeatureIdsNearestToCore(PointShape pointShape, int maxReturningCount)
Parameters¶
pointShape PointShape
The point shape.
maxReturningCount int
The max returning count.
Returns¶
Collection<string>
The result of the operation.
GetBestPageSize(int)¶
Static method for getting the best page size according to the record count of a ShapeFile.
public static RtreeSpatialIndexPageSize GetBestPageSize(int recordCount)
Parameters¶
recordCount int
Record count of ShapeFile.
Returns¶
RtreeSpatialIndexPageSize
best page size
FiE=()¶
internal lCA= FiE=()
Returns¶
CreateRectangleSpatialIndex(string)¶
Creates rectangle spatial index.
public static void CreateRectangleSpatialIndex(string pathFilename)
Parameters¶
pathFilename string
The path to the source file.
Returns¶
CreateRectangleSpatialIndex(string, RtreeSpatialIndexPageSize)¶
Creates rectangle spatial index.
public static void CreateRectangleSpatialIndex(string pathFilename, RtreeSpatialIndexPageSize pageSize)
Parameters¶
pathFilename string
The path to the source file.
pageSize RtreeSpatialIndexPageSize
The page size.
Returns¶
CreateRectangleSpatialIndex(string, RtreeSpatialIndexPageSize, RtreeSpatialIndexDataFormat)¶
Creates rectangle spatial index.
public static void CreateRectangleSpatialIndex(string pathFilename, RtreeSpatialIndexPageSize pageSize, RtreeSpatialIndexDataFormat dataFormat)
Parameters¶
pathFilename string
The path to the source file.
pageSize RtreeSpatialIndexPageSize
The page size.
dataFormat RtreeSpatialIndexDataFormat
The data format.
Returns¶
CreatePointSpatialIndex(string)¶
Creates point spatial index.
public static void CreatePointSpatialIndex(string pathFilename)
Parameters¶
pathFilename string
The path to the source file.
Returns¶
CreatePointSpatialIndex(string, RtreeSpatialIndexPageSize)¶
Creates point spatial index.
public static void CreatePointSpatialIndex(string pathFilename, RtreeSpatialIndexPageSize pageSize)
Parameters¶
pathFilename string
The path to the source file.
pageSize RtreeSpatialIndexPageSize
The page size.
Returns¶
CreatePointSpatialIndex(string, RtreeSpatialIndexPageSize, RtreeSpatialIndexDataFormat)¶
Creates point spatial index.
public static void CreatePointSpatialIndex(string pathFilename, RtreeSpatialIndexPageSize pageSize, RtreeSpatialIndexDataFormat dataFormat)
Parameters¶
pathFilename string
The path to the source file.
pageSize RtreeSpatialIndexPageSize
The page size.
dataFormat RtreeSpatialIndexDataFormat
The data format.
Returns¶
IsRtreeSpatialIndexFileValid(string)¶
Performs is rtree spatial index file valid.
public static bool IsRtreeSpatialIndexFileValid(string indexFileName)
Parameters¶
indexFileName string
The index file name.
Returns¶
bool
True if the condition is met; otherwise, false.
OpenCore()¶
Open an existing index file as read only.
protected void OpenCore()
Returns¶
true for success
false for failure
CloseCore()¶
Close a previously opened index file.
protected void CloseCore()
Returns¶
true for success
false for failure
Flush()¶
Write memory to disk if modified.
public void Flush()
Returns¶
true for success
false for failure
GetFeatureIdsIntersectingBoundingBox(RectangleShape, double, double, int, Collection<RectangleShape>)¶
Returns the IDs of the features available in the underlying data source.
public Collection<string> GetFeatureIdsIntersectingBoundingBox(RectangleShape rectangleShape, double screenWidth, double screenHeight, int simplifyPixelBufferSize, Collection<RectangleShape> dimensionlessBoxes)
Parameters¶
rectangleShape RectangleShape
The rectangle that defines the area of interest.
screenWidth double
The screen width.
screenHeight double
The screen height.
simplifyPixelBufferSize int
The simplify pixel buffer size.
dimensionlessBoxes Collection<RectangleShape>
The dimensionless boxes.
Returns¶
Collection<string>
The result of the operation.
GetFeatureCountCore()¶
Get the count of all records in all leaf nodes.
protected int GetFeatureCountCore()
Returns¶
int
record count
GetBoundingBox()¶
Returns the bounding box that encloses the relevant geometry.
public RectangleShape GetBoundingBox()
Returns¶
RectangleShape
The result of the operation.
DeleteRecord(BaseShape)¶
Performs delete record.
public void DeleteRecord(BaseShape shape)
Parameters¶
shape BaseShape
The shape.
Returns¶
Events¶
StreamLoading¶
Occurs when the StreamLoading event is raised.
public event EventHandler<StreamLoadingEventArgs> StreamLoading;