Folium程序未运行

2024-04-24 07:44:08 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试制作一个python程序,它生成一个单张web地图,其中一些点数据作为热图,一些边界数据作为GeoJson。当我在python中运行以下代码时,会出现如下错误:

Traceback (most recent call last):
  File "pollingstations.py", line 12, in <module>
    src = json.load(open('pollstations.geojson'))
  File "C:\Python27\ArcGIS10.3\lib\json\__init__.py", line 290, in load
    **kw)
  File "C:\Python27\ArcGIS10.3\lib\json\__init__.py", line 338, in loads
    return _default_decoder.decode(s)
  File "C:\Python27\ArcGIS10.3\lib\json\decoder.py", line 365, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python27\ArcGIS10.3\lib\json\decoder.py", line 381, in raw_decode
    obj, end = self.scan_once(s, idx)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xcd in position 2: invalid continuation byte

这是python代码。在

^{pr2}$

Tags: 数据代码inpyjsonobjinitlib
1条回答
网友
1楼 · 发布于 2024-04-24 07:44:08

试试看 open('pollstations.geojson', encoding="utf-8")open('pollstations.geojson', encoding = "ISO-8859-1"),并检查标记名、县或国家?在

相关问题 更多 >