Closed joshpersi closed 2 years ago
Not sure, that's a question for the routing engines, cannot think of a solution based on {stplanr} code other than either some code to check if a route strays into unwanted places, calculate the route to an intermediate point inside the wanted polygon, and save the entire route or repeate if it does not work.
Did you figure out a solution @josh-persi ? Apologies for the very slow reply, closing for now but keen to hear how you got on.
Hi everyone,
I'm trying to map a car route from Toronto to Vancouver and unsurprisingly, the shortest route often cuts through the United States. Is there any way I could have the route() function find the shortest route within Canada?
Here is a reproducible example:
Any advice would be much appreciated!
Thanks,
Josh