Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Created June 8, 2022 14:55
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 sergiolucero/c06863f656f0a4b69383fbc650f7fa11 to your computer and use it in GitHub Desktop.
Save sergiolucero/c06863f656f0a4b69383fbc650f7fa11 to your computer and use it in GitHub Desktop.
triple mapa
import geopandas as gp
import time
hdf=gp.read_file('Humedales', encoding='utf-8')
hdf.region.value_counts()
hdf.cut_reg.value_counts()
#hdf.set_crs(epsg=4326, inplace=True)
#hdf=hdf.to_crs(epsg=4326) # doesn not work for every region!
t0=time.time()
for reg, rdf in hdf.groupby('cut_reg'):
rrdf = rdf.to_crs(epsg=4326)
rrdf.to_file('Humedales_Region_%s.json' %reg, driver='GeoJSON')
print(reg, len(rdf), round(time.time()-t0,2))
@sergiolucero
Copy link
Author

Debieran estar limites comunales, rios y humedales. Más aeropuertos, etc:
https://www.bcn.cl/siit/mapas_vectoriales/index_html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment