Geocode


A geocode is a code that represents a geographic entity. It is a unique identifier of the entity, to distinguish it from others of its geocode system. In general the geocode is a human-readable and short identifier.
Typical geocodes and entities represented by it:Country code and subdivision code. Polygon of the administrative boundaries of a country or a subdivision.
The main examples are ISO codes: ISO 3166-1 alpha-2 code, and its subdivision conventions, such as subdivision codes or subdivision codes.DGG cell ID. Identifier of a cell of a discrete global grid: a Geohash code or a Plus Code.Postal code. Polygon of a postal area: a CEP code.
The ISO 19112:2019 standard adopted the term "geographic identifier" instead of geocode, to encompass long labels: spatial reference in the form of a label or code that identifies a location. For example, for ISO, the country [|name] “People's Republic of China” is a label. Some authors, such as the United States Census Bureau, use the abbreviation "GEOID" as a synonym for geocode.
Geocodes are mainly used for labelling, data integrity, geotagging and spatial indexing.
In theoretical computer science a geocode system is a hash function, and, an important class of utilitarian [|geocode systems] is described as a locality-preserving hashing function.

Classification

There are some common aspects of many geocodes that can be used as classification criteria:Ownership: proprietary or free, differing by its licences.Formation: the geocode can be originated from a name or from mathematical function. See geocode system types below.Hierarchy: geocode's syntax hierarchy corresponding to the spatial hierarchy of its represented entities. A geocode system can be hierarchical or non-hierarchical.Covering: global or partial. The entities are in all globe or is delimited the theme or by the ownership's jurisdiction.Type of the represented entity: type of geometry. Point, [|grid] cell or polygon.

System

The set of all geocodes used as unique identifiers of the cells of a full-coverage of the geographic surface, is a geocode system. The syntax and semantic of the geocodes are also components of the system definition:
In general the semantic can be deduced by its formation or encoding/decoding process. Example: each Geohash code can be expressed by a rectangular area in the map, and the rectangle coordinates is obtained by its decoding process.
Many syntax and semantic characteristics are also summarized by classification.

Encode and decode

Any geocode can be translated from a formal expression of the geographical entity, or vice versa, the geocode translated to entity. The first is named encode process, the second decode. The actors and process involved, as defined by OGC, are:
;geocoder: A software agent that transforms the description of a geographic entity, into a normalized data and encodes it as a geocode.
;geocoder service: A geocoder implemented as web service, that accepts a set of geographic entity descriptors as input. The request is "sent" to the Geocoder Service, which processes the request and returns the resulting geocodes. More general services can also return geographic features represented by the geocodes.
;geocoding: Geocoding refers to the assignment of geocodes or coordinates to geographically reference data provided in a textual format. Examples are the two letter country codes and coordinates computed from addresses.
Note: when a physical addressing schemes is expressed in a standardized and simplified way, it can be conceived as geocode. So, the term geocoding sometimes is generalized for geocodes.
In spatial indexing applications the geocode can also be translated between human-readable and internal representations.

Systems of standard [|names]

Geocodes like country codes, city codes, etc. comes from a table of official names, and the corresponding official codes and geometries. "Official" in the context of control and consensus, typically a table controlled by a standards organization or governmental authority. So, the most general case is a table of standard names and the corresponding standard codes.
Strictly speaking, the "name" related to a geocode is a toponym, and the table is the resource for toponym resolution: is the relationship process, usually effectuated by a software agent, between a toponym and "an unambiguous spatial footprint of the same place". Any standardized system of toponym resolution, having codes or encoded abbreviations, can be used as geocode system. The "resolver" agent in this context is also a geocoder.
Sometimes names are translated into numeric codes, to be compact or machine-readable. Since numbers, in this case, are name identifiers, we can consider "numeric names" — so this set of codes will be a kind of "system of standard names".

Hierarchical naming

In the geocode context, space partitioning is the process of dividing a geographical space into two or more disjoint subsets, resulting in a mosaic of subdivisions. Each subdivision can be partitioned again, recursively, resulting in an hierarchical mosaic.
When subdivisions's names are expressed as codes, and code syntax can be decomposed into a parent-child relations, through a well-defined syntactic scheme, the geocode set configures a hierarchical system. A geocode fragment can be an abbreviation, numeric or alphanumeric code.
A popular example is the ISO 3166-2 geocode system, representing country names and the names of respective administrative subdivisions separated by hyphen. For example DE is Germany, a simple geocode, and its subdivisions are DE-BW for Baden-Württemberg, DE-BY for Bayern,..., DE-NW for Nordrhein-Westfalen, etc. The scope is only the first level of the hierarchy. For more levels there are other conventions, like HASC – Hierarchical Administrative Subdivision Codes. The HASC codes are alphabetic and its fragments have constant length. Examples:
Two geocodes of a hierarchical geocode system with same prefix represents different parts of the same location. For instance DE.NW.CE and DE.NW.BN represents geographically interior parts of DE.NW, the common prefix.
Changing the subdivision criteria we can obtain other hierarchical systems. For example, for hydrological criteria there is a geocode system, the US's hydrologic unit code, that is a numeric representation of basin names in a hierarchical syntax schema. For example, the HUC 17 is the identifier of "Pacific Northwest Columbia basin"; HUC 1706 of "Lower Snake basin", a spatial subset of HUC 17 and a superset of 17060102.

Systems of regular grids

[file:Ordnance_Survey_National_Grid.svg|thumb|Each cell of a regular grid is labeled by a geocode. The non-global grids were the most used before the 2000s.
This hierarchical system of local grids, used since the 1930s as British National Grid, generates hierarchical geocodes. Each cell subdivides recurrently its area into a new 10x10 grid.]
Inspired in the classic alphanumeric grids, a discrete global grid is a regular mosaic which covers the entire Earth's surface. The regularity of the mosaic is defined by the use of cells of same shape in all the grid, or "near the same shape and near same area" in a region of interest, like a country.
All cells of the grid have an identifier, and the center of the cell can be used as reference for cell ID conversion into geographical point. When a compact human-readable expression of the cell ID is standardized, it becomes a geocode.
Geocodes of different geocode systems can represent the same position in the globe, with same shape and precision, but differ in string-length, digit-alphabet, separators, etc. Non-global grids also differ by scope, and in general are geometrically optimized for the local use.

Hierarchical grids

Each cell of a grid can be transformed into a new local grid, in a recurring process. In the illustrated example, the cell TQ 2980 is a sub-cell of TQ 29, that is a sub-cell of TQ. A system of geographic regular grid references is the base of a hierarchical geocode system.
Two geocodes of a hierarchical geocode grid system can use the prefix rule: geocodes with same prefix represents different parts of the same broader location. Using again the side illustration: TQ 28 and TQ 61 represents geographically interior parts of TQ, the common prefix.
Hierarchical geocode can be split into keys. The Geohash 6vd23gq is the key q of the cell 6vd23g, that is a cell of 6vd23, and so on, per-digit keys. The OLC 58PJ642P is the key 48 of the cell 58PJ64, that is a cell of 58Q8, and so on, two-digit keys. In the case of OLC there is a second key schema, after the + separator: 58PJ642P+48 is the key 2 of the cell 58PJ642P+4. It uses two key schemas. Some geocodes systems also use initial prefix with non-hierarchical key schema.
In general, as technical and non-compact optional representation, geocode systems also offer the possibility of expressing their cell identifier with a fine-grained schema, by longer path of keys. For example, the Geohash 6vd2, which is a base32 code, can be expanded to base4 0312312002, which is also a schema with per-digit keys. Geometrically, each Geohash cell is a rectangle that subdivides space recurrently into 32 new rectangles, so, base4 subdividing into 4, is the encoding-expansion limit.
The uniformity of shape and area of cells in a grid can be important for other uses, like spatial statistics. There are standard ways to build a grid covering the entire globe with cells of equal area, regular shape and other properties: Discrete Global Grid System is a series of discrete global grids satisfying all standardized requirements defined in 2017 by the OGC.
When human-readable codes obtained from cell identifiers of a DGGS are also standardized, it can be classified as DGGS based geocode system.

Name-and-grid systems

There are also mixed systems, using a syntactical partition, where for example the first part is a name-code and the other part is a grid-code. Example:
For mnemonic coherent semantics, in fine-grained geocode applications, the mixed solutions are most suitable.

Shortening grid-based codes by context

Any geocode system based on regular grid, in general is also a shorter way to express a latitudinal/longitudinal coordinate. But a geocode with more than 6 characters is difficult for remember. On the other hand, a geocode based on standard name is easier to remember.
This suggests that a "mixed code" can solve the problem, reducing the number of characters when a name can be used as the "context" for the grid-based geocode. For example, in a book where the author says "all geocodes here are contextualized by the chapter's city". In the chapter about Paris, where all places have a Geohash with prefix u09, that code can be removed —. For instance Geohash u09tut can be reduced to tut, or, by an explicit code for context "FR-Paris tut". This is only possible when the context resolution is well-known.
In fact a methodology exists for hierarchical grid-based geocodes with non-variable size, where the code prefix describes a broader area, which can be associated with a name. So, it is possible to shorten by replacing the prefix to the associated context. The most usual context is an official name. Examples:
Standards mixedGrid-basedMixed reference
Grid OLC and country's official names796RWF8Q+WFCape Verde, Praia, WF8Q+WF
Grid Geohash and ISO 3166-2 hierarchical abbreviationse6xkbgxedCV-PR, bgxed

The examples of the Mixed reference column are significantly easier than remembering DGG code column. The methods vary, for example OLC can be shortened by elimination of its first four digits and attaching a suitable sufficiently close locality.
When the mixed reference is also short and there are a syntax convention to express it, this convention is generating a new name-and-grid geocode system. This is not the case of the first example because, strictly speaking, "Cape Verde, Praia" is not a code.
To be both, a name-and-grid system and also a mixed reference convention, the system must be reversible. Pure name-and-grid systems, like Mapcode, with no way to transform it into a global code, is not a mixed reference, because there is no algorithm to transform the mixed geocode into a grid-based geocode.

Cataloged examples

In use, general scope

Geocodes in use and with general scope:
GeocodeInceptionCoverageFormationOwnershipRep. entityContext and description-
ISO 3166 1974globe/only nationsName abbreviationfreepolygonAdministrative divisions. Country codes and codes of their subdivisions. Two letters or three letters.-
ISO 3166-1 numeric1970globe/only nationsSerial numberfreepolygonAdministrative divisions. Country codes expressed by serial numbers.-
UN M.49~1970globe/only nationsSerial numberfreepolygonAdministrative divisions. region codes, area code, continents, countries.-
Geohash2008globeencodefreegrid cellHash notation for locations. See also Geohash and its variants, like OpenStreetMap's short-link-
Open Location Code 2014globeencodefreegrid cellSee also PlusCodes.-
What3words2013globeencodepatentedgrid cellpatent-restrictions system, converts 3x3 meter squares into 3 words. It is in use at Mongol Post.-
Mapcode2001globeencodepatentedpointA mapcode is a code consisting of two groups of letters and digits, separated by a dot.-
Geopeg2020globe/only nationsencodeopen standardgrid cellGeopeg is word-based GPS address, using simple words like London.RedFish. It is a combination of a city and two simple words. It is an open standard geocoding of Earth, currently in development.

In use, alternative address

Geocodes can be used in place of official street names and/or house numbers, particularly when a given location has not been assigned an address by authorities. They can also be used as an "alternative address" if it can be converted to a Geo URI. Even if the geocode is not the official designation for a location, it can be used as a "local standard" to allow homes to receive deliveries, access emergency services, register to vote, etc.
GeocodeInceptionCoverageFormationOwnershipRep. entityContext and description
Local OLC 2016globeencodefreegrid cellOLC is used to provide postal services.
Eircode 2014Irelandencodecopyrightedgrid cellIt is used officially as alternative address and as postal code. Limited database and algorithm access. It is a kind of fine-grained postal code.

In use, postal codes

Geocodes in use, as postal codes. A geocode recognized by Universal Postal Union and adopted as "official postal code" by a country, is also a valid postal code. Not all postal codes are geographic, and for some postal code systems, there are codes that are not geocodes. Samples, not a complete list:
GeocodeInceptionCoverageFormationOwnershipRep. entityContext and description
CEP 1970?cities or streetsHierarchical serial numberproprietary... The CEP5 is geographic and CEP8 can be a city, a street or a point.
Postal Index Number ?postal regionsHierarchical serial number?proprietary?...
ZIP Code ?postal regionsHierarchical serial number?proprietary?...

In use, telephony and radio

Geocodes in use for telephony or radio broadcasting scope:

In use, others

Geocodes in use and with specific scope:
GeocodeInceptionScopeCoverageFormationOwnershipRep. entityContext and description
ONS code2001UK onlyUK/themesSerial numberfreepolygonAdministrative divisions. Geographical areas of the UK, for use in tabulating census.
NUTS area code2003EU onlyEuropeHierarchicalfreepolygonAdministrative divisions. Partially administrative, worldwide and Europe
MARC country codes1971USA only?globe/only nationsName abbreviationfreepolygonAdministrative divisions. Country codes.
SGC codes?Canada only?Serial numberfreepolygonAdministrative divisions, numeric codes.... Statistical, like ONS.
UN/LOCODE?trade and transportglobeSerial numberfreepolygonAdministrative divisions. UN codes for trade and transport locations.
IATA airport codes1930sairportglobe?freepolygonAdministrative divisions. area /point codes, airports and 3-letter city codes
ICAO airport codes1950sairportglobe?freepolygonAdministrative divisions.area /point codes, airports
IANA country codes1994Internetglobe?freepolygonAdministrative divisions. Similar to ISO 3166-1 alpha-2, see Country code top-level domain, List and Internationalized country codes.
IOC country codes~1960SportglobeabbreviationfreepolygonAdministrative divisions. Codes of IOC members; uses three-letter abbreviation country codes, like ISO 3166-1 alpha-3.
Longhurst code?Environmentglobe?freepolygonAdministrative divisions. A set of four-letter codes used in ecological/geographic regions in oceanography.
FIFA country code?sport/footballglobal?freepolygonAdministrative divisions.
FIPS country codes1994?scopeU.S.?freepolygonAdministrative divisions. area code.
FIPS place codes?U.S.place?freepolygon. Administrative divisions.
FIPS country codes?U.S.globe/nations?freepolygon. Administrative divisions
FIPS state codes?U.S.??freepolygon. Administrative divisions

Historical or less widely used

GeocodeInceptionScopeCoverageFormationOwnershipRep. entityContext and description
HASC?generalnations and subdivs.Name abbreviationfreepolygonAdministrative divisions. HASC stands "Hierarchical Administrative Subdivision Codes".
UTM Zone?general??freegrid cell?
UTM Grid Zones?general??freegrid cellbased on UTM Zones, and Latitude bands of MGRS..
WMO squares~2005?Meteorologyglobegridfreegrid cell... replaced by modern DGGS's...
C-squares2002generalglobe?freegrid cellcompact encoding of geographic coordinate bounds. Uses WMO squares as starting point for hierarchical subdivision.
GEOREF?general??freepolygonWorld Geographic Reference System, a military / air navigation coordinate system for point and area identification
GARS~2007?general??freepolygonreference system developed by the National Geospatial-Intelligence Agency
MGRS~1960sgeneral??freegrid cellMilitary Grid Reference System. Derived from UTM and UPS grids by NATO with a unique naming convention.

Other examples

Other geocodes:S2: a geocoding scheme using spherical geometry and the space-filling Hilbert curve, developed at GoogleH3: Hexagonal Hierarchical Spatial Index a geocoding scheme initially developed at Uber source code available and documented at h3geo Munich Orientation Convention: converts lat/lon to metrical monopolar codes for targets, crossings, stations, stop points, bridges, tunnels, towns, islands, volcanoes, highway exits etc.SALB, by UN

Other standards

Some standards and name servers include: ISO 3166, FIPS, INSEE, Geonames, IATA and ICAO.
A number of commercial solutions have also been proposed:
  • WOEID is a unique 32-bit reference identifier that identifies any feature on Earth.
  • NAC Locator provides a universal geocoding address for all locations on the planet.