Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Created June 3, 2018 17:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergiolucero/6dddec36ff4dd18f41504d2baf120760 to your computer and use it in GitHub Desktop.
Save sergiolucero/6dddec36ff4dd18f41504d2baf120760 to your computer and use it in GitHub Desktop.
Comunas de Chile
#!wget https://www.bcn.cl/siit/obtienearchivo?id=repositorio/10221/10396/1/division_comunal.zip
#!mv obtienearchivo\?id\=repositorio%2F10221%2F10396%2F1%2Fdivision_comunal.zip comunal.zip
#!unzip comunal
#!pip install geopandas
import geopandas as gp
df = gp.read_file('division_comunal.shp')
#df.NOM_REG.unique()
rmdf = df[df.NOM_REG=='Región Metropolitana de Santiago']
print('Procesamos %d comunas en la Región Metropolitana' %len(rmdf))
rmdf.to_pickle('rm.pk') # 780K! upload to quant.cl for reference (just repeat the above)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment