2013-08-06 53 views
0

我已經跑了下面的代碼:無法轉換自定義地圖jvectormap

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 

我不包括--country_name_index和--country_code_index因爲我無法找出在SHP文件的價值我的國家(它留空)。

,這裏是該命令的結果:

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' 

我希望每個人都可以回答我的問題,或者幫助我之前轉換「印尼」地圖

感謝。

回答

0

最後,我可以將其轉換爲一些國家沒有country_name_indexcountry_code_index我們只需要添加manualy。

首先,我們需要使用GIS軟件編輯SHP文件,我用QuantumGIS(http://www.qgis.org/

this回答,country_name_index是區域名稱屬性/列,country_code_index是region_code column,所以加一些整數值,如65或任何,現在你可以創建自定義地圖。