【问题标题】:jVectormap: tuple index out of range when trying to convert a mapjVectormap:尝试转换地图时元组索引超出范围
【发布时间】:2014-05-14 04:56:17
【问题描述】:

我正在尝试通过转换此 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'"

我只得到文件的摘要。

【问题讨论】:

    标签: javascript python shapefile jvectormap


    【解决方案1】:

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

    【讨论】:

    • 这更像是一个评论而不是一个答案。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-01-26
    • 2013-07-28
    • 2021-03-02
    • 2018-11-16
    • 2016-04-04
    • 2020-06-08
    相关资源
    最近更新 更多