Closed ateucher closed 5 years ago
Could this be stored as an attribute in the sf object and then we could write an accessor function? That could actually happen pretty easily in collect
I think.
Yeah, that's exactly what I was thinking (add a custom class "sf_bcdc_query"
or something like that?)
Do we need an additional class?
I think so... most sf
objects won't have this attribute, so if someone tries the accessor function on them it would fail in a strange way... thinking something like:
foo <- collect(a_bcdc_promise_object)
class(foo)
#> "sf_bcdc_query" "sf" "tibble" etc
show_query(foo)
#> prints the call to `bcdc_get_query` etc
show_query(another_random_sf_object)
#> "Error: This does not appear to be an object from bcdc_query_geodata, no query available"
Oh i see. The accessor function is show_query
. That is a good path.
Mostly done, but the ability to get the call that you used to get the final
sf
object could be useful. Moving to 0.2.0Originally posted by @ateucher in https://github.com/bcgov/bcdata/issues/39#issuecomment-488798380