Closed G21-Goose closed 3 years ago
There was also an issue with some roads disappearing like in the case of #53 . This is because highway
is sometimes a list e.g.
['residential', 'footway']
Because this does not equal residential
or footway
it was being excluded when the highways are being assigned a width. It has been changed to check if the highway
being widened is in any of the values, so 'residential'
is in ['residential','footway']
There were a few conflicts that I need to fix
Some geometry was removed, even through it was partially in the perimeter such as in issue #46 where not all the river was visible because the last bit partially went out of the perimeter. This seemed to happen when a perimeter was provided and not a point or radius.
If
geometries = geometries.intersection(perimeter)
is changed togeometries = geometries.intersection(perimeter).buffer(0)
it seems to have behaviour that would be expected.Before change
After change
Also the buffer on the perimeter in
get_geometries()
andget_streets()
was being performed on the longitude and latitude in degrees, not meters. It now projects it, buffers it in meters, then turns it back into degrees for theox.geometries_from_polygon()
/ox.graph_from_polygon()
.The
get_streets()
function would have streets going over the perimeter when only used with aperimeter
. This was because the intersection code wasn't running when only aperimeter
was used, and theperimeter
was still aGeoDataFrame
because the lineperimeter = unary_union(ox.project_gdf(perimeter).geometry)
was missing.