From 10ac85451af4de33237a3005ccb68640964b5b2c Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Sun, 27 Oct 2024 23:21:12 +0100 Subject: webmap-import: Show the list of ingnored source fields. --- webmap-import | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/webmap-import b/webmap-import index 8311c26..9f9fdca 100755 --- a/webmap-import +++ b/webmap-import @@ -906,6 +906,7 @@ def importSource2(lyr_dst, path, args={}, basedir=None, extent=None): fields = args['field-map'] fieldSet = set() + ignoredFieldNames = [] for i in range(fieldCount): fld = defn.GetFieldDefn(i) fldName = fld.GetName() @@ -916,6 +917,7 @@ def importSource2(lyr_dst, path, args={}, basedir=None, extent=None): # call SetIgnored() on unwanted source fields logging.debug('Set Ignored=True on output field "%s"', fldName) fld.SetIgnored(True) + ignoredFieldNames.append(fldName) count0 = -1 if lyr.TestCapability(ogr.OLCFastFeatureCount): @@ -953,6 +955,9 @@ def importSource2(lyr_dst, path, args={}, basedir=None, extent=None): else: logging.info('Source layer "%s" has %d features', layername, count0) + logging.info('Ignored fields from source layer: %s', + '-' if len(ignoredFieldNames) == 0 else ', '.join(ignoredFieldNames)) + # build a list of triplets (field index, replacement_for_null, [(from_value, to_value), …]) valueMap = [] for fldName, rules in args.get('value-map', {}).items(): -- cgit v1.2.3