Check User Provided Longitude and Latitude Values for Validity
Source:R/check_oz_lonlat.R
check_oz_lonlat.RdChecks user-provided longitude and latitude values that they fall in Australia. Errors if any values do not. Both arguments may be vectors, in which case every value must be valid. The check uses a simple bounding box, so it will not exclude points in neighbouring countries (e.g. Timor-Leste or Papua New Guinea) that happen to fall within it.
Value
An invisible NULL, called for side-effects. Errors if the
latitude or longitude values are missing, not numeric or outside of
Australia.
Examples
# No error, Perth, WA
check_oz_lonlat(longitude = 115.86, latitude = -31.95)
# Error, in northern hemisphere
try(check_oz_lonlat(longitude = 115.86, latitude = 31.95))
#> Error in eval(expr, envir) :
#> Please check your latitude value, 31.95, to be sure it is valid for Australian data.