aboutsummaryrefslogtreecommitdiffstats
path: root/webmap-import
diff options
context:
space:
mode:
Diffstat (limited to 'webmap-import')
-rwxr-xr-xwebmap-import8
1 files changed, 6 insertions, 2 deletions
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):