Closed diegoteca closed 3 months ago
H @diegoteca, thank you for already thinking deeply about this issue. And yes, you are right that this is "by design". The main problem is that storing as sf
requires stripping out a lot of important information, so any routing queries with sf
-format data are only approximations of more accurate SC versions. Given that, I decided that isovert/isochrone algorithms would only be implemented for SC, because the sf values would be too unreliable.
It would be great to have that table somewhere in the documentation. If you see a good place for it, please feel most welcome to submit a pull request.
Hi Mark!
Thanks for you quick reply!
I will think where we could put the table. Maybe into the "Important note" section of Readme? Perhaps with one paragraph about this is enough. Or maybe make a new vignette for this specific problem about the input (sf or sc) of some functions?
On the other hand, if the reason of the sf/sc formats inputs in each function is "by design", I think that is convenient previously edit the documentation of each function. More concrete, in the Roxygen comments about "@param graph" because is that not match very good with the real behaviour. I can do that in the next days.
In this case, after this changes and, regardless of where could go the table, we could updates the table's content. So, the table's content would look some like this:
Function | Documentation says | Real behavior |
---|---|---|
dodgr_dists | data.frame or equivalent object representing the network graph (see Notes) | Work with SF and SC format |
dodgr_times | data.frame or equivalent object representing the network graph (see Notes) | Work with SF and SC format |
dodgr_isodists | data.frame or equivalent object representing the network graph (see Notes) | Work with SF and SC format |
dodgr_ isochrones | A dodgr network returned from the weight_streetnet function using a network obtained with the osmdata osmdata_sc function, possibly contracted with dodgr_contract_graph. | Work only with SC format |
dodgr_isoverts | A dodgr network returned from the weight_streetnet function using a network obtained with the osmdata osmdata_sc function, possibly contracted with dodgr_contract_graph. | Work only with SC format |
That sounds great Diego, thanks. Updating the param descriptions could be a little tricky, as a lot of those are inherited (that is, filled via ˋ@inheritParamsˋ hooks). Feel free to have a go updating those if you like, otherwise i'll get on to it as soon as i can.
Hi Mark!
I don't have much experience with Roxygen2 ecosystem (specific with '@inheritParams' hooks) and perhaps I will generate more crash than benefits with my pull request.
In this case, I consider that if you could make this change (of course, when you can) is will be better for all.
Thanks for this great package!
Hi Mark,
I have a specific problem/doubt with _dodgrisoverts function, and I don't know if it is documentation error, or it is one desired effect by design. However, this doubt can extrapolate for other functions too.
Is it possible run the function _dodgrisoverts with a data_frame or sf object as input? If one read the documentation of this function it says “graph = data.frame or equivalent object representing the network graph (see Notes)” but when I run the code with hampi data (see reprex below) I receive this message:
Error in dodgr_isoverts(graph, from = from, dlim) : “isoverts can only be calculated from SC-class networks generated by osmdata_sc.”
For my particular case, I’m interested in use _dodgrisoverts with “dlim” argument (and not primarily the “tlim” argument). I highlight this difference because _dodgrisochrones at this moment don’t work with sf_format so I could expect that _dodgrisoverts with “tlim” doesn't work either. Instead, _dodgrisodists works with sf_format so I could expect than _dodgr_isovert_s whith “dlim” work with sf_format.
More general, I created this table for summary what documentation says about diferents functions and what is the behavior in the reprex with hampi's data.
Created on 2023-12-12 with reprex v2.0.2