-
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
Extending get_locs() #44
Conversation
This is because in some cases records for the same observation well exist with different statuscodes.
Accomplished by filtering for specific value of fields 'PeilpuntOpenbaarheidTypeCode' and 'PeilpuntOpenbaarheidCode'
This provides 4 approaches to aggregate obswell attributes to the location level, as discussed with @w-jan. See function documentation. Note: the use of window functions with dbplyr 1.4.2 generated a warning (here caused by row_number()), as discussed and solved in tidyverse/dbplyr#328 (merged to dbplyr master). As the fixed dbplyr master is currently not released, and watina depended on an (older) dbplyr fork with pivot_wider, a merge between both is now required. It is provided by https:/florisvdh/dbplyr/tree/dbplyr_with_pivot_wider
- measure filterdepth by the top of the filter - (re)arrange obswells by area_code and loc_code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks very good !
I made an adjustment for the calculation of the filterdepth and to rearrange the locs-table
Thanks @w-jan for the suggestions. I'll work this a bit further out as discussed previous week. Regarding filter depth however, I've searched around to evaluate what would be the best solution.
|
Implemented a few enhancements. Waiting for responses on using |
Thanks @w-jan for discussing this with Piet De Becker. We will use |
filterdepth was originally calculated using the filter bottom, then it was altered (@w-jan) to use the filter top, but eventually we settle using the middle of the filter (well screen).
Going to merge this one for release candidate You see, not everything shuts down these days ... |
@w-jan can you just have a look at the code changes?
This PR (for release candidate 0.3) adds more features to
get_locs()
:filterdepth
):soilsurf_ost
(soil surface in Ostend height CRS),tubelength
,measuringref_ost
(top of tube in Ostend height CRS),obswell_statecode
,obswell_state
,installdate
,stopdate
(the latter two are only kept ifobswells = TRUE
)filterdepth_guess
: try to fill missingfilterdepth
values withtubelength
(as a conservative approach). This is done before applying thefilterdepth_range
conditionobswell_aggr
: to allow for different methods of aggregating observation well attributes per location (3 methods of selecting one well, a fourth method provides the mean values)With thanks to @w-jan for his ideas.