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

View source: R/osg-parse.R

osg_parseR Documentation

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(grid_refs, coord_system = c("BNG", "WGS84"))

Arguments

grid_refs

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

coord_system

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

Details

This function is taken from the rnrfa package and licenced under GPL-3. Using this avoids direct dependency on rgdal package.

Value

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

Author(s)

Claudia Vitolo

Examples

## Not run: 
# single entry
osg_parse(grid_refs = "TQ722213")

# multiple entries
osg_parse(grid_refs = c("SN831869", "SN829838"))

## End(Not run)

# Begin Exclude Linting

aquaMetrics/rict documentation built on March 1, 2025, 1:31 p.m.