File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 55import geojson
66import shapely .geometry
77
8- from robosat .osm .core import is_polygon
9-
108
119class RoadHandler (osmium .SimpleHandler ):
1210 """Extracts road polygon features (visible in satellite imagery) from the map.
@@ -122,19 +120,19 @@ def way(self, w):
122120 # https://wiki.openstreetmap.org/wiki/Tag:busway%3Dlane
123121 # https://wiki.openstreetmap.org/wiki/Tag:cycleway%3Dlane
124122 # https://wiki.openstreetmap.org/wiki/Key:parking:lane
125- except :
123+ except ValueError :
126124 print ("Warning: invalid feature: https://www.openstreetmap.org/way/{}" .format (w .id ), file = sys .stderr )
127125
128126 road_width = left_hard_shoulder_width + lane_width * lanes + right_hard_shoulder_width
129127
130128 if "width" in w .tags :
131129 try :
132130 # At least one meter wide, for road classes specified above
133- road_width = max (float (w .tags ["width" ]), 1 )
131+ road_width = max (float (w .tags ["width" ]), 1.0 )
134132
135133 # Todo: handle optional units such as "2 m"
136134 # https://wiki.openstreetmap.org/wiki/Key:width
137- except :
135+ except ValueError :
138136 print ("Warning: invalid feature: https://www.openstreetmap.org/way/{}" .format (w .id ), file = sys .stderr )
139137
140138 geometry = geojson .LineString ([(n .lon , n .lat ) for n in w .nodes ])
You can’t perform that action at this time.
0 commit comments