From 61dfb280872bc3dab571144737a7ba3e02bb0001 Mon Sep 17 00:00:00 2001 From: Djedouas Date: Thu, 4 Mar 2021 11:57:47 +0100 Subject: [PATCH] =?UTF-8?q?Am=C3=A9lioration=20mineure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- orientation/orientation.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/orientation/orientation.py b/orientation/orientation.py index 2326839..65ec783 100644 --- a/orientation/orientation.py +++ b/orientation/orientation.py @@ -288,13 +288,15 @@ class Orientation: else: deleted_fields.append(field_name) - # On réexplose les champs sans doublons - layer = processing.run("native:explodehstorefield", - parameters={"INPUT": layers[osm_name], - "FIELD": "other_tags", - "OUTPUT": "memory:", - "EXPECTED_FIELDS": ",".join(expected_fields)}, - context=context)["OUTPUT"] + # S'il y a des doublons + if len(deleted_fields) > 0: + # On réexplose les champs sans doublons + layer = processing.run("native:explodehstorefield", + parameters={"INPUT": layers[osm_name], + "FIELD": "other_tags", + "OUTPUT": "memory:", + "EXPECTED_FIELDS": ",".join(expected_fields)}, + context=context)["OUTPUT"] # On enregistre le layer dans le gpkg options.layerName = layer_name