A quadtree is a geometric data structure for storing points in two-dimensional space. Quadtrees recursively partition a space into four quadrants.
Questions tagged [quadtree]
380 questions
0
votes
2 answers
How to handle duplicate points for R-trees and Quad trees?
I am looking at implementing a quad tree and r-tree data structures to test some ideas on dealing with distribution of 2 dimension points. My question is, how do these algorithms handle duplicate points? Or what are some techniques for handling…

Stefan Orr
- 191
- 1
- 11
0
votes
0 answers
Split a node in a Quadtree
I'm implementing an immutable Quadtree in Scala and I can't understand what happens/when to split a node. These are my main references: Article 1, Article 2 and a third one I can't find now.
I understand these 3 key points of a quadtree:
A node…

ColOfAbRiX
- 1,039
- 1
- 13
- 27
0
votes
1 answer
Cost/Benefit of Reverse Lookup in Quadtree Implementation
I recently wrote a point quadtree implementation, in which points are inserted based on (x, y) coordinates. Each point has a unique point_id.
It has no reverse lookup right now – if you want to find a point, you need to pass coordinates.
Are there…

David K.
- 679
- 2
- 10
- 23
0
votes
0 answers
Quad Tree Implementation Operator++
I was wondering how you can implement an operator++ for a quad tree. I know that I have to go to the farthest child of the tree and then go to right.But not sure how to though. Any help would be appreciated. Thank You!

Daniel Choi
- 1
- 1
0
votes
0 answers
Collision detection in R
I have a matrix of positions returned from any of the igraph layouts, e.g.,
layout=layout.fruchterman.reingold(g)
This just has a set of points:
[,1] [,2]
[1,] 22.0952841 -25.0292619
[2,] 14.0612662 13.0353858
[3,] …

SOUser
- 610
- 1
- 11
- 25
0
votes
1 answer
How to efficiently insert non-point objects into a quadtree
I'm trying to create a Quadtree structure in python for detecting collisions amongst polygons, and I've gotten pretty far (see end of the post). However, I realized that this structure only works for points, because I'm deciding which leaf to put…

nathan lachenmyer
- 5,298
- 8
- 36
- 57
0
votes
1 answer
find area of a square recursively
I have a big square, which is made of small square-tiles of fixed size.
The area of these small square-tiles are known.
One of the tile is shown on the upper left corner.
Now,
Each square can be broken down into 4 subsquares. And each square has a…

Sounak
- 4,803
- 7
- 30
- 48
0
votes
1 answer
KD-Tree on secondary memory?
I know some of the range searching data structure, for example kd-tree, Range tree and quad-tree.
But all the implementation is in memory, how can I implementation them on secondary memory with high performance I/O efficiency?
Here is the…

Zhao Yuhao
- 11
- 1
0
votes
0 answers
Terrain LOD Camera Moving Crack
I have a grid based terrain and a quadtree for lod.
In one simulation step i do the following:
handle input.
update matrices.
build quadtree (view frustum culling, distance check).
close cracks.
copy enabled points to the vertex array.
draw vertex…

Meldryt
- 75
- 1
- 10
0
votes
1 answer
maximum recursion depth exceeded when inserting points into a quadtree using Python (dying looking for the bug)
I am trying to build a point region quadtree which stores points on a 2D map with Python, but when I try to insert two points which are close (not too close) to each other, I run into an error: RuntimeError: maximum recursion depth exceeded in cmp.…

Gordon Vanderbilt
- 374
- 6
- 15
0
votes
1 answer
Recursive algorithm to return nested structure of a recursive QuadTree
I've been using this recurivse Quadtree from http://www.astroml.org/book_figures/chapter2/fig_quadtree_example.html
on some data. But I now need a nested representation of the structure of the result.
The structure is something…

James
- 153
- 2
- 6
0
votes
2 answers
Syntax error on confusing compound Python statement
I'm try to run a quadtree example (first bit of code on that page) from pygame but am getting a syntax error on a very confusing line:
in_nw = item.left <= cx and item.top <= cy
The syntax error points at the second equals sign in the…

Airuno2L
- 187
- 7
0
votes
2 answers
XY coordinates to quadtree in Javascript
I want to convert Converts tile XY coordinates into a QuadKey at a specified level of detail.
I need to do this in Javascript. To Illustrate the problematic you will find an exact description here:…

Simon S.
- 563
- 4
- 21
0
votes
1 answer
Implementing Insertion/Deletion/QueryRange in a Region-Quad tree?
When you're using a quad tree to store regions instead of just points, how exactly should your implementation change? I can't find a good source code example on the web of how one might implement a PR-QuadTree. The only examples I can find are of…

kjh
- 3,407
- 8
- 42
- 79
0
votes
1 answer
quadtree decomposition of wavelet coefficients
After retrieving image coeffients (both approximate and detailed) in wavelet decomposition, i want quadtree structure for appoximate and detailed coefficients. but every time i am getting same error. Please help.
I tried to make it power of 3…

TG29
- 15
- 4