Question

I have ran the following code :

python \
converter.py \
ne_10m_admin_1_states_provinces_shp.shp \
test-map.js \
--width 400 \
--where "ISO_3166_2 = 'ID-' " \
--minimal_area 4000000 \
--buffer_distance -0.5 \
--simplify_tolerance 10000 \
--longitude0 54.8270 \
--name indonesia

i don't include --country_name_index and --country_code_index because i can't find out those value in shp file for my country (it's left blank).

and here is the result for that command :

ERROR 1: No such field: '1'
ERROR 1: No such field: '0'
Traceback (most recent call last):
    File "converter.py", line 295, in <module>
        converter.conver(args['output_file'])
    File "converter.py", line 143, in convert
        self.loadData()
    File "converter.py", line 88, in LoadData
        self.loadDataSource( SourcceConfig )
    File "converter.py", line 118, in loadDataSource
        name = feature.GetFieldAsString( sourceConfig.get('country_name_index') ).decode(SourceConfig).get('input_file_encoding'))
AtributeError: 'NoneType' object has no attribute 'decode'

i wish anyone can answer my problem or help me to convert "indonesia" map

thanks before.

Was it helpful?

Solution

Finally i can convert it, for some country that doesn't have country_name_index and country_code_index we just have to add them manualy.

First we need to edit the shp file using GIS software, i used QuantumGIS (http://www.qgis.org/)

According to this answer, the country_name_index is the region name attribute/column, and the country_code_index is the region_code column, so add some integer value such as 65 or whatever and now you can create custom map.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top