I want to compare different flight routes to Australia and their lengths. So far I have written:
departure =
Entity["City", {"BuenosAires", "BuenosAires", "Argentina"}];
destination =
Entity["City", {"Perth", "WesternAustralia", "Australia"}];
km =
ToString@QuantityMagnitude@Round@(GeoDistance[departure, destination]) <> " km";
GeoGraphics[
{
{Thick, Red, GeoPath[{departure, destination}]},
Style[Text[km, GeoPosition[destination]], Blue, 14, Bold]
},
GeoCenter -> destination,
GeoProjection -> "Mercator",
GeoRange -> "World",
ImageSize -> 400,
Frame -> True]
My problem: To specify a city with Mathematica I have to include its federal state / administrative division, which, in many cases, I don' t know. So I have to google and manually input it. Since I want to automate the program for other cities the question is:
How can I persuade Mathematica to tell me that Perth, Australia, is part of Western Australia and use this answer as automated input?
InputForm
on the result. $\endgroup$=
you can't append// InputForm
so it becomes a two-step process! $\endgroup$