ropensci / stplanr

Sustainable transport planning with R
https://docs.ropensci.org/stplanr
Other
417 stars 66 forks source link

Transform projection to WGS84 before routing #474

Closed joeytalbot closed 2 years ago

joeytalbot commented 2 years ago

I was trying to route some Irish data and the routing failed because the projection of the data was EPSG 2157 (Irish Transverse Mercator) rather than EPSG 4326. It would be useful for stplanr to convert projected data to EPSG 4326 (WGS 84) before routing, or at least to give a warning message that mentions the projection.

Robinlovelace commented 2 years ago

Good suggestion. I think a warning is best so the user explicitly changes the CRS rather than it happening behind the scenes. That will reduce the n. lines of code in the fix, make route() easy to maintain and put the onus on the user to understand CRSs in relation to routing services such as CycleStreets.

Robinlovelace commented 2 years ago

Heads-up @joeytalbot I think I've fixed the issue in the commit above. Please can you test it on your data? Will submit the patched version ASAP, which should also close #473.