Open juanfonsecaLS1 opened 2 months ago
I think I found what is happening. The contraction do return the shortest weighted distance and assign it to one of the links, in this case the longest one. I was comparing the unweighted distance.
What was a bit confusing is that dodgr_to_sf
seems to return in some cases the link with the shortest geometry and in others the longest one.
Is there a way to force dodgr_to_sf
to return the 'shortest' geometry?
@juanfonsecaLS1 Good that you resolved that, and that is indeed what i suspected when i read your issue. But your comments nevertheless made me realise that the docs really aren't clear about how this is handled, so i'll keep this issue open until that's been updated and improved. Thanks!
Hi @mpadge, Thanks for your work! I am creating this issue for an unexpected behaviour of the
dodgr_contract
which I believe is linked also tododgr_to_sf
. In the documentation, it is mentioned that:However, I have noticed that in some cases the contraction picks the edges a higher weighted distance. Here is an example
Created on 2024-09-25 with reprex v2.1.1
For some reason, the short section of link (in blue) is not kept after the contraction, but the loop is. Am I missing something?
(I am attaching the file with the network I am using raw_sf.zip)
Thanks again!