Open cforgaci opened 3 months ago
Using OSM streets and the municipal boundary, identify the street network running in parallel with the river within a given buffer (default 500m), choosing the outermost continuous line of streets.
Data:
OSM street network, focusing on motorway
, primary
, secondary
and tertiary
, starting from the highest and adding lower levels only if needed.
River edges (aptions can be added in an optimisation step):
OSM river line or (ideally) polygon
Polygons derived from remotely SAR data (Sentinel-1, no clouds) or optical data (Sentinel-2, higher time resolution) using segmentation algorithm SAM model from Facebook. This might be more useful for spatio-temporal analyses.
For OSM data we use either the Overpass API or an extract, depending on the use case. The API would be used, for instance, in the delineation of a river in one case in a Shiny app. Let's try to be flexible and accommodate both options.
Algorithm:
Alternative ways to calculate the distance to the corridor edge:
Buffer, as the crow flies with the given distance
Distance on the network, Manhattan distance
Cost distance calculated on the raster (this comes from the valley delineation)
The combination of the previous two
the closest parallel continuous line of streets (right outside)
Output:
Data:
A corridor boundary polygon
OSM street lines for segmentation
Algorithm:
Use the highest-level transversal streets to cut the corridor resulted from the previous step into segments. What parameter do we need for the size of segments? How to calculate the quality of the results? Maybe calculating some summary stats on the corridor segments (either on morphology or other variables), like surface and confronted wiuth the research question. This can be done in a tutorial as a post-processing use-case-specific step.
Alternative algorithms (to be explored and implemented later):
use a fixed distance along the river for segmentation
use a fixed area or equal areas
Output:
Next we focus on corridor edge delineation using a buffer and sfnetworks. First try the algorithm described above.
Small update for the corridor edge delineation. I have tested the following approach in this notebook:
One option is to start from the intersection of the distance lines and the city boundary as origin and destination and calculate the shortest path that is least deviated from the distance lines. We can use sfnetworks for this.
This works well on one side of the river, but the shortest-path algorithm fails to converge on the other side - needs further investigation. Should maybe test different algorithms and better check the quality of the network (visually it looks fine)..
Thanks for the update @fnattino. This is great and promising, seeing that it already works quite well on one side of the river! I will open a PR with a few suggestions building on what you started.
See #5 for further changes.
The Axwoman tool to extract naturally-continuous structures from street networks seems to be available only as an ArcGIS extension. A different algorithm, called COINS, for the same purposed has been proposed in this article and it is implemented in momepy.
The approach using the shortest-distance path to identify corridor edge boundary works reasonably well for cities whose river is mostly "straight" within the area of interest (e.g. Bucharest and Berlin, but it cannot be easily applied where there are multiple turns (e.g. in Paris, for which reasonable results can be obtained only on smaller bounding boxes).
An approach that determine the corridor edge by minimising the distance of the drawn line on the street network from the initial estimate of the corridor edge (e.g. the buffered waterway) could work in the more difficult cases. We could also considering switching between the two algorithms when the degree of linearity of the river (distance covered / length of the river) falls below a certain threshold.
We also gave it a try to the delineation of segments, based on identifying the crossings of the waterway, and using a modified COINS algorithm to create strokes that would intersects both edges of the river corridor (tried for Bucharest, Berlin, and Paris). The algorithm can be probably improved by simplifying the network edge structure, especially when encountering roundabouts.
@cforgaci explores the use of axwoman for identifying natural roads