Skip to content
This repository has been archived by the owner on Apr 11, 2022. It is now read-only.

GRASS Function not working currently #8

Closed
Jo-Schie opened this issue Dec 1, 2021 · 1 comment
Closed

GRASS Function not working currently #8

Jo-Schie opened this issue Dec 1, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@Jo-Schie
Copy link
Member

Jo-Schie commented Dec 1, 2021

Hi @goergen95 .

Me again.
Seems like currently the Grass functions are not working as expected.

devtools::install_github("mapme-initiative/mapme.forest")
 
library(sf)
library(mapme.forest)
library(raster)

## TEST DOWNLOAD
# read in polygons of interest
aoi = st_read(system.file("extdata", "aoi_polys.gpkg", package = "mapme.forest"))

# download GFW data for the area of interest
raster_files = downloadGFW(shape = aoi,
                            basename = "pkgTest",
                            dataset = "GFC-2020-v1.8",
                            outdir = "../../johannes/data/",
                            keepTmpFiles = T)
# in case the projection between aoi and the downloaded rasters is different,
treeCover = "../../johannes/data/pkgTest_treecover2000.tif"
lossYear = "../../johannes/data/pkgTest_lossyear.tif"
co2Layer = "../../johannes/data/pkgTest_co2_emission.tif"

test<-
  statsGRASS(grass = grass,
             addon_base = "../../johannes/mapme.protectedareas/data-raw/addons/",
             areas = aoi,
             tree_cover = treeCover,
             tree_loss = lossYear,
             tree_co2 = co2Layer,
             idcol =  "id",
             thresholdClump = 6,
             thresholdCover = 10,
             years = 2001:2020,
             saveRaster = F,
             .tmpdir="~/shared/datalake/tempdir/")

results in:

Warning in statsGRASS(grass = grass, addon_base = "../../johannes/mapme.protectedareas/data-raw/addons/",  :
  IMPORTANT WARNING: The use of the CO2 emission layer during analysis is currently discouraged.
           Several routines need to be adapted since the usage of a new data set by Harris et al (2021) (see https://www.nature.com/articles/s41558-020-00976-6)
           Check out https://github.com/mapme-initiative/mapme.forest/issues/7 to recieve information if the issue has been solved.

ERROR: Variable 'LOCATION_NAME' not set
Error in if (!compatible) { : argument is of length zero
In addition: Warning message:
In system(paste("g.version", get("addEXE", envir = .GRASS_CACHE),  :
  running command 'g.version' had status 1

can you confirm?

@Jo-Schie Jo-Schie added the bug Something isn't working label Dec 1, 2021
@Jo-Schie
Copy link
Member Author

Jo-Schie commented Dec 1, 2021

okay. i reinstalled stringi which was corrupt on my system and it seems to have fixed the issue

@Jo-Schie Jo-Schie closed this as completed Dec 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant