diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2024-06-16 16:28:14 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2024-06-16 16:28:33 +0200 |
commit | 8cd8da2a39cfe55b7a580fde1ed7a83fe35d3c53 (patch) | |
tree | 6f2024d2ff9fd662caa7178a7fbfb19c6e811ea1 | |
parent | 1f617031fdf2c4d7499c6ad7b0e3314cd9e20c9c (diff) |
webmap-import: Rename ‘fields’ list/dict to ‘field-map’.
-rw-r--r-- | config.yml | 34 | ||||
-rwxr-xr-x | webmap-import | 6 |
2 files changed, 20 insertions, 20 deletions
@@ -224,10 +224,10 @@ layers: # # # Mapping of source fields to destination fields. A list translates into an # identity mapping. -# fields: +# field-map: # - field_name1 # - field_name2 -# fields: +# field-map: # source_field_name2: field_name2 # source_field_name2: field_name2 @@ -264,7 +264,7 @@ layers: format: GPKG layername: lansyta spatial-filter: false - fields: + field-map: - objektidentitet - skapad - lanskod @@ -302,7 +302,7 @@ layers: format: GPKG layername: kommunyta spatial-filter: false - fields: + field-map: - objektidentitet - skapad - kommunkod @@ -491,7 +491,7 @@ layers: path: sksAvverkAnm.shp format: ESRI Shapefile layername: sksAvverkAnm - fields: + field-map: - OBJECTID - Beteckn - ArendeAr @@ -596,7 +596,7 @@ layers: path: sksUtfordAvverk-2000-2015.shp format: ESRI Shapefile layername: sksUtfordAvverk-2000-2015 - fields: + field-map: OBJECTID: OBJECTID Beteckn: Beteckn Arendear: ArendeAr @@ -627,7 +627,7 @@ layers: path: sksUtfordAvverk-2016-2019.shp format: ESRI Shapefile layername: sksUtfordAvverk-2016-2019 - fields: + field-map: OBJECTID: OBJECTID Beteckn: Beteckn Arendear: ArendeAr @@ -658,7 +658,7 @@ layers: path: sksUtfordAvverk-2020-2022.shp format: ESRI Shapefile layername: sksUtfordAvverk-2020-2022 - fields: + field-map: OBJECTID: OBJECTID Beteckn: Beteckn Arendear: ArendeAr @@ -687,7 +687,7 @@ layers: path: sksUtfordAvverk-2023-.shp format: ESRI Shapefile layername: sksUtfordAvverk-2023- - fields: + field-map: OBJECTID: OBJECTID Beteckn: Beteckn Arendear: ArendeAr @@ -768,7 +768,7 @@ layers: import: format: GeoJSON layername: 'MRR:SE.GOV.SGU.MRR.BEARBETNINGSKONCESSIONER_APPLIED_VY' - fields: + field-map: 'Name': Name 'Mineral': Mineral 'Applicant': Applicant @@ -824,7 +824,7 @@ layers: import: format: GeoJSON layername: 'MRR:SE.GOV.SGU.MRR.BEARBETNINGSKONCESSIONER_APPROVED_VY' - fields: + field-map: 'Name': Name 'Mineral': Mineral 'Owner': Owner @@ -866,7 +866,7 @@ layers: import: format: GeoJSON layername: 'MRR:SE.GOV.SGU.MRR.MARKANVISNINGAR_VY' - fields: + field-map: 'Name': Name 'Decision date': DecisionDate 'Diary nr': DiaryNr @@ -915,7 +915,7 @@ layers: import: format: GeoJSON layername: 'MRR:SE.GOV.SGU.MRR.MINERAL_APPLIED_VY' - fields: + field-map: 'Name': Name 'Mineral': Mineral 'Applicant': Applicant @@ -976,7 +976,7 @@ layers: import: format: GeoJSON layername: 'MRR:SE.GOV.SGU.MRR.MINERAL_APPROVED_VY' - fields: + field-map: 'Name': Name 'Mineral': Mineral 'Owner': Owner @@ -1056,7 +1056,7 @@ layers: import: format: GeoJSON layername: 'MRR:SE.GOV.SGU.MRR.OLJA_GAS_DIAMANT_APPLIED_VY' - fields: + field-map: 'Name': Name 'Mineral': Mineral 'Applicant': Applicant @@ -1117,7 +1117,7 @@ layers: import: format: GeoJSON layername: 'MRR:SE.GOV.SGU.MRR.OLJA_GAS_DIAMANT_APPROVED_VY' - fields: + field-map: 'Name': Name 'Mineral': Mineral 'Owner': Owner @@ -1175,7 +1175,7 @@ layers: import: format: GeoJSON layername: 'MRR:SE.GOV.SGU.MRR.TORVKONCESSIONER_VY' - fields: + field-map: 'Name': Name 'Mineral': Mineral 'Owner': Owner diff --git a/webmap-import b/webmap-import index 1cf9def..57ef4b0 100755 --- a/webmap-import +++ b/webmap-import @@ -731,7 +731,7 @@ def setOutputFieldMap(defn, sources): for source in sources: src = source['source']['path'] - fieldMap2 = source['import'].get('fields', None) + fieldMap2 = source['import'].get('field-map', None) if fieldMap2 is None: fieldMap2 = {} else: @@ -745,7 +745,7 @@ def setOutputFieldMap(defn, sources): raise Exception(f'Ouput layer has no field named "{ofld}"') fieldMap2[ifld] = i - source['import']['fields'] = fieldMap2 + source['import']['field-map'] = fieldMap2 return fieldMap @@ -914,7 +914,7 @@ def importSource2(lyr_dst, path, args={}, basedir=None, extent=None): n = defn.GetFieldCount() fieldMap = [-1] * n - fields = args['fields'] + fields = args['field-map'] fieldSet = set() for i in range(n): |