Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Novidades com os novos dados do IBGE? #7

Open
ppKrauss opened this issue Sep 12, 2016 · 1 comment
Open

Novidades com os novos dados do IBGE? #7

ppKrauss opened this issue Sep 12, 2016 · 1 comment

Comments

@ppKrauss
Copy link
Contributor

https://lists.openstreetmap.org/pipermail/talk-br/2016-July/011502.html

"IBGE disponibiliza Base de Faces de Logradouros do Censo 2010", http://saladeimprensa.ibge.gov.br/noticias?view=noticia&id=1&busca=1&idnoticia=3213

@lucasmation
Copy link
Owner

lucasmation commented Sep 17, 2016

@ppKrauss , comecei a prototipar a importacao, ate agora tenho o seguinte

:: downloading, unziping, organizing
cd ~/Desktop/base_de_faces_de_logradouros
wget -r -nd -nc --read-timeout=5 ftp://geoftp.ibge.gov.br/recortes_para_fins_estatisticos/malha_de_setores_censitarios/censo_2010/base_de_faces_de_logradouros/
:: had excute the command a couple times to make sure all files were downloaded
:: downloads 10,909 .zip files, totalling 1.9 GB
unzip  '*.zip'
mkdir setor
mkdir face
mkdir zips
find -type f -name '*.setor*' -exec mv -i {} -t ~/Desktop/base_de_faces_de_logradouros/setor \;
find -type f -name '*.face*'  -exec mv -i {} -t ~/Desktop/base_de_faces_de_logradouros/face  \;
find -type f -name '*.zip*'   -exec mv -i {} -t ~/Desktop/base_de_faces_de_logradouros/zips  \;
:: after unzip, the face .shp files take 3.8Gb, the setor .shp files take 1.2Gb


:: loading into Postgis

cd face

:: First create an empty table
shp2pgsql -p -s 4674:4326 -I -W LATIN1 11000150500_face test1.CNEFE_face_quadra3 | psql -h server -p porta -d dados_espaciais

::load all files into it
for f in *.shp 
  do shp2pgsql -a -s 4674:4326 -I -W LATIN1 $f test1.CNEFE_face_quadra3 | psql -h server -p porta -d dados_espaciais 
done 


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants