Get x,y coordinates from a grid reference

Share:

Description

Given an OSGB or OSNI grid reference string, get the x,y coordinates of the OSGB or OSNI grid for the bottom, left-hand corner of the grid square. The units parameter controls the units (metres m or kilometres km) in which the coordinates should be returned.

Usage

1
gridCoords(grid = NULL, units = c("km", "m"))

Arguments

grid

an OSGB or OSNI grid reference string

units

metres or kilometres (default)

Value

a list of class "gridref" with the following contents:

grid

the original grid reference

system

the grid reference system, either "OSGB" or "OSNI"

x

the x coordinate (easting) in requested units

y

the y coordinate (northing)in requested units

units

"m" or "km"

precision

the prcision of the original grid reference in metres

Author(s)

Stuart Ball, JNCC stuart.ball@jncc.gov.uk

See Also

gridRef

Examples

1
2
gridCoords("NZ1265") # returns x=412, y=565 (in km)
gridCoords("NZ123654", units="m") # returns x=412300, y=565400 (in m)