R Under development (unstable) (2024-11-03 r87286 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > suppressPackageStartupMessages(library(sf)) > suppressPackageStartupMessages(library(units)) > > if (utils::packageVersion("units") >= "0.5-0") + units_options(auto_convert_names_to_symbols = FALSE) > > st_crs(4326)$ud_unit 1 [degree] > > u = names(sf:::udunits_from_proj)[1:21] > > unrecognized = NULL > out = sapply(u, function(x) { + p4s = paste0("+proj=laea +units=", x) + cat(x, ": ") + ret = try(st_crs(p4s)$ud_unit, silent = TRUE) + if (! inherits(ret, "try-error")) + print(ret) + else + unrecognized = c(unrecognized, x) + }) km : 1 [km] m : 1 [m] dm : 1 [dm] cm : 1 [cm] mm : 1 [mm] kmi : 1 [nautical_mile] in : 1 [inch] ft : 1 [foot] yd : 1 [yard] mi : 1 [mi] fath : 1 [fathom] ch : 1 [chain] link : 1 [link] us-in : 1 [us_in] us-ft : 1 [US_survey_foot] us-yd : 1 [US_survey_yard] us-ch : 1 [chain] us-mi : 1 [US_survey_mile] ind-yd : 1 [ind_yd] ind-ft : 1 [ind_ft] ind-ch : 1 [ind_ch] > > if (length(unrecognized)) + print(paste("unrecognized units:", paste(unrecognized, collapse = ", "), ": older GDAL version?")) > > proc.time() user system elapsed 0.59 0.14 0.71