pyrosm | Read OpenStreetMap data from Protobuf files | Map library
kandi X-RAY | pyrosm Summary
kandi X-RAY | pyrosm Summary
Pyrosm is a Python library for reading OpenStreetMap data from Protocolbuffer Binary Format -files (*.osm.pbf) into Geopandas GeoDataFrames. Pyrosm makes it easy to extract various datasets from OpenStreetMap pbf-dumps including e.g. road networks, buildings, Points of Interest (POI), landuse and natural elements. Also fully customized queries are supported which makes it possible to parse the data from OSM with more specific filters. Pyrosm is easy to use and it provides a somewhat similar user interface as OSMnx. The main difference between pyrosm and OSMnx is that OSMnx reads the data over internet using OverPass API, whereas pyrosm reads the data from local OSM data dumps that can be downloaded e.g. from GeoFabrik's website. This makes it possible to read data faster thus allowing e.g. parsing street networks for the whole country fairly efficiently (however, see caveats). The library has been developed by keeping performance in mind, hence, it is mainly written in Cython (Python with C-like performance) which makes it probably faster than any other Python alternatives for parsing OpenStreetMap data. Pyrosm is built on top of another Cython library called Pyrobuf which is a faster Cython alternative to Google's Protobuf library: It provides 2-4x boost in performance for deserializing the protocol buffer messages compared to Google's version with C++ backend. Google's Protocol Buffers is a commonly used and efficient method to serialize and compress structured data which is also used by OpenStreetMap contributors to distribute the OSM data in PBF format (Protocolbuffer Binary Format). Documentation is available at
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Returns the bounding box of a file
- Validate a header block
- Read file contents
- Returns the filter for a given network type
- Return a dict of drive filters
- Return a dict of walking filters
- Return a dictionary of cycling filters
- Deprecated
- Get data for a given dataset
- Download data from given URL
- Return the URL for a source
- Convert size in bytes to GB
- Download a file
- Returns the size of a file
- Read the long description
- Calculate the length of a geometry
- Calculate the great circle distance between two points
- Calculates the length of a geom array
pyrosm Key Features
pyrosm Examples and Code Snippets
Community Discussions
Trending Discussions on pyrosm
QUESTION
I extracted some points of interest from Open Street Map (using the pyrosm
package) that I later exported to a parquet file. Here are the geometries, which have type shapely.geometry
:
ANSWER
Answered 2021-Nov-19 at 00:39The format seems to be WKB, see https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry
There are many packages that can decode it, but it is geometry-specific binary format, so you would need to use some geometry-specific package like geopndas or parse_wkb to decode it.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install pyrosm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page