Skip to main content

A small package to get data from OSM API directly

Project description

PyPI version

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(osm_id)
    data = {'geometry': [polygon]}
    gdf = geopandas.GeoDataFrame(data)
    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.2.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.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for osmapi_wrapper-1.0.2.tar.gz
Algorithm Hash digest
SHA256 f35b51a399ed7acfb0787be901e54c911b20ad889ab071aa2f4ee29603e72841
MD5 b2ddc661eef256b683ec926676accca5
BLAKE2b-256 f10de62f2bb4ceb16dc8bb6724f0a57e6266e6175816012d360ba55701fc6aca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: osmapi_wrapper-1.0.2-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.13

File hashes

Hashes for osmapi_wrapper-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 78d8be98fe69ffd26547b8157ee77e765ca77228558cdfb1e1e9a4641c8089c0
MD5 0adf8b89e46a28740ebb05ed072a10ef
BLAKE2b-256 0eb5d54899d491d8531e6cfe3d71e751741f774525b6ae20d20ecce295938dc2

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