GDALException on null #243

Closed
opened 2022-11-22 13:58:46 +01:00 by mpeltriaux · 1 comment
Owner

Status quo

Another bug has been detected, which occurs on the geometry form's is_valid() call:

  File "/konova/compensation/views/compensation/compensation.py", line 165, in edit_view
    if data_form.is_valid() and geom_form.is_valid():
  File "/konova/konova/forms/geometry_form.py", line 86, in is_valid
    g = gdal.OGRGeometry(feature_geom, srs=DEFAULT_SRID_RLP)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/gis/gdal/geometries.py", line 92, in __init__
    OGRGeomType(geom_input)
  File "/usr/local/lib/python3.7/site-packages/django/contrib/gis/gdal/geomtype.py", line 43, in __init__
    raise GDALException('Invalid OGR String Type "%s"' % type_input)

Exception Type: GDALException at /compensation/431b4b74-0630-4f56-ad25-fd49863b021c/edit
Exception Value: Invalid OGR String Type "null"

The provided geometry contains three features, where one feature does not provide any geometry data.

Fix

If a feature does not contain geometry, simply ignore it and continue iterating over all provided features.

# Status quo Another bug has been detected, which occurs on the geometry form's is_valid() call: ```python File "/konova/compensation/views/compensation/compensation.py", line 165, in edit_view if data_form.is_valid() and geom_form.is_valid(): File "/konova/konova/forms/geometry_form.py", line 86, in is_valid g = gdal.OGRGeometry(feature_geom, srs=DEFAULT_SRID_RLP) File "/usr/local/lib/python3.7/site-packages/django/contrib/gis/gdal/geometries.py", line 92, in __init__ OGRGeomType(geom_input) File "/usr/local/lib/python3.7/site-packages/django/contrib/gis/gdal/geomtype.py", line 43, in __init__ raise GDALException('Invalid OGR String Type "%s"' % type_input) Exception Type: GDALException at /compensation/431b4b74-0630-4f56-ad25-fd49863b021c/edit Exception Value: Invalid OGR String Type "null" ``` The provided geometry contains three features, where one feature does not provide any `geometry` data. # Fix If a feature does not contain geometry, simply ignore it and continue iterating over all provided features.
mpeltriaux added the
bug
label 2022-11-22 13:58:46 +01:00
mpeltriaux self-assigned this 2022-11-22 13:58:46 +01:00
Author
Owner

Fixed and merged in #244

# Fixed and merged in #244
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: IT-Naturschutz/konova#243
No description provided.