Learn R Programming

rnrfa (version 1.5.0)

osg_parse: Converts OS Grid Reference to BNG/WGS coordinates.

Description

This function converts an Ordnance Survey (OS) grid reference to easting/northing or latitude/longitude coordinates.

Usage

osg_parse(gridRefs, CoordSystem = c("BNG", "WGS84"))

Arguments

gridRefs

This is a string (or a character vector) that contains the OS grid Reference.

CoordSystem

By default, this is "BNG" which stands for British National Grids. The other option is to set CoordSystem = "WGS84", which returns latitude/longitude coordinates (more info can be found here https://www.epsg-registry.org/).

Value

vector made of two elements: the easting and northing (by default) or latitude and longitude coordinates.

Examples

Run this code
# NOT RUN {
  # single entry
  osg_parse(gridRefs="TQ722213")

  # multiple entries
  osg_parse(gridRefs=c("SN831869","SN829838"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab