Skip to contents

This function takes as input the UK AIR ID and returns Easting and Northing coordinates (British National Grid, EPSG:27700).

Usage

ukair_get_coordinates(ids)

Arguments

ids

contains the station identification code defined by DEFRA. It can be: a) an alphanumeric string, b) a vector of strings or c) a data frame. In the latter case, the column containing the codes should be named "UK.AIR.ID", all the other columns will be ignored.

Value

A data.frame containing at least five columns named "UK.AIR.ID", "Easting", "Northing", "Latitude" and "Longitude".

Details

If the input is a data frame with some of the columns named "UK.AIR.ID", "Northing" and "Easting", the function only infills missing Northing/Easting values (if available on the relevant webpage).

Examples

 if (FALSE) { # \dontrun{
 # Case a: alphanumeric string
 ukair_get_coordinates("UKA12536")

 # Case b: vector of strings
 ukair_get_coordinates(c("UKA15910", "UKA15956", "UKA16663", "UKA16097"))

 # Case c: data frame
 ukair_get_coordinates(ukair_catalogue()[1:10,])
 } # }