Skip to content

Instantly share code, notes, and snippets.

@sergiolucero
Last active September 20, 2017 17:58
Show Gist options
  • Save sergiolucero/983c6d92225dfaf4ef3eb7019c862ba7 to your computer and use it in GitHub Desktop.
Save sergiolucero/983c6d92225dfaf4ef3eb7019c862ba7 to your computer and use it in GitHub Desktop.
de Chile a China
import folium
import geopandas as gp
import requests
data = requests.get('http://sergiolucerovera.pythonanywhere.com/static/chile.shp')
chile = gp.GeoDataFrame(data.json())
elihc = None # use geopandas.read_file??
centroid = [(cc[1],cc[0]) for cc in chile.centroid]
cmap = folium(location=centroid, zoom=15, tiles='Staro_Pramen')
for rid, region in chile.iterrows:
folium.PolyLine(region.geometry).add_to(cmap)
cmap
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment