ipeaGIT / geobr

Easy access to official spatial data sets of Brazil in R and Python
https://ipeagit.github.io/geobr/
789 stars 118 forks source link

Error when using geobr::read_municipality for year 2000 #366

Closed PedroJorge7 closed 1 month ago

PedroJorge7 commented 1 month ago

I encountered an error while trying to load municipality data for the year 2000 using the geobr package. The error occurs both when simplify is set to TRUE and FALSE.

Code

library(geobr)

# Attempt to read municipality data with simplified = TRUE
geobr::read_municipality(year = 2000, simplified = TRUE)
Using year 2000
Error in data.table::rbindlist(files, fill = TRUE) : 
  Class attribute on column 8 of item 5 does not match with column 8 of item 1.

# Attempt to read municipality data with simplified = FALSE
geobr::read_municipality(year = 2000, simplified = FALSE)
Using year 2000
Error in data.table::rbindlist(files, fill = TRUE) : 
  Class attribute on column 8 of item 5 does not match with column 8 of item 1.
rafapereirabr commented 1 month ago

hmmm, strange. I used your code and didn't get any error. What version of {geobr} are you using? Please install the latest stable version from CRAN and try it again.

library(geobr)

# Attempt to read municipality data with simplified = TRUE
geobr::read_municipality(year = 2000, simplified = TRUE)

# Attempt to read municipality data without simplified = FALSE
geobr::read_municipality(year = 2000, simplified = FALSE)
PedroJorge7 commented 1 month ago

I did the update and it worked! Thanks