Class QuadTree
Constructs a Quad-tree node from a object list and creates its children recursively
Implements
Inherited Members
Namespace: Mapsui.Nts.Providers.Shapefile.Indexing
Assembly: Mapsui.Nts.dll
Syntax
public class QuadTree : IDisposable
Constructors
| Edit this page View SourceQuadTree(List<BoxObjects>, uint, 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 |
| uint | depth | Current depth of tree |
| Heuristic | heurdata | Heuristics data |
Properties
| Edit this page View SourceBox
Gets/sets the Axis Aligned Bounding Box
Declaration
public MRect? Box { get; set; }
Property Value
| Type | Description |
|---|---|
| MRect |
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 |
|---|---|
| uint |
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 |
|---|---|
| bool |
Methods
| Edit this page View SourceDispose()
Disposes the node
Declaration
public virtual void Dispose()
ErrorMetric(MRect)
Calculate the floating point error metric
Declaration
public double ErrorMetric(MRect box)
Parameters
| Type | Name | Description |
|---|---|---|
| MRect | box |
Returns
| Type | Description |
|---|---|
| double |
FromFile(string)
Loads a quadtree from a file
Declaration
public static QuadTree FromFile(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename |
Returns
| Type | Description |
|---|---|
| QuadTree |
SaveIndex(string)
Saves the Quadtree to a file
Declaration
public void SaveIndex(string filename)
Parameters
| Type | Name | Description |
|---|---|---|
| string | filename |
Search(MRect)
Searches the tree and looks for intersections with the BoundingBox 'bbox'
Declaration
public Collection<uint> Search(MRect box)
Parameters
| Type | Name | Description |
|---|---|---|
| MRect | box | BoundingBox to intersect with |
Returns
| Type | Description |
|---|---|
| Collection<uint> |