Adaptive Geocode (AGC) Tool

Adaptive Geocodes (AGCs) are short, human-readable codes that represent geographic locations. You can truncate an AGC from the end to represent a larger area with less precision, making them flexible for various levels of detail.

Encode Coordinates to AGC

Or use the interactive map below.

Decode AGC

Example AGCs:

  • AC: Golfo de México
  • 8LD: Moku o Keawe
  • 3Z5D0: Silverstone
  • 4UDZCU: Tour Eiffel
  • F69HIUJ: Ryōgoku Kokugikan両国国技館

Interactive Map

Click on the map to select coordinates. Zoom in for increased precision and longer codes.

I made this! David Glover-Aoki in Woodside, California. (9741D)

AGC Algorithm Description

The Adaptive Geocode (AGC) algorithm converts geographic coordinates (latitude/longitude) into a variable-length string and vice-versa. It operates on a rectilinear projection of the world (90°S to 90°N, 180°W to 180°E).

Encoding Process:

  1. Initial Grid: The world is first divided into an 8-column by 4-row grid (32 cells).
  2. Cell Identification: The cell containing the target coordinates is identified. Cells are indexed row by row, then column by column (0-31).
  3. First Character: The character from a predefined 36-character set (0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ) corresponding to this index (0-31) becomes the first character of the AGC.
  4. Recursive Subdivision: The identified cell then becomes the new bounding box for the next level of precision.
  5. Subsequent Grids: This new box is subdivided into a 6-column by 6-row grid (36 cells).
  6. Subsequent Characters: The character (from the same 36-character set) corresponding to the sub-cell containing the coordinates (indexed 0-35) is appended to the AGC.
  7. Iteration: Steps 4-6 are repeated until the desired code length (and thus precision) is achieved.

Decoding Process:

Decoding reverses this process. Each character in the AGC refines the bounding box based on the 8x4 grid for the first character and 6x6 grids for subsequent characters. The character's index within the ALPHABET determines which cell of the current grid to select as the new, smaller bounding box. This is repeated for all characters in the AGC.

The center of the final bounding box is typically used as the decoded coordinate pair.

 

Disclaimer of All Rights and Public Domain Dedication

To the fullest extent permissible by applicable law, the author(s) and contributor(s) of the algorithm and accompanying JavaScript demonstration ("the Work") hereby disclaim all copyright, patent, and any other intellectual property rights or legal protections whatsoever in the Work, worldwide.

The Work is dedicated to the public domain. Anyone is free to copy, modify, distribute, perform, and use the Work for any purpose, commercial or non-commercial, and in any way, without any restrictions or obligations.

The Work is provided "AS IS", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall the author(s) or contributor(s) be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Work or the use or other dealings in the Work.