diff options
author | Guilhem Moulin <guilhem@fripost.org> | 2025-08-14 23:37:02 +0200 |
---|---|---|
committer | Guilhem Moulin <guilhem@fripost.org> | 2025-08-14 23:40:53 +0200 |
commit | 61b789efd97199c8c2577d1c4f5bec11c2973dfb (patch) | |
tree | 78f0b56a02c400c8ff1267027719ef6dbfee3bb9 | |
parent | d62196c41e7667106cd21603bb48acc694029669 (diff) |
-rw-r--r-- | import_source.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/import_source.py b/import_source.py index 52dba60..1271981 100644 --- a/import_source.py +++ b/import_source.py @@ -261,6 +261,8 @@ def validateOutputLayer(lyr : ogr.Layer, layerDefn = lyr.GetLayerDefn() n = layerDefn.GetGeomFieldCount() if n != 1: + if n == 0: + raise RuntimeError(f'Output layer "{lyr.GetName()}" has no geometry fields') logging.warning('Output layer "%s" has %d != 1 geometry fields', lyr.GetName(), n) iGeomField = 0 |