R-Tree spatial index for Python GIS
Project description
Whether for in-memory feature stores, Plone content, or whatever – we need an index to speed up the search for objects that intersect with a spatial bounding box.
Index Protocol
In a nutshell:
>>> index.add(id=id, bounds=(left, bottom, right, top)) >>> [n for n in index.intersection((left, bottom, right, top))] [id]
This resembles a subset of the set protocol. add indexes a new object by id, intersection returns an iterator over ids where the node containing the id intersects with the specified bounding box. The intersection method is exact, with no false positives and no missed data.
Installation
Obtain and install a copy of both spatialindex and tools libraries from:
http://research.att.com/~marioh/tools/index.html
http://research.att.com/~marioh/spatialindex/index.html
Each library is a GNU-style build, so it should just be a matter of:
$ ./configure; make; make install
for each. The spatialindex library depends on the tools library, so make sure to build and install that first.
The command:
$ python setup.py install
installs an egg. If you’d rather stick with the old-school distributions, use:
$ python setup.py install --root / --single-version-externally-managed
Usage
See tests/R-Tree.txt.
Performance
See the tests/benchmarks.py file for a comparison.
Support
For current information about this project, see the wiki.
If you have questions, please consider joining our community list:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file Rtree-0.2.0.tar.gz
.
File metadata
- Download URL: Rtree-0.2.0.tar.gz
- Upload date:
- Size: 26.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 158ffbf4c322b97b58aca0ce9839f93cf7d0d3bbb5f538a8dba7e5832a555abf |
|
MD5 | c8e69b5cb52d5bdaec4d6fcbc30e0979 |
|
BLAKE2b-256 | e6ead6e40c238c1f5ec564c912431f2d36abaa398ce8cabaedd7b80145694354 |