Check if a given CRS is in meters or degrees.
Examples
tryCatch({
print(check_crs_units(4326)) # EPSG:4326 (degrees)
print(check_crs_units(25832)) # EPSG:25832 (meters)
print(check_crs_units("+proj=longlat +datum=WGS84 +no_defs")) # PROJ.4 (degrees)
print(check_crs_units("+proj=utm +zone=32 +datum=WGS84 +units=m +no_defs")) # PROJ.4 (meters)
print(check_crs_units("+proj=somerc +lat_0=0 +lon_0=0 +k=1 +x_0=0 +y_0=0
+ellps=WGS84 +units=km +no_defs")) # Invalid CRS
print(check_crs_units("not a crs")) # Invalid CRS
print(check_crs_units("+proj=lcc +lat_1=33 +lat_2=45 +lat_0=39 +lon_0=-96
+x_0=0 +y_0=0 +datum=NAD83 +units=us-ft +no_defs")) # Invalid units
}, error = function(e) {
print(e$message)
})
#> [1] "could not find function \"check_crs_units\""