Mathematica Asked on December 11, 2020
I haven’t given up on this problem but not being fluent in the Mathematica Wolfram Language, mainly because I don’t know the commands.
Tia
Assuming the answer to my comment is yes, here is one way to do it
polygonUS = Entity["Country", "UnitedStates"]["Polygon"];
borderPoints = polygonUS[[1, 1, 1]] // Map[GeoPosition];
furthestFrom[city_, borderPoints_] :=
AssociationThread[borderPoints -> Normal@GeoDistance[borderPoints, city]] //
ReverseSort // Take[#, 1] &
london = Entity["City", {"London", "GreaterLondon", "UnitedKingdom"}];
furthest = furthestFrom[london,borderPoints]
<|GeoPosition[{32.5343, -117.124}] -> Quantity[5504.35, "Miles"]|>
furthestPosition = First@Keys@furthest;
furthestCities = GeoNearest["City", furthestPosition, 2]
{Entity["City", {"ImperialBeach", "California", "UnitedStates"}], Entity["City", {"SanDiego", "California", "UnitedStates"}]}
GeoGraphics[{Red, GeoPath[{city, furthestPosition}, "Geodesic"]},
GeoRange -> {{10, 70}, {-120, 10}}]
Answered by Rohit Namjoshi on December 11, 2020
I continued to fiddle around and came up with this, San Francisco is just an example. In this case, it looks like Mahchester, NH is the furthest to San Francisco.
cityCenter = Interpreter["City"]["San Francisco"]
cities = CityData[{Large, "United States"}];
table1 = Table[{cities[[k]],
QuantityMagnitude[TravelDistance[cities[[k]], cityCenter]]}, {k,
Length[cities]}];
First[Sort[table1, #1[[2]] >= #2[[2]] &]]
Answered by Veritas Lux on December 11, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP