Skip to content

Instantly share code, notes, and snippets.

@diegovalle
Last active May 25, 2019 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegovalle/67593742a35fe23399c18bfe7eba24ec to your computer and use it in GitHub Desktop.
Save diegovalle/67593742a35fe23399c18bfe7eba24ec to your computer and use it in GitHub Desktop.
#! /bin/bash
# Projection compatible with Google Maps
PROJECTION="+proj=longlat +ellps=WGS84 +no_defs +towgs84=0,0,0"
# wget command
WGET="wget -w 5 --random-wait --tries=2 -nc"
# The mapa digital is available as 4 files
declare -a extensions=(".exe" "-1.bin" "-2.bin" "-3.bin")
$WGET "http://internet.contenidos.inegi.org.mx/contenidos/productos/prod_serv/contenidos/espanol/bvinegi/productos/nueva_estruc/promo/Instalador_proy_bas_inf_2017.zip" -O md.zip
unzip md.zip Instalador_proy_bas_inf_2017.exe
echo "Extracting shapefiles..."
innoextract --lowercase --silent Instalador_proy_bas_inf_2017.exe
echo "Reprojecting shapefiles..."
find . -name '*.shp' -execdir ogr2ogr {} {} -overwrite -t_srs "$PROJECTION" \;
mv "app/proyecto basico de informacion 2017" "mapa_digital_2017"
rm -rf app
rm -rf tmp
rm -rf Instalador_proy_bas_inf_2017.exe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment