OSGB: Ordnance Survey for Great Britain grid reference system

View source: R/geocode.R

OSGBR Documentation

Ordnance Survey for Great Britain grid reference system

Description

Convert coordinates to the grid reference system used by the Ordnance Survey for Great Britain. Or do the inverse operation to get coordinates for a grid code.

Usage

OSGB(xy, precision, geo=FALSE, inverse=FALSE)

Arguments

xy

x coordinate pairs (vector, matrix, data.frame

; or grid codes if inverse=TRUE.

precision

character. One of "1m", "5m", "10m", "50m", "100m", "500m", "1km", "5km", "10km", "50km", "100km", "500km"

geo

If TRUE the input coordinates are in longitude/latitude (on the airy ellipsoid!). If FALSE they must be in the "OSGB36 / British National Grid" coordinate reference system ("EPSG:27700" or "+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +units=m")

inverse

If TRUE, coordinates are computed for the grid codes in x

Value

character

Examples

pnts <- rbind(cbind(93555 , 256188), 
			  cbind(210637, 349798),
			  cbind(696457, 481704))

g <- OSGB(pnts, "1km", geo=FALSE)
g

OSGB(g, inverse=TRUE)

rspatial/geosphere documentation built on Oct. 12, 2024, 11:44 a.m.