My geojson data in Multipolygon type

My geojson data in Multipolygon type and actually coming from server
data:
{ “type”: “MultiPolygon”, “coordinates” …

when I try to use:

    geo_source = GeoJSONDataSource(geojson=f.read())
   ..

it is rejected as:
“Bokeh only supports type GeometryCollection and FeatureCollection at top level”

How can we solve it?

As the error code states, GeoJSONDataSource only currently knows about a subset of GeoJSON types. [1] Without knowing anything about your data, or what sorts of glyphs you want to draw, it’s not really possible to offer any concrete advice at all. I can only note generally that you will need to convert the GeoJSON input data to whatever usual format Bokeh glyphs expect manually.


  1. Geo/GIS is still a big area for improvement within Bokeh. As always it’s always a matter of limited resources. However, we did just submit a large grant proposal, half of which was tagged specifically for Geo/GIS improvements, so if we are lucky some of this work might be funded in next year. ↩︎

1 Like