jVectormap:试图转换映射时元组索引超出范围

jVectormap: tuple index out of range when trying to convert a map

本文关键字:索引 元组 范围 映射 转换 jVectormap      更新时间:2024-03-18

我正试图通过转换此Shapefile来创建芬兰的jVectormap地图文件:http://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-1-states-provinces/

我已经安装了Python和模块,但在尝试此命令时:

/usr/local/bin/python2.7 converter/converter.py '
    /<path>/ne_110m_admin_1_states_provinces_shp.dbf '
    /<path>/finland.js '
    --width 1000 '
    --country_name_index 8 '
    --country_code_index 0 '
    --longitude0 26.00 '
    --where "ISO_A2='FI'" '
    --name data_fin '
    --language en

我得到这个堆栈跟踪:

Traceback (most recent call last):
File "converter/converter.py", line 296, in <module>
converter.convert(args['output_file'])
File "converter/converter.py", line 167, in convert
insetBbox = self.renderMapInset(codes, 0, 0, self.width)
File "converter/converter.py", line 194, in renderMapInset
scale = (bbox[2]-bbox[0]) / width
IndexError: tuple index out of range

不确定出了什么问题。

如果我查看带有的shp文件

ogrinfo ne_110m_admin_1_states_provinces_shp.shp ne_110m_admin_1_states_provinces_shp -where "ISO_A2='FI'"

我只得到文件的摘要。

您使用的是convert.py的哪个版本?最新的1.2.2似乎有问题。你可以在这里找到很多jvectormaphttps://github.com/jfhovinne/jvectormap-maps-builder包括芬兰!该软件包还包括一个旧的convert.py 1.1.1,运行良好。