Skip to content

Use firedrake-rtree for spatial indexing#4981

Open
leo-collins wants to merge 41 commits intomainfrom
leo/rust-rstar
Open

Use firedrake-rtree for spatial indexing#4981
leo-collins wants to merge 41 commits intomainfrom
leo/rust-rstar

Conversation

@leo-collins
Copy link
Copy Markdown
Contributor

@leo-collins leo-collins commented Mar 20, 2026

Description

Use firedrake-rtree for spatial indexing.

  • This is an order of magnitude faster than libspatialindex for querying points.
  • We can now build a one dimensional spatial index, allowing us to remove a whole load of special-cased code.
  • We can now access the nodes of the tree and manually traverse it. This will be used to build a distributed rtree which will allow us to use sparse communication operations to build the VertexOnlyMesh, instead of the expensive allgathers we use currently.

Copy link
Copy Markdown
Contributor

@connorjward connorjward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tiny things. I think this is great and 99% ready.

size_t dim
RTreeError err

if coords_min.shape[0] != coords_max.shape[0] or coords_min.shape[1] != coords_max.shape[1]:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if coords_min.shape[0] != coords_max.shape[0] or coords_min.shape[1] != coords_max.shape[1]:
if coords_min.shape != coords_max.shape:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work for some reason. coords_min.shape != coords_max.shape evaluates to true.

docstrings

more comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants