Closed pvgenuchten closed 2 weeks ago
Thanks @pvgenuchten.
@justb4 do we want to suppress warnings with ogr.DontUseExceptions
, or do we want to keep to make a discussion point about GDAL/OGR warning handling?
Ok, this is a good educational point: think this comes from a more recent OGR than last workshop. When using OGR from Python it is good practice to enable Exceptions. This is what we do e.g. in the pygeoapi OGR Provider init()
:
# Exceptions will get raised on anything >= gdal.CE_Failure
self.gdal.UseExceptions()
See https://pcjericks.github.io/py-gdalogr-cookbook/gdal_general.html#enable-python-exceptions. Will devote a couple of lines in Notebook.
(and prevent the warning).
can we prevent the warning?