Questions tagged [r-tree]

R-Tree is a popular index structure for spatial data, stored as Minimum Bounding Rectangles (MBRs).

R-Trees were invented by Antonin Guttman in his 1984 seminal paper R-trees: a dynamic index structure for spatial searching. The extended usability of this data structured is presented in the survey R-trees Have Grown Everywhere and popular implementations include the boost::geometry::index library.

263 questions
2
votes
1 answer

How to install libspatialindex on Google Colaboratory

To efficiently analyse spatial data with Python, I use the rtree spatial index library, relying on the libspatialindex C library. I am able to successfully install rtree in the Google Colaboratory notebook using !pip install rtree. As expected, this…
MartinT
  • 1,671
  • 3
  • 14
  • 14
2
votes
1 answer

SQLite query using rtree and normal index slow

I have geospatial data, names with coordinates, in a SQLite table and created an rtree for the location and a normal index on the name-column. Rtree is used according to this docs: http://www.sqlite.org/rtree.html When I query records in a specific…
Tom
  • 190
  • 3
  • 18
2
votes
1 answer

How can I use the Rtree of the Boost Library in C++?

I am a asked to write a function that takes a "LatLon" as input (LatLon is a class with 2 doubles: latitude and longitude) and returns the the ID (int) of the closest intersection to that position. I am given functions that return the location of…
V. Vallejo
  • 25
  • 1
  • 9
2
votes
1 answer

Spatial Index/R Tree Support in Perl

Anyone got any good hints for working with an RTree in Perl? Either a pure RTree implementation which is performant or something I could hijack from a GIS project? Or would it be easier to use something like SQLite's spatial index support? Cheers
andeyatz
  • 428
  • 3
  • 9
2
votes
1 answer

Python rtree nearest - what exactly it does?

I have the following setup - it's rtree build on points: from collections import defaultdict from math import sqrt import rtree.index points = [(5, 4), (3, 1), (6, 3), (2, 8), (7, 8), (8, 1), (2, 3), (0, 4), (3, 7), (6, 4)] idx =…
Roman Pekar
  • 107,110
  • 28
  • 195
  • 197
2
votes
1 answer

Serialize/de-serialize Boost.Geometry rtree

Short version: is there any stable/reliable way to serialize/de-serialize a Boost.Geometry rtree ? Longer version: The rtree implementation in Boost.Geometry has experimental support for serialization/de-serialization, but the support is unstable,…
user416983
  • 974
  • 3
  • 18
  • 28
2
votes
1 answer

boost::rtree is affected by gcc compiler greatly

Since gcc 3.4.5 is used in the whole company, I have to use rtree of boost 1.57 because rtree of boost 1.59 has compile problem. I just use rtree in following way: namespace bg = boost::geometry; namespace bgi = boost::geometry::index; typedef…
wpc062
  • 308
  • 2
  • 9
2
votes
2 answers

Decent (r-tree, quad-tree or similar) library in ruby for searching spatial data

I have a database of 20k+ cities with latitude and longitude and I need to make lot of nearest point queries (which city is the nearest to certain lat,long point) against this dataset. I guess an R-Tree or QuadTree would be a perfect data structure…
esad
  • 2,660
  • 1
  • 27
  • 23
2
votes
2 answers

what is the best R tree variant

I am recently reading papers and codes on R-tree and its variants: linear, quadratic, R*-tree, and also R tree packing (STR). It seems to me that different techniques are different in the time complexities of tree creation, range search, and knn…
daydayup
  • 2,049
  • 5
  • 22
  • 47
2
votes
1 answer

libSpatialIndex: loading/storing index on disk

I have a bunch of points and I need to do a nearest neighbor search on them so I'm using the libSpatialIndex. The code is pretty straight forward and the library gives me the option to store the data on disk but I can not load it. the code: int…
2
votes
2 answers

Similarity search between time series in Matlab. Possible ? I cant find R-tree implementation in matlab

I would like to implement similarity search in matlab. I wanna to know is it possible ? My plan is to do use 2 popular similarity measurement which are Euclidean Distance and Dynamic Time Warping. Both of these will be applied on time series…
Jaz
  • 581
  • 2
  • 6
  • 10
2
votes
1 answer

boost rtree of box gives wrong intersection with segment

Boost rtree gives wrong intersection result for some intersection with segment queries. In this case the bounding box is a y-planar 10x10 square at y=0. I'm querying with a z-aligned line from (2, 1, 0) to (2, 1, 10). What's interesting is that if I…
Adrian Muresan
  • 199
  • 1
  • 1
  • 7
2
votes
1 answer

Python Rtree get/set coordinates for an id

I'm using the Rtree index in libspatialindex to insert some values as indicated here: >>> idx = index.Index() >>> idx.insert(42, (0, 0, 1, 1)) how can I change the value for the id 42? I'm looking for something less costly than delete+add. Also,…
ralux
  • 25
  • 5
2
votes
0 answers

what's an efficient data structure to do a geo proximity search in memory with javascript

I know that there are a lot of ways to do geo proximity searches using databases, but if I want to quickly geo search a large array of [lat,lng] in memory, what's the most efficient data structure to store and search that data? Is there some sort…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
2
votes
2 answers

Boost R-tree : counting elements satisfying a query

So far, when I want to count how many elements in my R-tree satisfy a specific spatial query, it boils down to running the query, collecting the matches and then counting them, roughly as follow: std::vector
jerorx
  • 568
  • 6
  • 19