1
$\begingroup$

I start with:

escambiaFL = Interpreter["USCounty"]["Escambia county"]

Answer: Escambia County, Florida, United States.

Next; evaluate:

AdministrativeDivisionData[escambiaFL, "BorderingCounties"]

Answer:

Baldwin County, Alabama, United States;

Escambia County, Alabama, United States;

Santa Rosa County, Florida, United States.

How can I isolate the bordering counties to Escambia County located in Florida; namely, Santa Rosa County? Unfortunately; "County" is not a known type for "Interpreter", so that I cannot use it in conjunction with "Restricted" to select bordering counties within a state. Thank you!

$\endgroup$
3
  • 7
    $\begingroup$ By the way, unrelated to this question - you have asked 37 questions on this site, many of which have been answered, but you have not marked a single answer as "Accepted". Marking an answer as accepted shows your appreciation for the person who spent time to answer your question (provided their answer did solve your issue). Please make sure to do so by clicking the green check mark next to answers, or to explain why the answers do not solve your problem in a comment on their answer. This helps keep the community going! Thanks! $\endgroup$
    – Carl Lange
    Aug 14, 2019 at 19:43
  • 1
    $\begingroup$ I simply didn't know (until very recently) that the checkmark must be pressed to accept a solution. Notice that for each of those 37 questions, I have always acknowledged and expressed my gratitude to all those helping me. Thank you @Carl Lange for bringing this issue to my attention. I will press the "just do it" checkmark with a lot of gratitude from now on. (:-) $\endgroup$ Aug 16, 2019 at 17:15
  • $\begingroup$ That's no problem, and I'm glad that you find the answers helpful! Hope you have a productive time on the site! $\endgroup$
    – Carl Lange
    Aug 17, 2019 at 0:08

1 Answer 1

4
$\begingroup$

You can simply use Select for this:

Select[AdministrativeDivisionData[escambiaFL, 
  "BorderingCounties"], #["ParentRegion"] == 
   Entity["AdministrativeDivision", {"Florida", "UnitedStates"}] &]

which returns:

{Entity["AdministrativeDivision", {"SantaRosaCounty", "Florida", "UnitedStates"}]}

(that is, a list of all the results within Florida).

You may also be interested in the FilteredEntityClass and EntityFunction functionality that is new in version 12.0.

$\endgroup$
2
  • $\begingroup$ Carl; I accepted your answer; the "Just do it" checkmark turned color from gray to green. Is this what it is supposed to happen? Thanks again! $\endgroup$ Aug 16, 2019 at 17:25
  • $\begingroup$ That's correct! Thank you! $\endgroup$
    – Carl Lange
    Aug 17, 2019 at 0:07

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.