If I want to find a list of neighboring countries for a particular list of countries I can do :
counties=EntityList[sovereign states in Europe(countries)];
neighbors = {#,
Intersection[CountryData[#, "BorderingCountries"],
countries]} & /@ countries;
neighbors // TableForm
For example; a list of neighbor countries for Albania is {Greece, Kosovo, Macedonia, Montenegro}.
We can do this because of the above attribute "BorderingCounties" that is available in Mathematica.
Imagine that we want something similar to the above but, using the state of Florida and its counties instead.
The list of counties in the State of Florida is given by :
counties=EntityList[US counties in Florida (administrative divisions)];
If I now want a list of neighbor counties corresponding to each county in the State of Florida; I could try :
countyneighbors = {#,
Intersection[CountryData[#, "BorderingCounties"], counties]} & /@
counties;
but, there is no such attribute "BorderingCounties" built in Mathematica. How an I get around this hurdle?
Thank you!