You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just an idea for StreamCatTools R package: It would be great if there could be a function that provides some measure of where a sampling point is on the COMID in order to help the user screen for correct COMMID. If the sampling point is at the very US end, maybe the COMID upstream of sampling point COMID is the more appropriate landuse/catchment data to use. Maybe it could be something like distance of the sampling point to the US end of the COMID divided by total length of COMID.
The text was updated successfully, but these errors were encountered:
Wrote this a couple years ago to add the distance from an sf point to the catchment outflow point. I want to say there is an fline upper node as well that could be compared to it instead of having to get the upstream fline. I'd be cautious of comparing this euclidean distance to the fline length though. I haven't dug into the recent release of nhdplusTools, I remember back ~11/2/21 D. Blodgett tweeted something about adding navigation from a point along a network (may or may not relate at all).
distance_catchment_outlet<- function(point, fline) {
#Note: this should only be used on positive pathlength
# point and fline must have matching comid
if(point$comid == fline$comid){
end = get_node(fline, "end")
st_distance(point, end)
} else {
FALSE
#TODO: BREAK LOUDLY
}
}
Thanks Justin - I've been using navigate_nldi from nhdplusTools for other projects - I know Dave has been updating features in nhdplusTools and I added some functionality recently - I'll check and see if specific functionality exists in nhdplusTools already and if not incorporate your suggestion into a package function - thanks!
Suggestion from Leah Ettema:
The text was updated successfully, but these errors were encountered: