geopandas_osm icon indicating copy to clipboard operation
geopandas_osm copied to clipboard

Loop over all ways in "df"

Open chazanov opened this issue 7 years ago • 0 comments

I would like to calculate the perimeter length of all ways (with tag man_made=) inside my boundary length = df.geometry.length

But I'm always getting AttributeError: 'LineString' object has no attribute 'exterior'

when using your example code and my Sarnia.geojson as input:

with open('Sarnia.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='man_made')

chazanov avatar Aug 05 '18 17:08 chazanov