GridRefConvert: Convert between British National Grid Reference (BNG) and...

View source: R/GISfuncs.R

GridRefConvertR Documentation

Convert between British National Grid Reference (BNG) and Latitude and Longitude.

Description

Function to convert between BNG easting & northing and Latitude & Longitude (or vice versa).

Usage

GridRefConvert(x, fromBNG = TRUE)

Arguments

x

A vector of length 2. Either latitude and longitude (if fromBNG = FALSE) or easting and northing (if fromBNG = TRUE).

fromBNG

A logical argument with a default of TRUE. When TRUE it converts from easting and northing to latitude and longitude. When FALSE it converts from latitude and longitude to easting and northing.

Value

A data.frame with the converted grid references. Either latitude and longitude if BNG = TRUE. Or easting and northing if fromBNG = FALSE.

Author(s)

Anthony Hammond

Examples

#Get Latitude and Longitude for a BNG numeric reference.
GridRefConvert(c(462899, 187850))
#Now we'll get easting and northing as a function of latitude and longitude
GridRefConvert(c(51.6, -1), fromBNG = FALSE)

UKFE documentation built on Sept. 30, 2024, 9:46 a.m.

Related to GridRefConvert in UKFE...