Learn R Programming

rnbn (version 1.1.2)

gridCoords: Get x,y coordinates from a grid reference

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

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: a list of class "gridref" with the following contents:

See Also

gridRef

Examples

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

Run the code above in your browser using DataLab