-1

I have a geojson file of Moscow districts that is avaliable at

http://gis-lab.info/data/mos-adm/mo.geojson

So, I can't load it properly.

These ideas does not help:

I tried to create a map and then add a layer on it.

 import folium

m = folium.Map(location = [55.7522200,37.6156000], zoom_start_13)

folium.GeoJson(open('mo.geojson')).add_to(m)'

this does not work

nutcracker
  • 101
  • 1
  • 9

1 Answers1

1

Try folium.GeoJson(open('mo.geojson').read()).add_to(m)

This reads the contents of the file and passes the string to folium.

rettenda
  • 385
  • 4
  • 11
  • Got this error: `UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 907334: character maps to ` So, I have added `encoding - 'utf-8'` parameter, now it works. Thanks A lot!!! – nutcracker Jul 16 '19 at 12:11