Skip to content

Shared Political Geography

jamesturk edited this page Mar 22, 2013 · 24 revisions

Principles

  • IDs should be somewhat predictable and globally unique.
  • Geographic IDs should not be dependent upon temporal changes to geographies.
  • IDs should not attempt to capture the full hierarchy of all entities, but enough to be uniquely descriptive. (e.g. If there are school districts at the county and city level, county & city are important disambiguators and should be included in the identifier)

ID Format

IDs are in the format <prefix>:country-<country_code>[:<type>-<type_id>]+

prefix

The proposed prefix is ocd:location (with the understanding that other id formats will use ocd:person, ocd:organization, etc.)

country_code

ISO-3166-1 alpha-2 code for country

type

A type of boundary (e.g. 'country', 'state', 'town', 'city', 'cd', 'sldl', 'sldu') As work progresses a list of possible types will be curated, but type is mostly open-ended.

Types should be comprised entirely of lower case letters [a-z]{2,}

type_id

A unique identifier for the entity at this level.

Valid Characters are lower case letters, numerals 0-9, period (.), dash(-), underscore (_), and tilde (~).

  • Spaces should be converted to underscores or dropped.
  • Special/punctuation characters (other than period and dash) should be converted to ~ or dropped.
  • Leading zeros should always be dropped.

Assignment

  • Whenever possible, all geographic ids of a given type should be defined at a same time, for example all state geographies should be defined up front. Similarly, all cities within North Carolina should be defined at once to avoid accidentally choosing a conflicting name.
  • If an set of commonly accepted identifiers for a type already exists (such as postal code for US states) it should be used. Numeric ids (such as county FIPS codes) should not be used if textual names are clear and unambiguous, but may be appended to help resolve ambiguities.
  • Every attempt should be made not to grow the set of types unnecessarily. A list of existing types should be published and new ids not using one of the defined types should be appropriately justified.

Examples

  • United States
    • ocd:location:country-us
  • North Carolina
    • ocd:location:country-us:state-nc
  • North Carolina 2nd Congressional District
    • ocd:location:country-us:state-nc:cd-2
  • North Carolina State Lower Legislative District 1
    • ocd:location:country-us:state-nc:sldl-1
  • Wake County, North Carolina
    • ocd:location:country-us:state-nc:county-wake
  • Cary, North Carolina (note that despite being within Wake County this is not indicated due to not being an identifying feature)
    • ocd:location:country-us:state-nc:town-cary
  • Kildare Farms Homeowners Association, Cary, North Carolina
    • ocd:location:country-us:state-nc:town-cary:hoa-kildarefarms
  • Washington DC, Ward 8
    • ocd:location:country-us:district-dc:ward-8
  • Washington DC, ANC 4A
    • ocd:location:country-us:district-dc:anc-4a
  • Washington DC, ANC 4A, section 08 note: this is a strict subset of the ANC for purposes of representation
    • ocd:location:country-us:district-dc:anc-4a:section-8
Clone this wiki locally