Using release 0.2.1 there seems to be either a documentation clarity issue or an actual support issue. As I understand it from reading the docs, the following code should work:
import folium
json_url = "https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson"
m = folium.Map(location=(0,0), zoom_start=2)
m.choropleth(geo_path=json_url)
m
Note: I've stripped out the choropleth styling parameters for simplicity's sake.
Instead, I get the following error:
IOError: [Errno 2] No such file or directory: 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson'
This error implies that only locally-accessible files are supported, but the documentation states only that:
Parameters
----------
geo_path: string, default None
URL or File path to your GeoJSON data
I can obviously get around this using the requests library and passing r.json() to the geo_str parameter, but it would be more elegant and useful (as well as being consistent with the documentation) if that weren't actually necessary.
Using release 0.2.1 there seems to be either a documentation clarity issue or an actual support issue. As I understand it from reading the docs, the following code should work:
Note: I've stripped out the choropleth styling parameters for simplicity's sake.
Instead, I get the following error:
This error implies that only locally-accessible files are supported, but the documentation states only that:
I can obviously get around this using the
requestslibrary and passingr.json()to thegeo_strparameter, but it would be more elegant and useful (as well as being consistent with the documentation) if that weren't actually necessary.