Skip to content

Commit

Permalink
fix CRS cropping error
Browse files Browse the repository at this point in the history
  • Loading branch information
Cidree committed Oct 3, 2024
1 parent 7f6b4b9 commit 7396061
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@

- `fd_inventory_spain()` was returning metadata with the same name always. Now it will be different depending on the dataset that we download, and it will be checked if it exists before downloading it (according to #3).

- `fd_landcover_copernicus()` and `fd_canopy_height()` now crop data regardless of the CRS.

# Version 0.1.0

- Initial release.
8 changes: 4 additions & 4 deletions R/land-cover.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ get_glc_tbl <- function() {
#' specified, this argument is ignored)
#' @param lat a number specifying the latitude of the area where we want the tile
#' @param lon a number specifying the longitude of the area where we want the tile
#' @param year year of the forest extent data. One of 2015:2019 or 'all'
#' @param year year of the land cover data. One of 2015:2019 or 'all'
#' @param layer a character vector of the layer(s) to use from the Global
#' Land Cover. See details
#' @param crop when \code{x} is specified, whether to crop the tiles(s) to the
Expand Down Expand Up @@ -197,7 +197,7 @@ fd_landcover_copernicus <- function(x,
names(glad_sr) <- ids$layer_names

# 4. Manage crop
if (crop) glad_sr <- terra::crop(glad_sr, x, ...)
if (crop) glad_sr <- terra::crop(glad_sr, xwgs84, ...)

# 5. Return
return(glad_sr)
Expand Down Expand Up @@ -242,8 +242,8 @@ get_landcoverexplorer_tbl <- function() {
#'
#' @param utm_code a character string of length 1 with an UTM code (e.g. "29N")
#' @param year an integer or vector of integers corresponding to the base year
#' of the Land Cover image. The option \code{year = 'all'} downloads all
#' the available images
#' of the land cover tile. The option \code{year = 'all'} downloads all
#' the available images (2017:2022)
#' @param quiet if \code{TRUE} (the default), suppress status messages, and
#' the progress bar
#'
Expand Down
2 changes: 1 addition & 1 deletion man/fd_landcover_copernicus.Rd

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

4 changes: 2 additions & 2 deletions man/fd_landcover_esri.Rd

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

0 comments on commit 7396061

Please sign in to comment.