geopandas_osm
geopandas_osm copied to clipboard
Loop over all ways in "df"
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')