2
$\begingroup$

To get the list of counties in the State of Florida, I first evaluate:

EntityClass["AdministrativeDivision", "USCountiesFlorida"]

which gives me a pill-shaped icon with the following text written inside: "US counties in Florida". I then type: FLcounties = EntityList[] and copy-paste the above pill-shaped icon into the square bracket of EntityList[]. Then I evaluate: FLcounties = EntityList["US counties in Florida" icon] which turns into:

FLcounties = EntityList[EntityClass["AdministrativeDivision", "USCountiesFlorida"]]

and I get a list of all 67 counties in Florida.

Next; getting the list of cities in Florida is more straight forward since I only need to evaluate:

FloridaCities = Sort[CityData[{All, "Florida", "United States"}]]

My first question is: what Mathematica command can I use to get the list of cities that belong to each county? Also: I can get a list of bordering counties surrounding each county by evaluating:

floridacountiesAndborderingcounties = {#, AdministrativeDivisionData[#, "BorderingCounties"]} & /@ FLcounties

My second question is: how can I find those cities that are located in more than one county (within Florida)? These are listed in Wikipedia at: List of cities in multiple counties in Florida

For instance: (1.) The city of Fanning Springs is shared by both Gilchrist and Levy counties. (2.) The city of Longboat Key is shared by Manatee and Sarasota counties. etc. Thank you for your help!

$\endgroup$

1 Answer 1

2
$\begingroup$

I get results that differ from wiki:

flcities = CityData[{All, "Florida", "UnitedStates"}];

manycounties = EntityList@FilteredEntityClass[flcities, EntityFunction[c, Length[c["County"]] > 1]];

CommonName[manycounties]
{"Englewood", "Goldenrod", "Citrus Ridge", "Longboat Key", "Flagler Beach", "Fanning Springs"}

Here's the counties and coverage:

Thread[manycounties -> EntityValue[manycounties, "County"]]

enter image description here


As for the 2 cities in the wiki table but not in the above list, I get the following:

However it looks like wiki gets it right for these cities:

marineland = Entity["City", {"Marineland", "Florida", "UnitedStates"}];
flager = Entity["AdministrativeDivision", {"FlaglerCounty", "Florida", "UnitedStates"}];
stjohns = Entity["AdministrativeDivision", {"StJohnsCounty", "Florida", "UnitedStates"}];
GeoGraphics[{
 {GeoStyling[Black], Polygon[marineland]}, 
 {GeoStyling[Opacity[.6]], Red, Polygon[flager]}, 
 {GeoStyling[Opacity[.6]], Blue, Polygon[stjohns]}}, 
 GeoRange -> Polygon[marineland]
]

villages = Entity["City", {"TheVillages", "Florida", "UnitedStates"}];
sumter = Entity["AdministrativeDivision", {"SumterCounty", "Florida", "UnitedStates"}];
lake = Entity["AdministrativeDivision", {"LakeCounty", "Florida", "UnitedStates"}];
marion = Entity["AdministrativeDivision", {"MarionCounty", "Florida", "UnitedStates"}];
GeoGraphics[{
 {GeoStyling[Black], Polygon[villages]}, 
 {GeoStyling[Opacity[.6]], Red, Polygon[sumter]}, 
 {GeoStyling[Opacity[.6]], Blue, Polygon[lake]}}, 
 {GeoStyling[Opacity[.6]], Green, Polygon[marion]}}, 
 GeoRange -> Polygon[villages]
]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.