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

211 Views Asked by At

I am trying to create a jVectormap map file of Finland by converting this Shapefile: http://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-admin-1-states-provinces/

I have installed Python and the modules, but when trying this command:

/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

I get this stack trace:

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

Not sure what is wrong.

If I look at the shp file with

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

I only get the summary of the file.

1

There are 1 best solutions below

1
On

Which version of convert.py are you using ? The latest one 1.2.2 seems buggy. You can find many jvectormap here https://github.com/jfhovinne/jvectormap-maps-builder including finland ! The package also includes an older convert.py 1.1.1 which works fine.