ipeaGIT / geobr

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

Micro region Litoral Sul in read_micro_region #247

Open enoch26 opened 3 years ago

enoch26 commented 3 years ago

Hi,

There seems to be a bug in the read_micro_region. There are two separate microregion named Litoral Sul, one in Rio Grande do Norte and another one in Paraiba. The one in Rio Grande do Norte is misgrouped to Paraiba.

I have fixed the sf object and named it as nc_miclean in attached RData.

Many thanks, Man Ho litoralsul.zip

rafapereirabr commented 3 years ago

Hi @enoch26 . Thanks for the heads up. Indeed, the code_micro of the 'Litoral Sul' micro region in Rio Grande do Norte should be 24019. We will be fixing this soon.

library(geobr)
library(mapview)
library(magrittr)

m2010 <- read_micro_region(year=2010)
m2015 <- read_micro_region(year=2015)

subset(m2010, name_micro=='Litoral Sul') %>% mapview()
subset(m2015, name_micro=='Litoral Sul') %>% mapview()
enoch26 commented 3 years ago

Hi @rafapereirabr,

Thanks for the update. I have fixed that in the attached litoralsul.R. See if that's useful for you.

Cheers, MH

rafapereirabr commented 3 years ago

Thanks for the file, @enoch26 , but we need to fix this in the code we use to generate the data set in order to garantee full reproducibility of the code /data