Geoportail-Luxembourg / qgis-pag-plugin

Plugin QGIS pour la gestion des PAG du Ministère de l'Intérieur du Grand-Duché de Luxembourg
MIT License
1 stars 2 forks source link

Problem with compatibility of json files #95

Closed jaykayone closed 8 years ago

jaykayone commented 8 years ago
2016-05-27T10:01:29 1 Traceback (most recent call last):
File "C:/Users/RCF337/.qgis2/python/plugins\PagLuxembourg\widgets\import_data\import_dxf_dialog.py", line 429, in _launchImport
layer_indexmapping = layer_mapping.asIndexFieldMappings(qgis_layer.dataProvider().fields())
File "C:/Users/RCF337/.qgis2/python/plugins\PagLuxembourg\widgets\import_data\importer.py", line 712, in asIndexFieldMappings
for source, destination, constant_value, enabled, value_map in self.fieldMappings():
ValueError: need more than 4 values to unpack
jaykayone commented 8 years ago

it is a json file from the previous version, it does not work in the new version

jaykayone commented 8 years ago

it is correctly mapped, but it does not work when importing

arx-it commented 8 years ago

Please provide the json, because the json format has not been changed since the first release of the plugin.

arx-it commented 8 years ago

J'ai testé, comme annoncé, le format de configuration JSON du mapping n'a pas changé depuis la première mise en production, je ne vais donc pas effectuer de modification. En revanche, j'ai modifié votre fichier : https://www.dropbox.com/s/0io7f2fpr9xftts/document.json?dl=0 La modification a apporter est de rajouter les[] à la fin d'une section FieldMapping, exemple après le true :


"FieldMapping": [
      [
        null,
        "CODE",
        null,
        true,
        []
      ],
jaykayone commented 8 years ago

ce fichier a par contre été généré avec l'outil. y aurait-il un bug à cet endroit là?

arx-it commented 8 years ago

Comme discuté au téléphone, ce fichier provient d'une version pré-release du plugin, les utilisateurs utilisant la première release n'ont donc pas ce problème.