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

public string PathFilename { get; set; }

Property Value

String

ReadWriteMode

public FileAccess ReadWriteMode { get; set; }

Property Value

FileAccess

DataFormat

public RtreeSpatialIndexDataFormat DataFormat { get; }

Property Value

RtreeSpatialIndexDataFormat

HasIdx

public bool HasIdx { get; }

Property Value

Boolean

PageSize

Property PageSize.

public int PageSize { get; }

Property Value

Int32

IsOpen

public bool IsOpen { get; }

Property Value

Boolean

CanDelete

public bool CanDelete { get; protected set; }

Property Value

Boolean

Constructors

RtreeSpatialIndex()

DefauLb constructor.

public RtreeSpatialIndex()

RtreeSpatialIndex(String)

public RtreeSpatialIndex(string pathFilename)

Parameters

pathFilename String

RtreeSpatialIndex(String, FileAccess)

public RtreeSpatialIndex(string pathFilename, FileAccess readWriteMode)

Parameters

pathFilename String

readWriteMode FileAccess

Methods

Finalize()

protected void Finalize()

Dispose()

This method is targeting releasing or resetting unmanaged resources.

public void Dispose()

OnStreamLoading(StreamLoadingEventArgs)

protected void OnStreamLoading(StreamLoadingEventArgs e)

Parameters

e StreamLoadingEventArgs

RefreshCache()

public void RefreshCache()

DeleteCore(Feature)

protected void DeleteCore(Feature feature)

Parameters

feature Feature

AddCore(Feature)

protected void AddCore(Feature feature)

Parameters

feature Feature

GetFeatureIdsIntersectingBoundingBoxCore(RectangleShape)

protected Collection<string> GetFeatureIdsIntersectingBoundingBoxCore(RectangleShape boundingBox)

Parameters

boundingBox RectangleShape

Returns

Collection<String>

GetFeatureIdsWithinBoundingBox(RectangleShape)

public Collection<string> GetFeatureIdsWithinBoundingBox(RectangleShape boundingBox)

Parameters

boundingBox RectangleShape

Returns

Collection<String>

GetFeatureIdsWithinBoundingBoxCore(RectangleShape)

protected Collection<string> GetFeatureIdsWithinBoundingBoxCore(RectangleShape boundingBox)

Parameters

boundingBox RectangleShape

Returns

Collection<String>

GetFeatureIdsContainingRectangleShape(RectangleShape)

public Collection<string> GetFeatureIdsContainingRectangleShape(RectangleShape boundingBox)

Parameters

boundingBox RectangleShape

Returns

Collection<String>

GetFeatureIdsContainingRectangleShapeCore(RectangleShape)

protected Collection<string> GetFeatureIdsContainingRectangleShapeCore(RectangleShape rectangleShape)

Parameters

rectangleShape RectangleShape

Returns

Collection<String>

GetFeatureIdsNearestTo(PointShape, Int32)

public Collection<string> GetFeatureIdsNearestTo(PointShape pointShape, int maxReturningCount)

Parameters

pointShape PointShape

maxReturningCount Int32

Returns

Collection<String>

GetFeatureIdsNearestToCore(PointShape, Int32)

protected Collection<string> GetFeatureIdsNearestToCore(PointShape pointShape, int maxReturningCount)

Parameters

pointShape PointShape

maxReturningCount Int32

Returns

Collection<String>

GetBestPageSize(Int32)

Static method for getting the best page size according to the record count of a ShapeFile.

public static RtreeSpatialIndexPageSize GetBestPageSize(int recordCount)

Parameters

recordCount Int32
Record count of ShapeFile.

Returns

RtreeSpatialIndexPageSize
best page size

GetRoot()

Get the root node.

internal Node GetRoot()

Returns

Node
root node

CreateRectangleSpatialIndex(String)

public static void CreateRectangleSpatialIndex(string pathFilename)

Parameters

pathFilename String

CreateRectangleSpatialIndex(String, RtreeSpatialIndexPageSize)

public static void CreateRectangleSpatialIndex(string pathFilename, RtreeSpatialIndexPageSize pageSize)

Parameters

pathFilename String

pageSize RtreeSpatialIndexPageSize

CreateRectangleSpatialIndex(String, RtreeSpatialIndexPageSize, RtreeSpatialIndexDataFormat)

public static void CreateRectangleSpatialIndex(string pathFilename, RtreeSpatialIndexPageSize pageSize, RtreeSpatialIndexDataFormat dataFormat)

Parameters

pathFilename String

pageSize RtreeSpatialIndexPageSize

dataFormat RtreeSpatialIndexDataFormat

CreatePointSpatialIndex(String)

public static void CreatePointSpatialIndex(string pathFilename)

Parameters

pathFilename String

CreatePointSpatialIndex(String, RtreeSpatialIndexPageSize)

public static void CreatePointSpatialIndex(string pathFilename, RtreeSpatialIndexPageSize pageSize)

Parameters

pathFilename String

pageSize RtreeSpatialIndexPageSize

CreatePointSpatialIndex(String, RtreeSpatialIndexPageSize, RtreeSpatialIndexDataFormat)

public static void CreatePointSpatialIndex(string pathFilename, RtreeSpatialIndexPageSize pageSize, RtreeSpatialIndexDataFormat dataFormat)

Parameters

pathFilename String

pageSize RtreeSpatialIndexPageSize

dataFormat RtreeSpatialIndexDataFormat

IsRtreeSpatialIndexFileValid(String)

public static bool IsRtreeSpatialIndexFileValid(string indexFileName)

Parameters

indexFileName String

Returns

Boolean

OpenCore()

Open an existing index file as read only.

protected void OpenCore()

CloseCore()

Close a previously opened index file.

protected void CloseCore()

Flush()

Write memory to disk if modified.

public void Flush()

GetFeatureIdsIntersectingBoundingBox(RectangleShape, Double, Double, Int32, Collection<RectangleShape>)

public Collection<string> GetFeatureIdsIntersectingBoundingBox(RectangleShape rectangleShape, double screenWidth, double screenHeight, int simplifyPixelBufferSize, Collection<RectangleShape> dimensionlessBoxes)

Parameters

rectangleShape RectangleShape

screenWidth Double

screenHeight Double

simplifyPixelBufferSize Int32

dimensionlessBoxes Collection<RectangleShape>

Returns

Collection<String>

GetFeatureCountCore()

Get the count of all records in all leaf nodes.

protected int GetFeatureCountCore()

Returns

Int32
record count

GetBoundingBox()

public RectangleShape GetBoundingBox()

Returns

RectangleShape

DeleteRecord(BaseShape)

public void DeleteRecord(BaseShape shape)

Parameters

shape BaseShape

Events

StreamLoading

public event EventHandler<StreamLoadingEventArgs> StreamLoading;