Skip to content

RtreeSpatialIndex

Namespace: ThinkGeo.Core

Rtree is a facade class of MapSuiteRtree.

public class RtreeSpatialIndex : SpatialIndex, System.IDisposable

Inheritance objectSpatialIndexRtreeSpatialIndex
Implements IDisposable

Properties

PathFilename

Gets or sets the PathFilename.

public string PathFilename { get; set; }

Property Value

string

ReadWriteMode

Gets or sets the ReadWriteMode.

public FileAccess ReadWriteMode { get; set; }

Property Value

FileAccess

DataFormat

Gets or sets the DataFormat.

public RtreeSpatialIndexDataFormat DataFormat { get; }

Property Value

RtreeSpatialIndexDataFormat

HasIdx

Gets or sets the HasIdx.

public bool HasIdx { get; }

Property Value

bool

PageSize

Property PageSize.

public int PageSize { get; }

Property Value

int

IsOpen

Gets a value indicating whether the index is currently open.

public bool IsOpen { get; }

Property Value

bool

CanDelete

Gets a value indicating whether this index supports deleting entries.

public bool CanDelete { get; protected set; }

Property Value

bool

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

void

Dispose()

This method is targeting releasing or resetting unmanaged resources.

public void Dispose()

Returns

void

OnStreamLoading(StreamLoadingEventArgs)

Performs on stream loading.

protected void OnStreamLoading(StreamLoadingEventArgs e)

Parameters

e StreamLoadingEventArgs
The stream to read from or write to.

Returns

void

RefreshCache()

Performs refresh cache.

public void RefreshCache()

Returns

void

DeleteCore(Feature)

Provides the overridable implementation that performs delete.

protected void DeleteCore(Feature feature)

Parameters

feature Feature
The feature.

Returns

void

AddCore(Feature)

Provides the overridable implementation that adds an item to the collection.

protected void AddCore(Feature feature)

Parameters

feature Feature
The feature.

Returns

void

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

lCA=

CreateRectangleSpatialIndex(string)

Creates rectangle spatial index.

public static void CreateRectangleSpatialIndex(string pathFilename)

Parameters

pathFilename string
The path to the source file.

Returns

void

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

void

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

void

CreatePointSpatialIndex(string)

Creates point spatial index.

public static void CreatePointSpatialIndex(string pathFilename)

Parameters

pathFilename string
The path to the source file.

Returns

void

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

void

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

void

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

void

            true for success
            false for failure

CloseCore()

Close a previously opened index file.

protected void CloseCore()

Returns

void

            true for success
            false for failure

Flush()

Write memory to disk if modified.

public void Flush()

Returns

void

            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

void

Events

StreamLoading

Occurs when the StreamLoading event is raised.

public event EventHandler<StreamLoadingEventArgs> StreamLoading;