Closed ahermanski closed 3 years ago
Thanks for your comment, @ahermanski. Indeed, this is an issue we noticed before. We are still trying to fix this. I suspect this difference might be caused in part by the fact that the function currently calculates distances in projected shapes with lat log coordinates, so it's not 100% precise. I'm not sure we could improve this by using a utm projection inside the function, @pedro-andrade-inpe . What do you think?
In any case, mind you that the difference between spatial_resolution
and the distance between id
nodes will never come down to zero. This difference will occur when roads have curves with sharp angles.
Hello @ahermanski. In fact, the current version of the function does what is written in its documentation:
This function creates additional points in order to guarantee that two points in a same
trip will have at most a given distance, indicated as a spatial resolution
It does not yet remove points, only adds. If the, let's say, resolution of the original data is already below spatial_resolution
then it will return the same set of points. This was a somewhat strong assumption that we needed to take in order to guarantee processing speed and keep the corners. @rafapereirabr, this behaviour is due to the call to sf::st_segmentize()
.
@rafapereirabr, we have an older version of the algorithm that does something similar, but (i) it uses a temporal resolution, instead of a spatial resolution, (ii) it is slower (I dont' know how much), and (iii) it does not guarantee corners. We can also think in other solutions.
I believe this issue is clarified in the package documentation so we can close this issue.
Gives me this output which has a much higher spatial resolution than I specified but is different than what the standard setting is, so the parameter has to work at least partially.