Skip to content

Commit

Permalink
Added multithread/process explainer + recommendations to get around them
Browse files Browse the repository at this point in the history
  • Loading branch information
codeananda committed Feb 13, 2024
1 parent e0e956e commit 94905b9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ user. These features include:
* ~~Disk serialization~~ [currently broken as of Jan 2024](https://github.com/Toblerity/rtree/pull/197)
* Custom storage implementation (to implement spatial indexing in ZODB, for example)

These features do not include:

* Multithread safety (for reading or writing)
* Multiprocess safety (for reading or writing)

For either of these, we recommend using:

* A PostGIS database, or
* GeoPandas + spatial joining, or
* Building an rtree from scratch in each thread/process (using [generator syntax](https://rtree.readthedocs.io/en/latest/performance.html#use-stream-loading))

Note that since rtree is written in C, it can be orders of magnitude faster than a
database even if running sequentially.

Wheels are available for most major platforms, and `rtree` with bundled `libspatialindex` can be installed via pip:

Expand Down

0 comments on commit 94905b9

Please sign in to comment.