The librtree-python package

A Python native extension implementing the R-tree spatial index of Guttman-Green. The code is an embedded version of librtree.

Dependencies

Just Jansson: this common library may be in your operating-system’s repositories. On Debian, Ubuntu and derivatives:

apt-get install libjansson-dev

On RedHat, CentOS:

yum install jansson-devel

On OSX:

brew install jansson

One does not need to install librtree itself, the library-code is embedded within the package.

Install the package from GitLab

Run

python3 -m pip install librtree \
  --index-url https://gitlab.com/api/v4/projects/44068540/packages/pypi/simple

Use the RTree class

Add

from librtree import RTree

to your Python code. See the documentation for details on usage.