geobr
geobr copied to clipboard
Neighborhood codes incorrect
Hi everyone!
I'm facing a little trouble when using the package geobr. I developed a R script to combine data from sidrar https://cran.r-project.org/web/packages/sidrar/sidrar.pdf with the shapefiles from the read_census_tract() function. The entire script seems look well but when i try to join both datasets using the neighborhood codes something go wrong.
Setting a specific city, Porto Alegre - RS for example (city IBGE code = 4314902) and extract data at neighborhood level, i receive about 80 unique neighborhood names e codes from sidrar and geobr packages. (It's OK! Great!)
My issue pops up when i identify that neighborhood codes doesn't match with each other. It seems weird once the sidrar is a IBGE official tool https://sidra.ibge.gov.br/pesquisa/censo-demografico/demografico-2010/sinopse
I attached a file with a little bit R code to ilustrate my problem.
Thanks a lot!!!
Hi Rodrigo. Thank you for your message.
I've looked into the original shape files of the census tracts and neighborhoods published by IBGE and they haven't published any update on the data. This is to say that the data sets in geobr
are exactly the same as the ones available on IBGE´s ftp: ftp://geoftp.ibge.gov.br/organizacao_do_territorio/malhas_territoriais/malhas_de_setores_censitarios__divisoes_intramunicipais/censo_2010/setores_censitarios_shp
Havin said that, I noticed you opened an issue at the sidrar. Thanks. I dropped them a message as well. Let's wait to hear from them and hopefully we can sort this out soon.
on a side note, please mind you that geobr
also has a 'read_neighborhood()
function.
So, instead of running this: poligonos <- read_census_tract(4314902)
You could run this, which will be a bit faster:
nei_br <- geobr::read_neighborhood()
nei_poa <- subset(nei_br, name_muni=='Porto Alegre')
Hello Rafael!
In fact, I already thought about use the 'geobr::read_neighborhood()' function, however this function has a limited number of cities and I'm working in a project that covers all brazilian cities as possible.
Thanks for your efforts to solve this issue!