Find all segments ID upstream
Source:R/TNETutils_findUpstreamSegment.R
TNETutils_findUpstreamSegment.Rd
Will find every ID of all segments upstream of the segment selected
Examples
# Read exemple shapefile
shape_name <- system.file("extdata","TestNetwork_Ardiere.shp", package = "TnetRUI")
shape_data <- st_read(shape_name)
#> Reading layer `TestNetwork_Ardiere' from data source
#> `/tmp/RtmpqHmM8B/temp_libpath18dad4d144539/TnetRUI/extdata/TestNetwork_Ardiere.shp'
#> using driver `ESRI Shapefile'
#> Simple feature collection with 121 features and 65 fields
#> Geometry type: LINESTRING
#> Dimension: XY
#> Bounding box: xmin: 814849.3 ymin: 6559414 xmax: 824534.9 ymax: 6568750
#> Projected CRS: RGF93 v1 / Lambert-93
# found all IDs upstream of the segment 1671262
ID_found <- TNETutils_findUpstreamSegment(segments = shape_data, ID=1671262)
ID_found
#> [1] 167126203 167126202 167126201