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

Distance US / DS along COMID #15

Open
mhweber opened this issue Oct 19, 2021 · 2 comments
Open

Distance US / DS along COMID #15

mhweber opened this issue Oct 19, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@mhweber
Copy link
Collaborator

mhweber commented Oct 19, 2021

Suggestion from Leah Ettema:

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.

@mhweber mhweber added the enhancement New feature or request label Oct 19, 2021
@mhweber mhweber self-assigned this Oct 19, 2021
@jbousquin
Copy link
Contributor

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
  }
}

@mhweber
Copy link
Collaborator Author

mhweber commented Mar 25, 2022

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants