-
Notifications
You must be signed in to change notification settings - Fork 0
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
blue_line_key_to_watershed() can error when too close to mouth #16
Comments
I think this issue in fwapg is looking at this: smnorris/fwapg#7 |
I dont think we can glean any more information from the error itself that would specifically point to this issue, but we could add a general rule that if downstream_route_measure = 0 and API error, then make suggestion to move it a few meters |
That seems like a good option |
This suggestion actually turns out to be annoying and I now think we should just go back to the raw error. |
Also for consistency across the interface. |
maybe I'm over reacting to this - I'll think on it |
I have noticed that measures of 0 are more likely to fail but didn't bother looking into it. Just because requesting a watershed measure 0 does not actually require all the fancy logic that watershed_at_measure provides - for my tools I can just ask the db for the source watershed polygons upstream of that location. Definitely worth debugging, it is probably just a precision issue somewhere. I think fwapg # 7 is more of a specific case, but it may well be related. |
Actually, smnorris/fwapg#7 is unrelated. That one is likely more of a pain to resolve. |
Also, regarding this:
fwapg doesn't use the DEM anywhere - you'll get funny results in some flat areas but that is mostly based on the FWA polygons your point of interest falls in. I need to put together a document/presentation on how watershed_at_measure works |
@smnorris - it would be great to resolve because watershed area for a given point is so useful for modelling fish densities |
@smnorris - have you had a change to document how watershed_at_measure works - is it based off of the stream network segments? |
No, not yet. Probably not till January, I'm swamped. Hope this helps - take a look at |
Thanks @smnorris - this is really helpful! |
Hi @smnorris - I've put together the following documentation for the R function. Can you confirm the order of the if else statements (or does placement on a polygon river/canal) override 1 and 2? And can you provide a little more detail on what happens to the fundamental watershed in number 4? #' 1. If the point is < 50 m upstream from the bottom of the fundamental
#' watershed then it is included in the aggregation (recorded as KEEP in the
#' refine_method property).
#'
#' 2. Else if the point is < 100m downstream from the top of the fundamental
#' watershed then it is not included in the aggregation (recorded as DROP in the
#' refine_method property).
#'
#' 3. Else if the point is on a polygonal river/canal the fundamental watershed is
#' cut across the banks of the river before being included in the aggregation
#' (recorded as CUT in the refine_method property).
#'
#' 4. Otherwise something else happens (recorded as DEM in the refine_method
#' property). |
That order is not quite right - but I had to refer to the postgres manual to check, it isn't very clear in the script. The first statement that returns true in the
|
For 4, postprocessing of the fundamental watershed intersecting the point was required for the job that the script was built for. When just using |
There is also one initial check, if the point is in a lake, return watershed of everything draining into that lake. #' 1. If the point is within a lake, return everything upstream of the lake's outflow |
Presumably because too flat to work out watershed. Could deal with with more informative error message ie suggestion to increase distance from mouth.
The text was updated successfully, but these errors were encountered: