Skip to content

Commit

Permalink
Merge pull request #192 from dieghernan/master
Browse files Browse the repository at this point in the history
Fix typos and cache is crs-aware & man updated
  • Loading branch information
antagomir authored Feb 1, 2021
2 parents 71259b3 + f2d35b5 commit 5f92ee9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions R/get_eurostat_geospatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' "2003", "2006", "2010", "2013", "2016" or "2021"
#' @param cache a logical whether to do caching. Default is \code{TRUE}. Affects
#' only queries from the bulk download facility.
#' @param update_cache a locigal whether to update cache. Can be set also with
#' @param update_cache a logical whether to update cache. Can be set also with
#' options(eurostat_update = TRUE)
#' @param cache_dir a path to a cache directory. The directory have to exist.
#' The \code{NULL} (default) uses and creates
Expand Down Expand Up @@ -115,7 +115,7 @@ Please check your connection and/or review your proxy settings")
# information regarding their licence agreements.
# ")

if (resolution == "60" && year == 2016 && crs == "4326"){
if (resolution == "60" && year == "2016" && crs == "4326"){

if (nuts_level %in% c("all")){
shp <- eurostat_geodata_60_2016
Expand Down Expand Up @@ -163,7 +163,7 @@ Please check your connection and/or review your proxy settings")
cache_file <- file.path(cache_dir,
paste0(
output_class, resolution,
nuts_level, year, ".RData")
nuts_level, year, crs, ".RData")
)
}

Expand Down Expand Up @@ -231,20 +231,20 @@ Please check your connection and/or review your proxy settings")
}
}

if (resolution != "60" & year != 2016){
if (cache & file.exists(cache_file)) {
cf <- path.expand(cache_file)
message(paste("Reading cache file", cf))
load(file = cache_file)
if (output_class == "sf") message(paste("sf at resolution 1:",
if (!(resolution == "60" & year == "2016" & crs == "4326")){
if (cache & file.exists(cache_file)) {
cf <- path.expand(cache_file)
message(paste("Reading cache file", cf))
load(file = cache_file)
if (output_class == "sf") message(paste("sf at resolution 1:",
resolution, " from year ",
year," read from cache file: ",
cf))
if (output_class == "df") message(paste("data_frame at resolution 1:",
if (output_class == "df") message(paste("data_frame at resolution 1:",
resolution, " from year ",
year," read from cache file: ",
cf))
if (output_class == "spdf") message(paste("SpatialPolygonDataFrame at resolution 1:",
if (output_class == "spdf") message(paste("SpatialPolygonDataFrame at resolution 1:",
resolution, " from year ",
year," read from cache file: ",
cf))
Expand Down
2 changes: 1 addition & 1 deletion man/get_eurostat_geospatial.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5f92ee9

Please sign in to comment.