Skip to contents

Checks 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.

Usage

check_oz_lonlat(longitude, latitude)

Arguments

longitude

user provided numeric value(s) as decimal degrees

latitude

user provided numeric value(s) as decimal degrees

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.