Skip to content

lib/octree: Added octree library#7324

Open
cwhite911 wants to merge 7 commits intoOSGeo:mainfrom
cwhite911:octree
Open

lib/octree: Added octree library#7324
cwhite911 wants to merge 7 commits intoOSGeo:mainfrom
cwhite911:octree

Conversation

@cwhite911
Copy link
Copy Markdown
Contributor

@cwhite911 cwhite911 commented Apr 17, 2026

Added a new lib/octree/ spatial indexing library for 3D points. The octree recursively subdivides space into octants with adaptive subdivision and a depth limit for coincident points. It supports point insertion, axis-aligned range queries, depth-limited traversal, cached subtree point counts, and subtree centroids.

The areas I was thinking about when writing this are, but I'm sure there are many other use cases as well.

  • LiDAR ingest (v.in.pdal)
  • v.vol.rst
  • spatial decimation (v.decimate)
  • level-of-detail (LOD) rendering of point clouds in the NVIZ GUI, where loading everything into memory currently bogs the system down.

@cwhite911 cwhite911 self-assigned this Apr 17, 2026
@github-actions github-actions Bot added CI Continuous integration C Related code is in C libraries docs tests Related to Test Suite CMake labels Apr 17, 2026
@petrasovaa
Copy link
Copy Markdown
Contributor

Are you using it for something specific now? Do you plan to integrate the library into one of the suggested tools?

@petrasovaa petrasovaa closed this Apr 17, 2026
@petrasovaa petrasovaa reopened this Apr 17, 2026
@metzm
Copy link
Copy Markdown
Contributor

metzm commented Apr 19, 2026

How about adding some id to OctreePoint3D? With such an id, it would be easy to retrieve the corresponding points together with any attributes from the actual points vector when querying the octree. Or is this covered with any provided user_data?

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

Labels

C Related code is in C CI Continuous integration CMake docs libraries tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants