diff --git a/DESCRIPTION b/DESCRIPTION index 67a10984..fd4ab963 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -29,6 +29,7 @@ Description: Search, query, and download tabular and License: Apache License (== 2.0) URL: https://bcgov.github.io/bcdata/, https://catalogue.data.gov.bc.ca/, https://github.com/bcgov/bcdata/ BugReports: https://github.com/bcgov/bcdata/issues +Depends: R (>= 3.6) Imports: methods, utils, diff --git a/R/utils.R b/R/utils.R index e8098881..86c9521c 100644 --- a/R/utils.R +++ b/R/utils.R @@ -87,6 +87,15 @@ specify_geom_name <- function(cols_df, CQL_statement){ bcdc_read_sf <- function(x, ...){ + # avoid use of spherical geomotry while reading (#337): + # https://r.geocompx.org/read-write#geographic-web-services + uses_s2 <- suppressMessages(sf::sf_use_s2(FALSE)) + on.exit( + suppressMessages(sf::sf_use_s2(uses_s2)), + add = TRUE, + after = FALSE + ) + if(length(x) == 1){ return(sf::read_sf(x, stringsAsFactors = FALSE, quiet = TRUE, ...))