-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcreate_river_network.R
More file actions
32 lines (27 loc) · 1 KB
/
create_river_network.R
File metadata and controls
32 lines (27 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Create a river network object from flowline shapefiles
# Used in later steps to calculate river distance and snap points to river channel
# library(sf)
# library(riverdist)
#
#
# spatial_dir <- "C:/Users/slafond-hudson/DOI/Loken, Luke C - FLAMeIllinois/SpatialData"
#read in river line shapefile, reproject to UTM, and convert to river network object
projection = "+init=epsg:26915"
IL_network <- line2network(path = file.path(spatial_dir),
layer = "IL_river_flowline",
tolerance = 200,
reproject = projection)
#clean up step: interactive, save output
IL_network_clean <- cleanup(IL_network)
#notes:
#dissolve: y
#Insert vertices: y
#Minimum distance to use: 1
#Please identify segment number: 1
#Please identify vertex number: 540421
#Accept mouth assignment: y
#Remove additional segments: n
#Build segment routes: y
plot(IL_network_clean)
str(IL_network_clean)
saveRDS(IL_network_clean, file=file.path(spatial_dir, 'IL_network.rds'))