A geocode or geographic identifier (sometimes shortened as geo ID) is a code or unique identifier that represents a geographic entity (location or object), as distinguished from other entities in the same geocode system. In general, a geocode is a human-readable and short identifier. The ISO 19112 standard also admits long labels as geocodes. Geocodes are mainly used (in general as an atomic data type) for labelling, data integrity, geotagging and spatial indexing. Typical geocodes (in bold) 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 (e.g. AF for Afghanistan or BR for Brazil), and its subdivision conventions, such as AF subdivision codes (e.g. AF-GHO for Ghor province) or BR subdivision codes (e.g. BR-AM for Amazonas state). DGG cell ID. Identifier of a cell of a discrete global grid: a Geohash code (e.g. ~0.023 km2 cell 6vd23gq at Brazil's centroid) or a Plus Code (e.g. ~0.0002 km2 cell 58Q8XXXX+XX within the same area). Postal code. Polygon of a postal area: a CEP code (e.g. 70040 represents a Brazilian's central area for postal distribution). 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 (or geocode systems) that can be used as classification criteria:
Ownership: proprietary or free, differing by its licences. Formation: the geocode can be originated from a name (ex. abbreviation of official name the country) or from mathematical function (encoding algorithm to compress latitude-longitude). See geocode system types below (of names and of grids). Hierarchy: geocode's syntax hierarchy corresponding to the spatial hierarchy of its represented entities. A geocode system can be hierarchical (name or grid) or non-hierarchical. Covering: global or partial. The entities (represented by the geocodes) are in all globe (e. g. geographical points) or is delimited the theme (e.g. only terrestrial areas) or by the ownership's jurisdiction (e.g. only into a country). Type of the represented entity: type of geometry. Point (the geocode can be translated to a Geo URI), grid cell (the geocode system is related with a DGG) or polygon (typically administrative boundaries delimitations). special hierarchical grids, with global covering and equal-area cells, can be classified as DGGS cell some non-standard geographic entities, can be classified also by its coordinate system and elipsoid of reference (e.g. UTM). The de facto standard is the WGS84. Scope of use: general use vs specialized (e.g. airport geocodes).
System The set of all geocodes used as unique identifiers of the cells of a full-coverage of the geographic surface (or any well-defined area like a country or the oceans), is a geocode system (also named geocode scheme). The syntax and semantic of the geocodes are also components of the system definition:
geocode syntax: the characters that can be used, blocks of characters and its size and order. Example: country codes use two letters of the alphabet (chacacter set A-Z). The most common way to describe formally is by regular expression (e.g. /[A-Z]{2,2}/). geocode semantic: the meaning of the geocode, usually expressed by associating the code with a geographical entity type. Can be described formally is by an ontology, an UML class diagram or any Entity-relationship model. 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 (and expanded) 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 (e.g. location name or latitude/longitude coordinates), into a normalized data and encodes it as a geocode. geocoder service A geocoder implemented as web service (or similar service interface), 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 (e.g. GeoJSON object) 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 (street name and house number) is expressed in a standardized and simplified way, it can be conceived as geocode. So, the term geocoding (used for addresses) sometimes is generalized for geocodes. In spatial indexing applications the geocode can also be translated between human-readable (e.g. hexadecimal) and internal (e.g. binary 64-bit unsigned integer) 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 (typically polygon of administrative areas). "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 (and its official geometries).
… excerpt ends here. Continue reading the full article.




