Skip to main content

query rtree

Query an rtree based on a feature

Holly Conrad Smith avatar
Written by Holly Conrad Smith
Updated over a week ago

What is an rTree?

An R-tree is a hierarchical spatial index designed to optimize queries involving multi-dimensional geometric data. It organizes spatial objects using bounding rectangles, allowing efficient searching, retrieval, and spatial analysis.

At its core, the structure balances between minimizing overlap and maximizing compactness of these bounding rectangles, ensuring that queries traverse the tree efficiently. Each node in the hierarchy contains entries that either reference child nodes (in the case of internal nodes) or actual spatial objects (in the case of leaf nodes).

When a query is executed—whether for containment, intersection, or nearest neighbor search—the tree is traversed selectively. Instead of scanning all objects, only relevant branches of the tree are explored, significantly reducing computational complexity.

By structuring spatial data this way, R-trees enable scalable and performant spatial indexing, making them integral to geospatial databases, GIS applications, and spatial analytics.

Inputs

Name

Abbreviation

Type

Access

Description

Rtree

R

R Tree

Item

The rtree

Feature

F

Feature

Item

The feature

Outputs

Name

Abbreviation

Type

Access

Description

Ids

I

Number

List

The ids of the features that are within the radius

How to

  1. There is an rTree output from the read static layer node. This structures the elements within the layer in an rTree to make queries more efficient

  1. Feed in an enclosed polygon to the F connector

    This can be from read feature or any other node that generates a polygon

  2. The output is a list of the IDs of polygons in the static layer that are within the bounding box of the polygon.

Use Case

Generate masses from a parcel layer that represent the relative height of the buildings on those parcels.

Did this answer your question?