DOI-USGS/nhdplusTools

get_raindrop_trace returns internal server 500 error

Closed this issue · 7 comments

I am unable to use the get_raindrop_trace() function. I am trying to get the nearest flowline to USGS gages that do not fall on a flowline, due to location discrepancies between the USGS site metadata and the NHDplus flowlines.

reprex:

point = list(featureSource = "nwissite", featureID = "USGS-15484000") |>
  get_nldi_feature()

get_raindrop_trace(point)

## Request failed [500]. Retrying in 1.8 seconds...
## Request failed [500]. Retrying in 1 seconds...
## Error calling processing service. 
##  Original error:
## Error in doTryCatch(return(expr), name, parentenv, handler): Internal Server Error

The end goal is to snap the gage location to the nearest flowline, and then use get_split_catchment() to get the drainage area associated with the gage. I actually need to do this for a large number of gages (potentially thousands), so let me know if there is a better way accomplish this.

Hi @mkoohafkan -- unfortunately, if your nwissite doesn't fall within the NHDPlusV2 domain, this functionality won't work.

Ah I see. Is there no equivalent method for the NHDPlus HR domain?

No, not really. Looks like you are in AK, -- NHDPlusHR doesn't exist there either -- so it's doubly problematic. There's very little elevation data that works for catchment delineation or raindrop trace applications in Alaska unfortunately.

hmm, that's strange---for this location there are flowlines (GNIS_ID 01408991) and delineated catchments (NHDPlusID 75024900000247) in the NHDPlus HR geodatabase (NetworkNHDFlowline and NHDPlusCatchment layers, respectively).

While the raindrop trace and split catchment features would be nice, it would be fine for my use case to just grab the catchment containing my gage and all upstream catchments. Can this be accomplished with hydroloom/nhdplusTools?

Oh -- I see. Sorry, I didn't realize there was as much NHDPlusHR in Alaska as there is.

Yes, you should be able to use hydroloom to do network navigations on the NHDPlusHR network and union catchments together to create basins.

https://doi-usgs.github.io/nhdplusTools/articles/nhdplushr.html
https://doi-usgs.github.io/hydroloom/articles/network_navigation.html

Should be good resources.

https://doi-usgs.github.io/hydroloom/reference/navigate_hydro_network.html should work with nhdplushr out of the box.

Thanks, I think I have an alternative solution working now thanks to your links. Not sure what level of control you have over this, but it would be helpful if the function could differentiate between error due to being outside the domain vs other errors/network connection issues.

I agree -- that would be very helpful. I'll leave this issue open and see if I can improve it in the future. Thanks for your patience and perseverance.