Skip to article frontmatterSkip to article content

County Lookup Tools

import morpc

Region definitions

The following lists represent various definitions for “Central Ohio” based on collections of counties.

for name in morpc.CONST_REGIONS.keys():
    print("Region name: {}".format(name))
    print("Counties in region: {}\n".format(morpc.CONST_REGIONS[name]))
Region name: REGION7
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union']

Region name: 7-County Region
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union']

Region name: REGION10
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Knox', 'Marion', 'Morrow']

Region name: 10-County Region
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Knox', 'Marion', 'Morrow']

Region name: REGION15
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Knox', 'Marion', 'Morrow', 'Fayette', 'Hocking', 'Logan', 'Perry', 'Ross']

Region name: 15-County Region
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Knox', 'Marion', 'Morrow', 'Fayette', 'Hocking', 'Logan', 'Perry', 'Ross']

Region name: REGIONCORPO
Counties in region: ['Fairfield', 'Knox', 'Madison', 'Marion', 'Morrow', 'Pickaway', 'Union']

Region name: CORPO Region
Counties in region: ['Fairfield', 'Knox', 'Madison', 'Marion', 'Morrow', 'Pickaway', 'Union']

Region name: REGIONONECBUS
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Knox', 'Marion', 'Morrow', 'Logan']

Region name: OneColumbus Region
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Knox', 'Marion', 'Morrow', 'Logan']

Region name: REGIONCEDS
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Knox', 'Marion', 'Morrow', 'Logan']

Region name: CEDS Region
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Knox', 'Marion', 'Morrow', 'Logan']

Region name: REGIONMSA
Counties in region: ['Delaware', 'Fairfield', 'Franklin', 'Licking', 'Madison', 'Pickaway', 'Union', 'Hocking', 'Morrow', 'Perry']

County three-letter abbreviations

Map each MORPC county name to its three-letter abbreviation.

morpc.CONST_COUNTY_ABBREV
{'Delaware': 'DEL', 'Fairfield': 'FAI', 'Fayette': 'FAY', 'Franklin': 'FRA', 'Hocking': 'HOC', 'Knox': 'KNO', 'Licking': 'LIC', 'Logan': 'LOG', 'Madison': 'MAD', 'Marion': 'MAR', 'Morrow': 'MRW', 'Perry': 'PER', 'Pickaway': 'PIC', 'Ross': 'ROS', 'Union': 'UNI'}

Map each three-letter abbreviation back to its county name.

morpc.CONST_COUNTY_EXPAND
{'DEL': 'Delaware', 'FAI': 'Fairfield', 'FAY': 'Fayette', 'FRA': 'Franklin', 'HOC': 'Hocking', 'KNO': 'Knox', 'LIC': 'Licking', 'LOG': 'Logan', 'MAD': 'Madison', 'MAR': 'Marion', 'MRW': 'Morrow', 'PER': 'Perry', 'PIC': 'Pickaway', 'ROS': 'Ross', 'UNI': 'Union'}

Note that ‘MRW’ is the three-letter abbreviation for Morrow county that is used by ODOT. Sometimes it may be desired to use ‘MOR’ instead. In that case, you can use the following code to update both mappings.

morpc.CONST_COUNTY_ABBREV["Morrow"] = 'MOR'
morpc.CONST_COUNTY_EXPAND = {value: key for key, value in morpc.CONST_COUNTY_ABBREV.items()}

Now you can see the new mappings:

print(morpc.CONST_COUNTY_ABBREV["Morrow"])
print(morpc.CONST_COUNTY_EXPAND["MOR"])
MOR
Morrow

To revert to the old mapping you can either use a code block similar to the one above, or simply reload the library:

import importlib
importlib.reload(morpc)

Now the original mappings are restored.

print(morpc.CONST_COUNTY_ABBREV["Morrow"])
print(morpc.CONST_COUNTY_EXPAND["MRW"])
MOR
Morrow

County identifiers (GEOID)

Map each MORPC county name to its five-character Census GEOID. Note that the IDs are strings. They are not integers and should not be handled as such.

morpc.CONST_COUNTY_NAME_TO_ID
{'Delaware': '39041', 'Fairfield': '39045', 'Fayette': '39047', 'Franklin': '39049', 'Hocking': '39073', 'Knox': '39083', 'Licking': '39089', 'Logan': '39091', 'Madison': '39097', 'Marion': '39101', 'Morrow': '39117', 'Perry': '39127', 'Pickaway': '39129', 'Ross': '39141', 'Union': '39159'}

Map each GEOID back to its county name.

morpc.CONST_COUNTY_ID_TO_NAME
{'39041': 'Delaware', '39045': 'Fairfield', '39047': 'Fayette', '39049': 'Franklin', '39073': 'Hocking', '39083': 'Knox', '39089': 'Licking', '39091': 'Logan', '39097': 'Madison', '39101': 'Marion', '39117': 'Morrow', '39127': 'Perry', '39129': 'Pickaway', '39141': 'Ross', '39159': 'Union'}

Summary level identifiers.

Summary level lookups for geographic jurisdictions. The summary levels include the Census sumlevel numbers, as well as some morpc summary levels, beginning with “M”

morpc.SUMLEVEL_LOOKUP
{'US': '010', 'CENSUSREGION': '020', 'DIVISION': '030', 'STATE': '040', 'COUNTY': '050', 'COUNTY-COUSUB': '060', 'COUNTY-TOWNSHIP-REMAINDER': '070', 'COUNTY-TRACT': '140', 'COUNTY-TRACT-BG': '150', 'PLACE-COUNTY': '155', 'PLACE': '160', 'CBSA': '310', 'URBANAREA': '400', 'CONGRESS': '500', 'STATESENATE': '610', 'STATEHOUSE': '620', 'COUNTY-TRACT-BG-BLOCK': '750', 'PUMA': '795', 'ZCTA3': '850', 'ZCTA5': '860', 'CENSUSMPOREGION': '930', 'SDELEM': '950', 'SDHIGH': '960', 'SDUNIFIED': '970', 'REGION15': 'M01', 'REGION10': 'M02', 'REGION7': 'M03', 'REGIONCORPO': 'M04', 'REGIONCEDS': 'M05', 'REGIONMPO': 'M06', 'REGIONTDM': 'M07', 'REGIONONECBUS': 'M08', 'JURIS': 'M10', 'JURIS-COUNTY': 'M11', 'COUNTY-TAZ': 'M20', 'COUNTY-TAZ-MAZ': 'M21', 'COUNTY-TAZ-MAZ-GRIDMAZ': 'M22'}
morpc.HIERARCHY_STRING_LOOKUP
{'010': 'US', '020': 'CENSUSREGION', '030': 'DIVISION', '040': 'STATE', '050': 'COUNTY', '060': 'COUNTY-COUSUB', '070': 'COUNTY-TOWNSHIP-REMAINDER', '140': 'COUNTY-TRACT', '150': 'COUNTY-TRACT-BG', '155': 'PLACE-COUNTY', '160': 'PLACE', '310': 'CBSA', '400': 'URBANAREA', '500': 'CONGRESS', '610': 'STATESENATE', '620': 'STATEHOUSE', '750': 'COUNTY-TRACT-BG-BLOCK', '795': 'PUMA', '850': 'ZCTA3', '860': 'ZCTA5', '930': 'CENSUSMPOREGION', '950': 'SDELEM', '960': 'SDHIGH', '970': 'SDUNIFIED', 'M01': 'REGION15', 'M02': 'REGION10', 'M03': 'REGION7', 'M04': 'REGIONCORPO', 'M05': 'REGIONCEDS', 'M06': 'REGIONMPO', 'M07': 'REGIONTDM', 'M08': 'REGIONONECBUS', 'M10': 'JURIS', 'M11': 'JURIS-COUNTY', 'M20': 'COUNTY-TAZ', 'M21': 'COUNTY-TAZ-MAZ', 'M22': 'COUNTY-TAZ-MAZ-GRIDMAZ'}

countyLookup() Class

List counties and convert between county names and codes (Central Ohio, Ohio, or U.S.)

The library includes a Python class called countyLookup. Upon instantiation, this object is pre-loaded with a dataframe describing a set of counties whose scope is specified by the user. The object includes methods for listing the counties by their names or GEOIDs and for two-way conversion between name and GEOID.

  • scope="morpc" Default. Loads only the counties in the MORPC 15-county region (see CONST_REGIONS['15-County Region'] above)
  • scope="corpo" Loads only the counties in the CORPO region (see CONST_REGIONS['CORPO Region'] above)
  • scope="ohio" Loads all counties in Ohio
  • scope="us" Loads all counties in the United States

NOTE: As of Jan 2024, some methods are not supported for scope=“us”. See details below.

You can create an object containing the MORPC 15 counties as follows:

countyLookup = morpc.countyLookup()
Loading data for MORPC 15-County region only

Or if you prefer to be explicit:

countyLookup = morpc.countyLookup(scope="morpc")
Loading data for MORPC 15-County region only

Either way, the object is populated with the following dataframe.

countyLookup.df
Loading...

You can create a list of the names of the counties:

countyLookup.list_names()
['Delaware', 'Fairfield', 'Fayette', 'Franklin', 'Hocking', 'Knox', 'Licking', 'Logan', 'Madison', 'Marion', 'Morrow', 'Perry', 'Pickaway', 'Ross', 'Union']

Or list their IDs:

countyLookup.list_ids()
['39041', '39045', '39047', '39049', '39073', '39083', '39089', '39091', '39097', '39101', '39117', '39127', '39129', '39141', '39159']

You can also look up the ID for a county given its name.

countyLookup.get_id("Hocking")
'39073'

Or look up its name given its ID.

countyLookup.get_name("39091")
'Logan'