GDALException on null #243

Closed
opened 2 years ago by mpeltriaux · 1 comments
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 2 years ago
mpeltriaux self-assigned this 2 years ago
mpeltriaux referenced this issue from a commit 2 years ago
Poster
Owner

Fixed and merged in #244

# Fixed and merged in #244
mpeltriaux closed this issue 2 years ago
Sign in to join this conversation.
Loading…
There is no content yet.