Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Minimalistic geospatial searching solution for Python

I am looking for a minimalistic solution for doing basic geospatial search in Python. We have a dataset of roughly 10 k locations and we need to solve the find the all locations within a radius of N kilometers from a given location. I am not looking for explicit database with geospatial support. I hope to get around another external solution. Is there something that would use Python only?


2 Answers

Shapely seems to be a good solution. Its description seems to correspond to what you're looking for :

[Shapely] It lets you do PostGIS-ish stuff outside the context of a database using Python.

It is based on GEOS, which a widely used C++ library.

Here is a link to the documentation

like image 183
Nic_tfm Avatar answered May 01 '26 04:05

Nic_tfm


scipy.spatial has a kd-tree implementation that might be the most popular in Python.

like image 31
Mike Graham Avatar answered May 01 '26 04:05

Mike Graham



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!