Closed MatthieuStigler closed 2 years ago
I can still see a bunch of sep = "\\"
in download.R
, such as dat <- sf::read_sf(paste(dir, "Degrad2007_Final_pol.shp", sep = "\\"))
?
This will certainly fail too:
data <- load_degrad(
dataset = "degrad",
raw_data = FALSE,
time_period = 2013,
language = "pt"
)
trying URL 'http://www.obt.inpe.br/OBT/assuntos/programas/amazonia/degrad/arquivos/degrad2013_final_shp.zip'
Content type 'application/zip' length 4819285 bytes (4.6 MB)
==================================================
downloaded 4.6 MB
Error: Cannot open "/tmp/RtmpnP6Smh\DEGRAD_2013_INPE_pol.shp"; The file doesn't seem to exist.
Hi
I believe the package is assuming windows path (i..e using \ separators)? This would be a problem with Linux/Mac users.
Indeed, running
load_deter(dataset = 'deter_amz', raw_data = TRUE)
, I get error message (note the mixed separators):But the file definitely exists: file.exists("/tmp/RtmpOQISI6/deter_public.shp") returns TRUE.
Looking at the code, I think you might just want to replace
paste(dir, "deter_public.shp", sep = "\\")
in _externaldownload withfile.path()
,which makes sure to use / or \ depending on Windows versus Linux/Mac.Thanks!