aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config.yml4
-rwxr-xr-xwebmap-import8
2 files changed, 8 insertions, 4 deletions
diff --git a/config.yml b/config.yml
index d95e663..72a735e 100644
--- a/config.yml
+++ b/config.yml
@@ -264,7 +264,7 @@ layers:
comment: Globalt unik identitet för generaliserat objekt
- name: skapad
type: DateTime
- #tz: local
+ tz: local
comment: Tidpunkt när objektet ändrades
- name: lanskod
type: Integer
@@ -302,7 +302,7 @@ layers:
comment: Globalt unik identitet för generaliserat objekt
- name: skapad
type: DateTime
- #tz: local
+ tz: local
comment: Tidpunkt när objektet ändrades
- name: kommunkod
type: Integer
diff --git a/webmap-import b/webmap-import
index ffc24a2..6502c8f 100755
--- a/webmap-import
+++ b/webmap-import
@@ -342,6 +342,7 @@ def validateSchema(layers, drvo=None, lco_defaults=None):
# Cf. https://github.com/OSGeo/gdal/blob/master/NEWS.md
hasCommentSupport = common.gdal_version_min(maj=3, min=7) # GetComment()/SetComment() added in 3.7.0
+ hasTZFlagSupport = common.gdal_version_min(maj=3, min=8) # GetTZFlag()/SetTZFlag() and OGR_TZFLAG_* constants added in 3.8.0
for layername, layerdef in layers.items():
create = layerdef.get('create', None)
@@ -395,8 +396,11 @@ def validateSchema(layers, drvo=None, lco_defaults=None):
elif k2 == 'subtype':
fld_def2['SubType'] = parseSubFieldType(v)
elif k2 == 'tz':
- # (WARN support added in GDAL 3.8)
- fld_def2['TZFlag'] = parseTimeZone(v)
+ if hasTZFlagSupport:
+ fld_def2['TZFlag'] = parseTimeZone(v)
+ else:
+ logging.debug('Ignoring TZ="%s" on field "%s" (OGR v%s is too old)',
+ v, fld_name, gdal.__version__)
elif k2 == 'width' and v is not None and isinstance(v, int):
fld_def2['Width'] = v
elif k2 == 'precision' and v is not None and isinstance(v, int):