Skip to contents

Function to find nearest locations in a reference by latitude and longitude.

Usage

findNearLatLon(lat, lon = NULL, nmax = 10, ..., ref = NULL, units = "m")

findNearSites(
  lat,
  lon,
  pollutant = "no2",
  site.type = "rural background",
  nmax = 10,
  ...,
  ref = NULL,
  units = "m"
)

Arguments

lat, lon

(numeric) The supplied latitude and longitude.

nmax

(numeric) The maximum number of nearest sites to report, by default 10.

...

Other parameters, currently ignored.

ref

(data.frame or similar) The look-up table to use when identifying nearby locations, and expected to contain latitude, longitude and any required location identifier data-series. By default, findNearSites uses openair importMeta output if this is not supplied but this is a required input for findNearLatLon.

units

(character) The units to use when reporting distances to near locations; current options m.

pollutant

(character) For findNearSites only, the pollutant of interest, by default NO2.

site.type

(character) For findNearSites only, the monitoring site type, by default Rural Background.

Value

find.near returns data.frame of near site meta data.

Details

If investigating air quality in a particular location, for example a UK Clean Air Zone (https://www.gov.uk/guidance/driving-in-a-clean-air-zone), you may wish to locate an appropriate rural background air quality monitoring station. findNearSites locates air quality monitoring sites with openly available data such as that available from the UK AURN network (https://uk-air.defra.gov.uk/networks/network-info?view=aurn)

Note

This function uses haversine formula to account to the Earth's surface curvature, and uses 6371 km as the radius of earth.

Examples

#find rural background NO2 monitoring sites
#near latitude = 50, longitude = -1

#not run: requires internet
if (FALSE) {
findNearSites(lat = 50, lon = -1)
}