-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue using get_nhdplushr for a few basins #380
Comments
@dblodgett-usgs Just tried to run with the updated package and I have a new error. This issue likely applies to all of the basins mentioned above but I tested with these basins, and I have the following error message with running "1403" "1405" "1406" "1401" "1402" I also still have the same issue mentioned above with |
I see this -- it is only happening with th 140* ones. There are a bunch of name changes in these nhdplushr VPUs that are really confounding. I'll get a fix up shortly. |
This was actually something different -- good bug to get dealt with! |
latest on github should be good now and I am working on a CRAN release. |
@dblodgett-usgs thank you so much for quickly working on these issues! The issue with
|
@dblodgett-usgs, Actually it seems like there still may be an issue with
|
zip issue is a legit issue with zip::unzip. I'm putting in a try catch to try using utils::unzip as well. In some cases utils::unzip is a problem, but hopefully trying both will get us there! |
CRAN release changes and further fiz for #380
If I run this: library(nhdplusTools)
temp_dir = file.path(nhdplusTools_data_dir(), "temp_hr_cache")
download_dir = download_nhdplushr(temp_dir, c("0512"))
nhdflowline = get_nhdplushr(download_dir, file.path(download_dir, "nhdplus_out.gpkg"),
layers="NHDFlowline",
keep_cols = c("Permanent_Identifier", "REACHCODE", "StreamOrde", "Shape")) in a clean session, I get: > names(nhdflowline$NHDFlowline)
[1] "Permanent_Identifier" "REACHCODE" "StreamOrde" "Shape" Not sure what is going on there, but the current package code seams to be handling that correctly. Zip handling should be better now. I'll leave this open till you've verified. Glad to get these issues ironed out. Thanks! |
@dblodgett-usgs Thanks, the issue without having the Permanent_Identifier column is with the following basins "1403" "1405" "1406" "1401" "1402" "1407" "1408" |
OK, this one is super annoying. Some of the NHDPlusHR VPUs have all lower case attributes and some have the mixed case that you are used to. I'm going to do two things.
|
OK -- give what I just merged a go. I think you should be ok now. |
It seems to be working now, thanks again for working quickly on these updates! |
I'm using the latest nhdplusTools 1.1.0 version and updated all R packages. I've downloaded nhdplusHR data using the
download_nhdplushr()
functionI have the following errors when trying to use
get_nhdplushr()
for the following basins:"0803" "0804" "0805" "0806" "0807"
Error in rbind.data.frame(...) : numbers of columns of arguments do not match
"0108" "0110" "0107"
"0202" "0203" "0204" "0205" "0206" "0207" "0208"
"1403" "1405" "1406" "1401" "1402" "1407" "1408"
Error in select(): ! Can't select columns that don't exist. ✖ Column ReachCode doesn't exist.
This workflow has worked for several other basins
Also, I have the following error using
download_nhdplushr()
function for the following basins:"0512"
Error in zip::unzip(out_file, exdir = out[length(out)]) : zip error: Cannot open zip file \AppData\Roaming\R\data\R\nhdplusTools\temp_hr_cache\05\NHDPLUS_H_0512_HU4_GDB.zip for reading in file zip.c:141
The NHDPLUS_H_0512_HU4_GDB.zip file exist in the directory above, and this function worked for other basins
reproducible workflow
`
temp_dir = file.path(nhdplusTools_data_dir(), "temp_hr_cache")
download_dir = download_nhdplushr(temp_dir, c( "0803","0804","0805","0806","0807"))
nhdflowline = get_nhdplushr(download_dir, file.path(download_dir, "nhdplus_out.gpkg"),
layers="NHDFlowline",
keep_cols = c("Permanent_Identifier", "REACHCODE", "StreamOrde", "Shape"))
`
The text was updated successfully, but these errors were encountered: