> 
> Even - I found methods to check for VSI errors:
> https://gist.github.com/pedros007/55c6e33224596fb4d8e9e6b68b24ed9b#file-simp
> levsimemfile-py-L73-L74
> 
> Are these intended for public consumption? 

With care...

> When reading from a
> /vsimem/foo.shp with gdal-2.2.0, gdal.VSIGetLastErrorMsg() reported an
> error "No such file or directory". 

Probably because the shapefile driver probed a side-car file that didn't exist 
(the .sbn you 
mention below) but wasn't required. VSIGetLastErrorMsg() is mostly for internal 
use by 
GDALOpen() (at least it was designed for that). Users will normally call 
gdal.GetLastErrorMsg() or gdal.UseExceptions() to have exceptions for 
user-visible errors.

Rule of thumb:
- gdal.VSIGetLastErrorMsg() can be used if you use low-level API like 
gdal.VSIFOpenL() that 
aren't verbose normally.
- for higher level like gdal.Open(), use gdal.GetLastErrorMsg() or 
gdal.UseExceptions()

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to