Class: NodeBase

jsts.index.quadtree.NodeBase

new NodeBase()

The base class for nodes in a Quadtree.
Source:

Members

subnode

subquads are numbered as follows:
 2 | 3
 --+--
 0 | 1
Source:

Methods

add(item)

Adds an item to the node
Parameters:
Name Type Description
item Object the item to add.
Source:

addAllItems(resultItems) → {Array}

Adds all the items of the node and any subnodes
Parameters:
Name Type Description
resultItems Array the array to add items to.
Source:
Returns:
a new array with original and added items.
Type
Array

addAllItemsFromOverlapping(searchEnv, resultItems)

Parameters:
Name Type Description
searchEnv jsts.geom.Envelope the search-envelope.
resultItems Array the array containing original and added items.
Source:

depth() → {Number}

Calculates the depth
Source:
Returns:
the calculated depth.
Type
Number

getItems() → {Array}

Returns the nodes items
Source:
Returns:
the items-array.
Type
Array

getNodeCount() → {Number}

Counts the nodes
Source:
Returns:
the size of this node.
Type
Number

getSubnodeIndex(env, centre) → {Number}

Returns the index of the subquad that wholly contains the given envelope. If none does, returns -1.
Parameters:
Name Type Description
env jsts.geom.Envelope The envelope to check.
centre jsts.geom.Coordinate The coordinate.
Source:
Returns:
The sub-index or -1.
Type
Number

hasChildren() → {Boolean}

Source:
Returns:
true if the node has any children.
Type
Boolean

hasItems() → {Boolean}

Checks if the node has any items
Source:
Returns:
true if the node has any items.
Type
Boolean

isEmpty() → {Boolean}

Source:
Returns:
true if the node or any subnode does not have any items.
Type
Boolean

isPrunable() → {Boolean}

Source:
Returns:
true if the node is prunable.
Type
Boolean

remove(itemEnv, item) → {Boolean}

Removes a single item from this subtree.
Parameters:
Name Type Description
itemEnv jsts.geom.Envelope the envelope containing the item.
item Object the item to remove.
Source:
Returns:
true if the item was found and removed.
Type
Boolean

size() → {Number}

Calculates the size
Source:
Returns:
the calculated size.
Type
Number

visit(searchEnv, visitor)

Visits the node
Parameters:
Name Type Description
searchEnv jsts.geom.Envelope the search-envelope.
visitor Object the visitor.
Source:

visitItems(env, visitor)

Visits the items
Parameters:
Name Type Description
env jsts.geom.Envelope the search envelope.
visitor Object the visitor.
Source: