Skip to content

Commit

Permalink
General retrieve function added, see previous methods for example usage
Browse files Browse the repository at this point in the history
  • Loading branch information
BenDickens committed Jan 30, 2020
1 parent 541dd89 commit f7eface
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/damagescanner/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def buildings(osm_path):
Returns:
*GeoDataFrame* : a geopandas GeoDataFrame with all unique building polygons.
"""
return retrieve(osm_path, 'multipolygons',['building','amenity'])#, **{"amenity":""})
return retrieve(osm_path, 'multipolygons',['building','amenity'])

def roads(osm_path):
"""
Expand Down Expand Up @@ -144,6 +144,14 @@ def electricity(osm_path):
return retrieve(osm_path,'lines',['power','voltage'],**{'voltage':[" IS NULL"],})

def mainRoads(osm_path):
"""
Function to extract main road linestrings from OpenStreetMap
Arguments:
*osm_path* : file path to the .osm.pbf file of the region
for which we want to do the analysis.
Returns:
*GeoDataFrame* : a geopandas GeoDataFrame with all unique main road linestrings.
"""
return retrieve(osm_path,'lines',['highway','oneway','lanes','maxspeed'],**{'highway':["='primary' or ","='trunk' or ","='motorway' or ","='trunk_link' or ",
"='primary_link' or ", "='secondary' or ","='tertiary' or ","='tertiary_link'"]})

Expand Down

0 comments on commit f7eface

Please sign in to comment.