Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
espaciopublico
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
espaciopublico
Commits
f0abaaaa
Commit
f0abaaaa
authored
Jun 29, 2025
by
Mario Chirinos Colunga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
instrucciones
parent
41d6ecf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
90 additions
and
2 deletions
+90
-2
README.md
README.md
+5
-2
download.sh
data/inegi/download.sh
+85
-0
No files found.
README.md
View file @
f0abaaaa
# Cuantificación del Espacio Público al Aire Libre de los Municipios Metropolitanos en la República Mexicana Utilizando OpenStreetMaps
# Cuantificación del Espacio Público al Aire Libre de los Municipios Metropolitanos en la República Mexicana Utilizando OpenStreetMaps
## INEGI
## Descaga de datos
'''
cd data/inegi
sh download.sh
'''
## OSM
## OSM
data/inegi/download.sh
0 → 100644
View file @
f0abaaaa
#sudo apt install gdal-bin
echo
"Marco Geoestadístico Nacional"
mgn2024
=
"794551132173_s.zip"
if
[
!
-e
"
$mgn2024
"
]
;
then
wget
"https://www.inegi.org.mx/contenidos/productos/prod_serv/contenidos/espanol/bvinegi/productos/geografia/marcogeo/"
$mgn2024
else
echo
$mgn2024
"descargado"
fi
# Manzanas
if
[
!
-e
"mgn2024/00m.shp"
]
;
then
mkdir
-p
mgn2024
unzip
-nj
$mgn2024
-d
mgn2024/
cd
mgn2024
mkdir
00m
for
filename
in
*
.zip
;
do
cvegeo
=
${
filename
%_*
}
unzip
-nj
$filename
"conjunto_de_datos/"
$cvegeo
"m.*"
-d
00m
done
unzip
-nj
mg_2024_integrado.zip
-d
mg_2024
cd
00m
ogrmerge
-single
-o
../mg_2024/00m.shp
*
.shp
cd
../..
rm
-r
mgn2024/00m
rm
mgn2024/
*
.zip
mv
mgn2024/mg_2024/
*
.
*
mgn2024/
rm
-r
mgn2024/mg_2024
else
echo
"00m.shp created"
fi
#===============================================================================
#===============================================================================
echo
"Censo de Población y Vivienda 2020"
mkdir
-p
ccpv/csv
censo2020
=
"iter_00_cpv2020_csv.zip"
if
[
!
-e
"
$censo2020
"
]
;
then
wget
"https://www.inegi.org.mx/contenidos/programas/ccpv/2020/datosabiertos/iter/"
$censo2020
else
echo
$censo2020
"descargado"
fi
unzip
-nj
$censo2020
iter_00_cpv2020/conjunto_de_datos/conjunto_de_datos_iter_00CSV20.csv
-d
ccpv/
#cat ccpv/conjunto_de_datos_iter_00CSV20.csv | grep -v "Total" >> "ccpv/"$outputfile
#AGEB
for
i
in
$(
seq
32
)
;
do
value
=
$(
printf
"%02d"
$i
)
mainname
=
"ageb_mza_urbana_"
$value
"_cpv2020"
filename
=
$mainname
"_csv.zip"
if
[
!
-e
"ccpv/
$filename
"
]
;
then
wget
"https://www.inegi.org.mx/contenidos/programas/ccpv/2020/datosabiertos/ageb_manzana/"
$filename
mv
$filename
ccpv/
$filename
else
echo
$filename
"descargado"
fi
unzip
-nj
ccpv/
$filename
$mainname
"/conjunto_de_datos/conjunto_de_datos_ageb_urbana_"
$value
"_cpv2020.csv"
-d
ccpv/csv
done
#head -1 director/one_file.csv > output.csv ## writing the header to the final file
outputfile
=
"ageb_mza_urbana_cpv2020.csv"
if
[
!
-e
"ccpv/
$outputfile
"
]
;
then
for
filename
in
"ccpv/csv/*.csv"
;
do
echo
$filename
if
[
!
-e
"ccpv/
$outputfile
"
]
;
then
cat
$filename
|
grep
-v
"Total"
>>
"ccpv/"
$outputfile
## writing the content of all csv starting with second line into final file
else
cat
$filename
|
grep
-v
"Total"
|
tail
-n
+2
>>
"ccpv/"
$outputfile
## writing the content of all csv starting with second line into final file
fi
done
rm
-r
ccpv/csv
else
echo
$outputfile
created
fi
#tail -n +2 director/*.csv >> output.csv ## writing the content of all csv starting with second line into final file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment