Skip to content
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

get_nhdplus throwing an error - crs #361

Closed
lucyrandrews opened this issue Oct 9, 2023 · 1 comment
Closed

get_nhdplus throwing an error - crs #361

lucyrandrews opened this issue Oct 9, 2023 · 1 comment

Comments

@lucyrandrews
Copy link

Hello -

Thanks for hosting this package and developing new hydrofabric tools. I'm running into a weird, new issue getting NHDPlusV2 data that I'm having trouble fully tracing, explaining, or remedying.

huc02 <- nhdplusTools::get_huc(id = 18, type = "huc02")

fl <- nhdplusTools::get_nhdplus(AOI = huc02, realization = "flowline")

The get_nhdplus call returns an error (Getting tile is printed for tiles 2-29 too but not necessary here):

Getting tile 30 of 30
Error: arguments have different crs
Spherical geometry (s2) switched on

I've had no issue with this call in the past. This error doesn't show up with an AOI-based call to get HUCs - this works fine:

huc04 <- nhdplusTools::get_huc(AOI = huc02, type = "huc04")

The error message seems to come from sf::chk_equal_crs (called in sf::rbind.sf?). I've recently updated relevant packages and my operating system - here's relevant session info:

version  R version 4.3.1 (2023-06-16)
os       macOS Sonoma 14.0
rstudio  2023.09.0+463 Desert Sunflower (desktop)

hydroloom      1.0.0    2023-10-05 [1] Github (doi-usgs/hydroloom@286c61f)
nhdplusTools   1.0.0    2023-10-02 [1] CRAN (R 4.3.1)
sf             1.0-14   2023-07-11 [1] CRAN (R 4.3.0)

Can you reproduce this on your end?

@dblodgett-usgs
Copy link
Collaborator

I am able to reproduce and narrowed this down to a couple of 0-row tables in the set of downloaded tables. I should have a fix up soon.

dblodgett-usgs added a commit to dblodgett-usgs/nhdplusTools that referenced this issue Oct 9, 2023
dblodgett-usgs added a commit to dblodgett-usgs/nhdplusTools that referenced this issue Oct 9, 2023
dblodgett-usgs added a commit that referenced this issue Oct 10, 2023
remove web responses with 0 rows - fixes #361
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants