datazoompuc / datazoom.amazonia

Simplify access to data from the Brazilian Amazon
Other
52 stars 7 forks source link

Error in load_sigmine #222

Closed giuliaimbu closed 10 months ago

giuliaimbu commented 11 months ago

When trying to run

# Download treated data (raw_data = FALSE) in portuguese (language = "pt").
data <- load_sigmine(dataset = 'sigmine_active', 
                     raw_data = FALSE,
                     language = "pt")

the following message appeared:

trying URL 'https://app.anm.gov.br/dadosabertos/SIGMINE/PROCESSOS_MINERARIOS/BRASIL.zip'
Content type 'application/x-zip-compressed' length 103048756 bytes (98.3 MB)
downloaded 76.2 MB

Error in utils::download.file(url = path, destfile = temp, mode = "wb") : 
  download from 'https://app.anm.gov.br/dadosabertos/SIGMINE/PROCESSOS_MINERARIOS/BRASIL.zip' failed
In addition: Warning messages:
1: In utils::download.file(url = path, destfile = temp, mode = "wb") :
  downloaded length 0 != reported length 0
2: In utils::download.file(url = path, destfile = temp, mode = "wb") :
  URL 'https://app.anm.gov.br/dadosabertos/SIGMINE/PROCESSOS_MINERARIOS/BRASIL.zip': Timeout of 60 seconds was reached
IgorRigolon commented 10 months ago

The data is indeed too heavy, so the download exceeds the limit. A way to fix this is to change the download method to curl. In line 578 of download.R, we define which functions use curl processes:

  if (source %in% c("deter", "terraclimate", "baci")) {
    download_method <- "curl"
    quiet <- FALSE
  }

Just adding "sigmine" to this list should be enough.

giuliaimbu commented 10 months ago

It was line 528. I added it there and now it's working!