The Fastest Way to the Coast
Find out the shortest possible path to get to a point of the US border from each capital of the conterminous US states.
Take the list of capitals.
In[1]:=
capitals =
EntityValue[
EntityClass["AdministrativeDivision", "ContinentalUSStates"],
"CapitalCity"]
Out[1]=
Take the polygon of the US.
In[2]:=
us = EntityValue[Entity["Country", "UnitedStates"], "Polygon"]
Out[2]=
Compute the closest point of the polygon boundary for each respective state capital.
In[3]:=
borderpoints = Flatten[Nearest[First[us], GeoPosition[capitals]]]
Out[3]=
Draw all the geodesic paths.
In[4]:=
GeoGraphics[{us, Point[capitals], Red, Arrowheads[0.015],
Arrow /@ GeoPath /@ Thread[{capitals, borderpoints}]}]
Out[4]=