diff options
Diffstat (limited to 'webmap-import')
-rwxr-xr-x | webmap-import | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/webmap-import b/webmap-import index 8a2848d..901360d 100755 --- a/webmap-import +++ b/webmap-import @@ -340,6 +340,9 @@ def validateSchema(layers, drvo=None, lco_defaults=None): drvoSupportsNotNULLFields = getMetadataItem(drvo, GDAL_DCAP_NOTNULL_FIELDS) drvoSupportsUniqueFields = getMetadataItem(drvo, GDAL_DCAP_UNIQUE_FIELDS) + # 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 + for layername, layerdef in layers.items(): create = layerdef.get('create', None) if create is None or len(create) < 1: @@ -381,8 +384,11 @@ def validateSchema(layers, drvo=None, lco_defaults=None): elif k2 == 'alternativename' or k2 == 'alias': fld_def2['AlternativeName'] = v elif k2 == 'comment': - # (WARN support added in GDAL 3.7) - fld_def2['Comment'] = v + if hasCommentSupport: + fld_def2['Comment'] = v + else: + logging.debug('Ignoring Comment="%s" on field "%s" (OGR v%s is too old)', + v, fld_name, gdal.__version__) elif k2 == 'type': fld_def2['Type'] = parseFieldType(v) |