Skip to main content

A small package to get data from OSM API directly

Project description

osm_api Package

A small package to get data from OpenStreetMap API directly

Description

This package get Node, Way, and Relation geometry data directly from OSM API(instead of Nominatim API) by provided OSM object ID, and parse it into Shapely objects. due to heavy dependencies of GeoPandas, GeoDataFrame export excluded. but you can easily convert Shapely to GeoPandas, here is an example:

def get_relation_as_gdf(osm_id: str) -> geopandas.GeoDataFrame:
    polygon = osm_api.get_relation_as_polygon(osm_id)
    data = {'geometry': [polygon]}
    df = pd.DataFrame(data)
    gdf = geopandas.GeoDataFrame(df)
    return gdf

Examples

import osm_api
polygon = osm_api.get_relation(osm_id='537701')
line_string = osm_api.get_way(osm_id='440582504')
lat_lng = osm_api.get_node(osm_id='25960293')

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

osmapi_wrapper-1.0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

osmapi_wrapper-1.0.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file osmapi_wrapper-1.0.1.tar.gz.

File metadata

  • Download URL: osmapi_wrapper-1.0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for osmapi_wrapper-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7b2a2c2863aca1888c047bac2cfaf843291127997e83129288a413d6a2ebc874
MD5 c5d9982dd3f2815c6831e9732a03608a
BLAKE2b-256 e770909c552dca11c5db49b81291ce9db1053dfb4fee286b5cc3c66934065204

See more details on using hashes here.

File details

Details for the file osmapi_wrapper-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: osmapi_wrapper-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.7

File hashes

Hashes for osmapi_wrapper-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad03e57fd5fd014bd4d8343f6417d6936b4d81141f2ef26f73fdcaa7b934290f
MD5 70345561dc5e33222fbe2bdc5d7ca237
BLAKE2b-256 28b2dd777c4782992e6aba24c589319d1e683ec1afca4722a5b522e7ef825b93

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page