[gdal-dev] Confusing error behavior of OGR_L_GetSpatialRef

Sean Gillies sean at mapbox.com
Tue Nov 13 13:13:27 PST 2018


Hi,

While debugging a problem with my Fiona project I realized that if
GDAL_DATA is not known, OGR_L_GetSpatialRef() (master branch and also
2.3.2) can return a not-NULL spatial reference while also putting a
CE_Failure error on the error stack. Is this intended or is the error code
perhaps one level too high in this case? Are application using GDAL
supposed to continue working if the EPSG support files aren't found? Might
this be changed to a warning instead?

I see that ogr2ogr does continue while also printing the following to the
terminal:

ERROR 4: Unable to open EPSG support file gcs.csv.  Try setting the
GDAL_DATA environment variable to point to the directory containing EPSG
csv files.

Will OGR_L_GetSpatialRef() always return NULL if there is a error condition
that an application can't or shouldn't continue from? Or do applications
need to check the error stack to see how bad the situation is?

Thanks,

-- 
Sean Gillies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20181113/71b7d63a/attachment.html>


More information about the gdal-dev mailing list