michelleful / geopandas_osm

Query the OSM Overpass API and get a GeoDataFrame

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

geopandas_osm ======

A GeoPandas interface to query OpenStreetMap Overpass API

Quick start

Assuming you have a polygon for a boundary

import json

import shapely.geometry
import geopandas_osm.osm

with open('boundary.geojson') as f:
    data = json.load(f)

poly = shapely.geometry.shape(data['features'][0]['geometry'])
df = geopandas_osm.osm.query_osm('way', poly, recurse='down', tags='highway')

roads = df[df.type == 'LineString'][['highway', 'name', 'geometry']]

Project skeleton based on http://github.com/mapbox/pyskel

About

Query the OSM Overpass API and get a GeoDataFrame

License:MIT License


Languages

Language:Python 100.0%