-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
nhdplus flowline traversal blocked by virtual stream segments #42
Comments
@rainshapes can you diagnose? This is not intended operation, but may be an artifact in dealing with the different dataset structures. |
Should be solved in #45 |
Hmm, the example I linked above gives me an error now for both nhdplus and nhdh:
I already rolled my own traversal code for my use case so I'm afraid I will not do much more to diagnose. |
Got it. For future reference. This is fixed. Reproducible with this code. library(hydrolinks)
library(purrr)
library(magrittr)
wb_coords <- c(44.00467, -88.43445)
dset <- "nhdh"
wb_id <- link_to_waterbodies(wb_coords[1], wb_coords[2],
1, dataset = dset) %>%
purrr::when(any(names(.) %in% "comid")
~ .$comid,
~.$permanent_)
nhd_wb <- get_shape_by_id(wb_id, feature_type = "waterbody", dataset = dset)
f_lines <- traverse_flowlines(max_distance = 50, direction = "in",
start = wb_id,
dataset = dset, md5check = FALSE) %>%
purrr::when(any(names(.) %in% "comid")
~ .$comid,
~.$permanent_)
upstream_shp <- get_shape_by_id(f_lines, dataset = dset,
feature_type = "flowline")
upstream_wb <- get_shape_by_id(f_lines, dataset = dset,
feature_type = "waterbody")
plot(upstream_shp$geometry)
plot(upstream_wb$geometry, add=TRUE, col='dodgerblue')
plot(nhd_wb$geometry, add = TRUE)
dset <- "nhdplusv2"
wb_id <- link_to_waterbodies(wb_coords[1], wb_coords[2],
1, dataset = dset) %>%
purrr::when(any(names(.) %in% "comid")
~ .$comid,
~.$permanent_)
nhd_wb <- get_shape_by_id(wb_id, feature_type = "waterbody", dataset = dset)
f_lines <- traverse_flowlines(max_distance = 50, direction = "in",
start = wb_id,
dataset = dset, md5check = FALSE) %>%
purrr::when(any(names(.) %in% "comid")
~ .$comid,
~.$permanent_)
upstream_shp <- get_shape_by_id(f_lines, dataset = dset,
feature_type = "flowline")
upstream_wb <- get_shape_by_id(f_lines, dataset = dset,
feature_type = "waterbody")
plot(upstream_shp$geometry)
plot(upstream_wb$geometry, add=TRUE, col='dodgerblue')
plot(nhd_wb$geometry, add = TRUE, col='dodgerblue')
|
It looks to me like
traverse_flowlines
using nhdplusv2 does not travel on virtual stream segments while nhdh does travel on them. Specifically, nhdh traverses through wb155442272
while nhdplusv2 does not travel through (the equivalent) wb6863055
.Is this intended?
Compare the two chunks below:
setup
traverse nhd hi-res
traverse nhdplus
The text was updated successfully, but these errors were encountered: