diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2024-06-10 19:05:41 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2024-06-10 20:31:28 +0200 |
commit | 69a2c335a560e7683646eadbafaa48f9fba0d82c (patch) | |
tree | 47ca7c0630908fe3e5bd9d6e8fb75f27be2f85be /webmap-import | |
parent | 24af8ac13362edec6f5db76260b06e2d12cf64a4 (diff) |
webmap-import: Rename getFieldTypeCode() to parseFieldType().
And getFieldSubTypeCode() to parseSubFieldType().
Diffstat (limited to 'webmap-import')
-rwxr-xr-x | webmap-import | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/webmap-import b/webmap-import index 6daceee..a3ffd50 100755 --- a/webmap-import +++ b/webmap-import @@ -213,9 +213,9 @@ def parseGeomType(name): return eGType # cf. ogr/ogr_core.h's enum OGRFieldType; -def getFieldTypeCode(name): +def parseFieldType(name): if name is None: - raise Exception('getFieldTypeCode(None)') + raise Exception('parseFieldType(None)') name2 = name.lower() if name2 == 'integer': # simple 32bit integer @@ -257,9 +257,9 @@ def getFieldTypeCode(name): raise Exception(f'Unknown field type "{name}"') # cf. ogr/ogr_core.h's enum OGRFieldSubType; -def getFieldSubTypeCode(name): +def parseSubFieldType(name): if name is None: - raise Exception('getFieldSubTypeCode(None)') + raise Exception('parseSubFieldType(None)') name2 = name.lower() if name2 == 'none': # No subtype. This is the default value. @@ -280,7 +280,7 @@ def getFieldSubTypeCode(name): # UUID string representation. Only valid for OFTString. return ogr.OFSTUUID else: - raise Exception(f'Unknown field subtype "{name2}"') + raise Exception(f'Unknown field subtype "{name}"') # Validate layer creation options and schema. The schema is modified in # place with the parsed result. @@ -336,9 +336,9 @@ def validateSchema(layers, drvo=None, lco_defaults=None): fld_def2['Comment'] = v elif k2 == 'type': - fld_def2['Type'] = getFieldTypeCode(v) + fld_def2['Type'] = parseFieldType(v) elif k2 == 'subtype': - fld_def2['SubType'] = getFieldSubTypeCode(v) + fld_def2['SubType'] = parseSubFieldType(v) elif k2 == 'tzflag': pass # TODO #fld_def2['TZFlag'] = v |