We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For maps section here https://github.com/PyMap/ssyt/blob/main/ssyt/charts.py#L130-L179
... we use scattermapbox to draw polygon limits. Another option to render this map would be to:
For polygons we can try to optimize rendering by using topojson format instead of geojson. To go from one format to another:
# GeoJson to TopoJson sudo npm install topojson-server -g geo2topo das_4326.geojson > das_4326.topojson toposimplify -p 1 -f < das_4326.topojson > das_4326_simple.topojson topoquantize 1e5 < das_4326_simple.topojson > das_4326_quantized.topojson
reference: https://medium.com/@mbostock/command-line-cartography-part-3-1158e4c55a1e
import json # load topojson def get_toronto_das_topodata(): with open('data/das_toronto.json') as f: das_topo = json.load(f) return das_topo topodas = get_toronto_das_topodata() folium_map = folium.Map(location=coords, zoom_start=8, tiles="CartoDB dark_matter") folium.Choropleth(geo_data=topo, topojson='objects.das_toronto_data_4326', key_on='feature.properties.DAUID', data=das_toronto[['mean_hh_income','average_dwelling_value','DAUID']], # my dataset columns=['mean_hh_income','average_dwelling_value'], fill_color='GnBu', fill_opacity=0.7, line_opacity=0.5).add_to(folium_map) folium.TopoJson(topodas, object_path='objects.das_toronto').add_to(folium_map); folium_map.add_child(folium.GeoJson(data = open("data/topo_das_toronto_data_4326.json")))
reference: https://github.com/urbansim/ggh_land_selector/blob/toronto_selector/ggh_land_selector/Toronto_focus.ipynb
geojson to topojson references https://medium.com/tech-carnot/topojson-based-choropleth-visualization-using-folium-471113fa5964#dd2f https://github.com/carnot-technologies/MapVisualizations
The text was updated successfully, but these errors were encountered:
PyMap
No branches or pull requests
For maps section here https://github.com/PyMap/ssyt/blob/main/ssyt/charts.py#L130-L179
... we use scattermapbox to draw polygon limits. Another option to render this map would be to:
For polygons we can try to optimize rendering by using topojson format instead of geojson. To go from one format to another:
reference: https://medium.com/@mbostock/command-line-cartography-part-3-1158e4c55a1e
reference: https://github.com/urbansim/ggh_land_selector/blob/toronto_selector/ggh_land_selector/Toronto_focus.ipynb
geojson to topojson references
https://medium.com/tech-carnot/topojson-based-choropleth-visualization-using-folium-471113fa5964#dd2f
https://github.com/carnot-technologies/MapVisualizations
The text was updated successfully, but these errors were encountered: