Hello,
I am exploring the function CityData[]. One of the properties available are the coordinates of the city center, given by latitude and longitude. However, I am struggling to perform a simple operation from this data, consisting in checking which cities of a list are inside a circle.
Let me use a simple example:
latlong =
CityData[#, "Coordinates"] & /@
CityData /@ {{"Istanbul", "Istanbul", "Turkey"}, {"Moscow",
"Moscow", "Russia"}, {"London", "GreaterLondon",
"UnitedKingdom"}, {"Berlin", "Berlin", "Germany"}, {"Madrid",
"Madrid", "Spain"}}
Here are the coordinates of some cities. Imagine one wants to draw a circle with center in Madrid and radius defined by the distance between Madrid and Berlin. How can I check which ones of the list are inside and outside that circle?
I have been able to calculate the radius using the function GeoDistance[]:
r = GeoDistance[latlong[[4]], latlong[[5]]]
However, I haven’t been able to complete this operation.
Thanks in advance for any help!