简体   繁体   English

如何正确加载GeoJson文件?

[英]How to load GeoJson file properly?

I have a geojson file of Moscow districts that is avaliable at 我有一个莫斯科地区的geojson文件,可在

http://gis-lab.info/data/mos-adm/mo.geojson 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 这不起作用

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

This reads the contents of the file and passes the string to folium. 这将读取文件的内容,并将字符串传递给folium。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM