Class QuadTree
Constructs a Quad-tree node from a object list and creates its children recursively
Inheritance
Namespace: Mapsui.Desktop.Shapefile.Indexing
Assembly: Mapsui.Desktop.dll
Syntax
public class QuadTree : IDisposable
Constructors
| Improve this Doc View SourceQuadTree(List<QuadTree.BoxObjects>, UInt32, Heuristic)
Creates a node and either splits the objects recursively into sub-nodes, or stores them at the node depending on the heuristics. Tree is built top->down
Declaration
public QuadTree(List<QuadTree.BoxObjects> objList, uint depth, Heuristic heurdata)
Parameters
Type | Name | Description |
---|---|---|
List<QuadTree.BoxObjects> | objList | Geometries to index |
System.UInt32 | depth | Current depth of tree |
Heuristic | heurdata | Heuristics data |
Properties
| Improve this Doc View SourceBox
Gets/sets the Axis Aligned Bounding Box
Declaration
public BoundingBox Box { get; set; }
Property Value
Type | Description |
---|---|
BoundingBox |
Child0
Gets/sets the left child node
Declaration
public QuadTree Child0 { get; set; }
Property Value
Type | Description |
---|---|
QuadTree |
Child1
Gets/sets the right child node
Declaration
public QuadTree Child1 { get; set; }
Property Value
Type | Description |
---|---|
QuadTree |
Depth
Gets the depth of the current node in the tree
Declaration
public uint Depth { get; }
Property Value
Type | Description |
---|---|
System.UInt32 |
IsLeaf
Determines whether the node is a leaf (if data is stored at the node, we assume the node is a leaf)
Declaration
public bool IsLeaf { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceDispose()
Disposes the node
Declaration
public void Dispose()
ErrorMetric(BoundingBox)
Calculate the floating point error metric
Declaration
public double ErrorMetric(BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box |
Returns
Type | Description |
---|---|
System.Double |
FromFile(String)
Loads a quadtree from a file
Declaration
public static QuadTree FromFile(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename |
Returns
Type | Description |
---|---|
QuadTree |
SaveIndex(String)
Saves the Quadtree to a file
Declaration
public void SaveIndex(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename |
Search(BoundingBox)
Searches the tree and looks for intersections with the boundingbox 'bbox'
Declaration
public Collection<uint> Search(BoundingBox box)
Parameters
Type | Name | Description |
---|---|---|
BoundingBox | box | Boundingbox to intersect with |
Returns
Type | Description |
---|---|
Collection<System.UInt32> |