Python port of GeoDesk, a fast and space-efficient spatial database engine for OpenStreetMap features
Reason this release was yanked:
Removed pre-release
Project description
GeoDesk is a fast and storage-efficient geospatial database for OpenStreetMap data. Also available for Java.
Why GeoDesk?
-
Small storage footprint — GeoDesk's GOL files are only 20% to 50% larger than the original OSM data in PBF format — that's less than a tenth of the storage consumed by a traditional SQL-based database.
-
Fast queries — typically 50 times faster than SQL.
-
Fast to get started — Converting
.osm.pbf
data to a GOL is 20 times faster than an import into an SQL database. Alternatively, download pre-made data tiles for just the regions you need and automatically assemble them into a GOL. -
Intuitive API — No need for object-relational mapping; GeoDesk queries return Python objects. Quickly discover tags, way-nodes and relation members. Get a feature's geometry, measure its length/area.
-
Proper handling of relations — (Traditional geospatial databases deal with geometric shapes and require workarounds to support this unique and powerful aspect of OSM data.)
-
Seamless integration with Shapely for advanced geometric operations, such as buffer, union, simplify, convex and concave hulls, Voronoi diagrams, and much more.
-
Modest hardware requirements — If it can run a 64-bit Python, it'll run GeoDesk.
Get Started
Requirements
- Python 3.6 or above
- Java 16 or above (for the GOL Tool)
Download
pip install geodesk
Create a GOL
Create a Geographic Object Library based on any .osm.pbf
file, using the
GOL Tool (Requires Java 16+).
For example:
gol build switzerland switzerland-latest.osm.pbf
Example Application
Find all the pubs in Zurich (Switzerland) and print their names:
from geodesk import *
# Open switzerland.gol
features = Features("switzerland")
# Get the feature that represents the area of the city of Zurich
zurich = features("a[boundary=adminstrative][admin_level=8][name:en=Zurich]").one
# Define a set that contains nodes and areas that are pubs
pubs = features("na[amenity=pub]")
# Iterate through the pubs that are contained in the area of Zurich
# and print their names
for pub in pubs.within(zurich):
print(pub.name)
More Examples
Find all movie theaters within 500 meters from a given point:
movieTheaters = features("na[amenity=cinema]").around(
meters=500, lat=47.37, lon=8.54)
Remember, OSM uses British English for its terminology.
Discover the bus routes that traverse a given street:
for route in street.parents("[route=bus]")):
print(f"- {route.ref} from {route.from} to {route.to}")
Count the number of entrances of a building:
numberOfEntrances = building.nodes("[entrance]").count
Documentation
Related Repositories
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 Distributions
Built Distributions
Hashes for geodesk-0.0.6-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 080d5675b57232bdad13defe47c191ccf235c8ce73ceead6b94211a7ba8adb12 |
|
MD5 | 50b95c99196d3ae231b52cd92b416fe8 |
|
BLAKE2b-256 | d8d9798aac0f7f4f2dcc1837217d0cad16417a9e2cebe0056ea62557f4bbc3a7 |
Hashes for geodesk-0.0.6-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d51cfefe5ec6682e59afc45efcd68fea2c3586c2c444aff7b60200fcd87d368 |
|
MD5 | d868d8e9a3af2664aed1368247f9c8b7 |
|
BLAKE2b-256 | ef4b5a8d02fa99b2695710e506862aa009f8cf8fa9792f662d54da4ad94544f0 |
Hashes for geodesk-0.0.6-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e04bff8a86f1c63097640a84432be4e33eaceb97c71d24f6cd2c3716b01d277 |
|
MD5 | c09e6cafffb56ca300151e970b12ccd4 |
|
BLAKE2b-256 | e4e4d9bb485346db26ad1886ca1c430d26599774007b13b510ad2aa3b4543039 |
Hashes for geodesk-0.0.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 341dec182a85cbfe689bae1138c32799e342bad10d9786d3a2a860cd7826fc7a |
|
MD5 | be677f6b652b80fd7b10185bd3b552a2 |
|
BLAKE2b-256 | 82866b755190f1dfaaeb81458726750c23d0a31cae6e22d7f30185056d14d7b5 |
Hashes for geodesk-0.0.6-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8795d543747aa6214042f2b9606906a4094bdd6e45ba02eb76aa736248d591de |
|
MD5 | b5509b098dde363bfba81503d0178a65 |
|
BLAKE2b-256 | 3a407d1c0aa0d1c4d67b8427b61ce8e031297ff246f9976f3e95b374cdee02cb |
Hashes for geodesk-0.0.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f454558d4899b80cb58e9a5e2a0f4c94fbcd8eb8f9d893378dec02bad6bfa079 |
|
MD5 | d6a09fbec35033dfba00203cb7fbf809 |
|
BLAKE2b-256 | 0bbe94c6ad7e761997b86ba97b88e38fb5e8790ccd5eb2e95b48177a27766c57 |
Hashes for geodesk-0.0.6-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3108cd11cf8059bdf02c3af37b0ff76d7dad9e8b9cd3e57513c5f93e7745ee8b |
|
MD5 | e1b42817b10583b194ecf0f90d88feb1 |
|
BLAKE2b-256 | cfe6046a97716503404d8e01b242430bb71c21db8b22dfd372fc8433dbf27077 |
Hashes for geodesk-0.0.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | da536cf89e61401d9f89a2f7ad67257bfa79cad21abaf21f2da74a58fca5257d |
|
MD5 | 44246aa10905dfbd6cb6c56fbfe9a78f |
|
BLAKE2b-256 | 24905bbd5a5ef839116fa9cd8eaa143a04a0f9eb393dd4c97aa490fc66a36bb0 |
Hashes for geodesk-0.0.6-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a9211628659658b06841414b4caa7f0549c5c25e92fabfc88fcfeedb14826d1 |
|
MD5 | a1baf75a4c0cf33ae8c56a00f72aa8e5 |
|
BLAKE2b-256 | 60970fb917cce955c9b5ecd7ef8d7e0d08f071b1d4cf0ad3747dc6f2abbf9642 |
Hashes for geodesk-0.0.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b2ce3f55fe8bc3382a2c1f5a26d7921646e3d87a29a012965aaed46a9afdf97 |
|
MD5 | 75d1b3b43f9d468e926584b9e4cd6e5b |
|
BLAKE2b-256 | 95cfd8fc3d06f1d724162dc9b300e4dd3d9be0a83de20b091d1b6740ec027996 |
Hashes for geodesk-0.0.6-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6df6916dcfb274941a3bfd19efe9c7c2987a1088b1648f768d4cf2f2038d8a25 |
|
MD5 | c3beb97ec505a452f1e4d9b0a1759482 |
|
BLAKE2b-256 | 4b1c70de31c1a23b7cacf68cf89903644acb6a64beec826d66273d34c577ae2f |
Hashes for geodesk-0.0.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f206b3b0c899938c2398df960c84a0ffbd11cbb8666244ae533b92d24f9ae58a |
|
MD5 | 97d62a5a6c468eed8b233b0ebb1b0b74 |
|
BLAKE2b-256 | 5badc15532ba2c834b3e5be15c8d272f3d0c32d67d9fdb24d0a056f248219c08 |