georef_fwd: World Geographic Reference System (Georef)

View source: R/georef.R

georef_fwdR Documentation

World Geographic Reference System (Georef)

Description

Convert geographic coordinates (longitude/latitude) to World Geographic Reference System (Georef) codes, or convert Georef codes back to coordinates.

Usage

georef_fwd(x, precision = 2L)

georef_rev(georef)

Arguments

x

A two-column matrix or data frame of coordinates (longitude, latitude) in decimal degrees, or a list with longitude and latitude components. Can also be a length-2 numeric vector for a single point.

precision

Integer specifying the precision level (-1 to 11):

  • -1: 15-degree cells (2-character code)

  • 0: 1-degree cells (4-character code)

  • 1: 1-minute cells (6-character code)

  • 2: 0.1-minute cells (8-character code)

  • Higher values give progressively finer precision

georef

Character vector of Georef codes to convert back to coordinates.

Details

The World Geographic Reference System (Georef) is a grid-based geocode system used primarily for air navigation. It was developed by the US and adopted by ICAO (International Civil Aviation Organization).

The Georef code structure:

  • First letter: 15° longitude band (A-Z, omitting I and O)

  • Second letter: 15° latitude band (A-M, omitting I)

  • Third letter: 1° longitude within band (A-Q, omitting I and O)

  • Fourth letter: 1° latitude within band (A-Q, omitting I and O)

  • Remaining digits: minutes (and fractions) of longitude and latitude

Example: "GJPJ3217" represents approximately (0.54°, 51.28°)

Value

  • georef_fwd(): Character vector of Georef codes.

  • georef_rev(): Data frame with columns:

    • lon: Longitude of cell center in decimal degrees

    • lat: Latitude of cell center in decimal degrees

    • precision: Precision level

    • lat_resolution: Cell half-height in degrees

    • lon_resolution: Cell half-width in degrees

See Also

gars_fwd() for Global Area Reference System, mgrs_fwd() for Military Grid Reference System.

Examples

# Basic conversion
georef_fwd(c(-0.1, 51.5))

# Different precision levels
georef_fwd(c(-0.1, 51.5), precision = -1)  # 15-degree
georef_fwd(c(-0.1, 51.5), precision = 0)   # 1-degree
georef_fwd(c(-0.1, 51.5), precision = 1)   # 1-minute
georef_fwd(c(-0.1, 51.5), precision = 2)   # 0.1-minute

# Multiple points
pts <- cbind(lon = c(-74, 139.7, 0), lat = c(40.7, 35.7, 51.5))
georef_fwd(pts)

# Reverse conversion
georef_rev(c("GJPJ3217", "SKNA2342", "FJBL0630"))

geographiclib documentation built on March 4, 2026, 9:07 a.m.