Merge pull request #59 from JonFreer/truncate

Add truncate_by_edge to fix ways which do not extend to edge of figure
This commit is contained in:
Marcelo de Oliveira Rosa Prates
2021-09-13 17:08:17 -03:00
committed by GitHub

View File

@@ -232,6 +232,7 @@ def get_geometries(
def get_streets( def get_streets(
perimeter: Optional[GeoDataFrame] = None, perimeter: Optional[GeoDataFrame] = None,
point: Optional[Tuple] = None, point: Optional[Tuple] = None,
radius: Optional[float] = None, radius: Optional[float] = None,
@@ -242,6 +243,8 @@ def get_streets(
retain_all: Boolean = False, retain_all: Boolean = False,
circle: Boolean = True, circle: Boolean = True,
dilate: float = 0, dilate: float = 0,
truncate_by_edge: Boolean = True
) -> MultiPolygon: ) -> MultiPolygon:
""" """
Get streets Get streets
@@ -257,6 +260,7 @@ def get_streets(
retain_all (Boolean, optional): [description]. Defaults to False. retain_all (Boolean, optional): [description]. Defaults to False.
circle (Boolean, optional): [description]. Defaults to True. circle (Boolean, optional): [description]. Defaults to True.
dilate (Number, optional): [description]. Defaults to 0. dilate (Number, optional): [description]. Defaults to 0.
truncate_by_edge (Boolean, optional): [description]. Defaults to True.
Returns: Returns:
MultiPolygon: [description] MultiPolygon: [description]
@@ -288,6 +292,7 @@ def get_streets(
dist=radius + dilate + buffer, dist=radius + dilate + buffer,
retain_all=retain_all, retain_all=retain_all,
custom_filter=custom_filter, custom_filter=custom_filter,
truncate_by_edge = truncate_by_edge,
) )
crs = ox.graph_to_gdfs(streets, nodes=False).crs crs = ox.graph_to_gdfs(streets, nodes=False).crs
streets = ox.project_graph(streets) streets = ox.project_graph(streets)