r-tree

Can I use Boost.Geometry.index.rtree with threads?

若如初见. 提交于 2019-12-11 02:53:59
问题 I am trying to create a multithreaded spatial index using rtree from Boost.Geometry, however I am unable to determine if this is thread safe. I do not see any locking mechanisms inside rtree.hpp, but my C++/Boost knowledge is at a beginners level. Is Boost.Geometry.index.rtree thread safe in any way? If not, what would be the optimal approach to use it with multiple threads in a safe manner (e.g. mutex lock between insert() calls? Am I able to query() at the same time as insert()?).

Does Boost R-tree support hierarchy traverse?

喜欢而已 提交于 2019-12-11 00:43:05
问题 It seems that the R-tree in Boost does not support hierarchy traverse. To be specific, I want to get root node of the R-tree, and then get the children of the node. Does Boost R-tree support hierarchy traverse ? 回答1: In case this was XY problem. What would you like to do exactly? Regarding your question. User-defined tree traversal is not officially supported. However if you're not affraid to dig in the internals then you could write your own node visitor, like this one: https://github.com

boost rtree of box gives wrong intersection with segment

▼魔方 西西 提交于 2019-12-10 10:45:57
问题 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 use a box for query instead of a segment then it works as expected. This behavior is also present when the box is not planar, just move the min corner to (0, -5, 0) and it still happens. Am I using this wrong or is it a bug in boost? Edit: have

How can I use the index-structures in ELKI?

痴心易碎 提交于 2019-12-10 10:28:15
问题 These are quotes form http://elki.dbs.ifi.lmu.de/ : "Essentially, we bind the abstract distance query to a database, and then get a nearest neighbor search for this distance. At this point, ELKI will automatically choose the most appropriate kNN query class. If there exist an appropriate index for our distance function (not every index can accelerate every distance!), it will automatically be used here." "The getKNNForDBID method may boil down to a slow linear scan, but when the database has

(Re)loading the R Tree with spatialindex library

巧了我就是萌 提交于 2019-12-08 11:31:28
I am bulkloading an R Tree with spatialindex (http://libspatialindex.github.com/) library: string baseName = "streets"; size_t capacity = 10 * 1024 * 1024; bool bWriteThrough = false; indexIdentifier = 0; IStorageManager *disk = StorageManager::createNewDiskStorageManager(baseName, 512); fileInMem = StorageManager ::createNewRandomEvictionsBuffer(*disk, capacity, bWriteThrough); // bulkLoads my tree bulkLoadRTree(); cout << "tree info:" << endl; cout << *tree << endl; delete disk; The following is output at the info about the built tree: Dimension: 2 Fill factor: 0.7 Index capacity: 100 Leaf

Which applications use R-Trees?

て烟熏妆下的殇ゞ 提交于 2019-12-07 16:40:22
问题 Besides GIS applications, which other applications or libraries use R-trees and its variants? 回答1: Computer games often do. Here's a link to something cool. Computer graphics - both software and hardware - often use spatial partitioning e.g. BSP; there's neat logic in Imagination and Intel chips termed tile or zone rendering, for example. Code I've seen tends to lean towards fixed resolution dividing - octtrees, typically - rather than variable size buckets, but I'd still consider them

Persistent (Disk Based) R-Tree (or R* Tree)

三世轮回 提交于 2019-12-07 06:02:35
问题 How can R* Tree be implemented as a persistent (disk based) one? What is the architecture of the file for saving the R* Tree index or for saving leaf values? Notes: In addition how insert, update and delete operations can be performed in such a persistent R* Tree? Notes II: I have implemented an in-memory R-Tree with bulk load functionality. But I think that is totally irrelevant when we speak about disk-based ones. 回答1: If you need to have an on-disk R-Tree index, I would suggest using

RTree: Count points in the neighbourhoods within each point of another set of points

☆樱花仙子☆ 提交于 2019-12-07 00:40:54
问题 Why is this not returning a count of number of points in each neighbourhoods (bounding box)? import geopandas as gpd def radius(points_neighbour, points_center, new_field_name, r): """ :param points_neighbour: :param points_center: :param new_field_name: new field_name attached to points_center :param r: radius around points_center :return: """ sindex = points_neighbour.sindex pts_in_neighbour = [] for i, pt_center in points_center.iterrows(): nearest_index = list(sindex.intersection((pt

R-Trees : should I reinvent the wheel?

可紊 提交于 2019-12-06 08:15:39
问题 I'm trying to understand how to implement an R-Tree which will be used for "selecting" a set of geometrical objects contained in a bounding rectangle. I checked out the article on Wikipedia, which shows an example of data layout as a B-Tree. I could write a B-Tree and use it to write an R-Tree, but these are two complicated data structures which I'd have to debug, test, etc. I would rather reuse an existing tree implementation (std::set/multiset) and provide the sorting operation. Assuming I

boost rtree of box gives wrong intersection with segment

混江龙づ霸主 提交于 2019-12-06 06:19:57
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 use a box for query instead of a segment then it works as expected. This behavior is also present when the box is not planar, just move the min corner to (0, -5, 0) and it still happens. Am I using this wrong or is it a bug in boost? Edit: have tried this on Boost 1.56 and 1.59. #include <vector> #include "gtest/gtest.h" #include "gmock/gmock.h"