This project contain the implementation of folium maps using choroplath & geojson method.
- Jupyter Notebook
Generate Geojson format using generate_coordinate.ipynb
- search region https://nominatim.openstreetmap.org
- on details copy the OSM ID (e.g 5802438)
- paste OSM_ID into ID_*.csv
- then run the generate_coordinate
- it should be generate json file (e.g JK_regencies.json)
cartodbpositron | cartodbdark_matter | Mapbox Bright | Mapbox Control Room |
stamenwatercolor | Stamen Toner | Stamen Terrain |
m = folium.Map(location=[-6.2, 106.90],tiles='OpenStreetMap', zoom_start=11)
folium.Choropleth(
geo_data=regency_geo,
name='choropleth',
data=regency_data,
columns=['Regency', 'Index'],
key_on='feature.id',
fill_color='YlOrRd',
fill_opacity=1.0,
line_opacity=0.2,
legend_name='Index'
).add_to(m)
folium.GeoJson(
regency_geo,
name='index',
style_function=lambda feature: {
'fillColor': colormap(index_dict[feature['id']]),
'color': 'black',
'weight': 1,
'dashArray': '5, 5',
'fillOpacity': 0.9,
}
).add_to(m)
- folium - To build awesome maps library
- Wilayah-Administratif-Indonesia - Where data of Provinces, Regencies, & Districts comes from s