[gdal-dev] how to get raster drivers supporting create and subregion write
Calogero Mauceri
mauceri at actgate.com
Mon Feb 22 04:52:02 PST 2021
Hi,
I'd like to know which is the best way to know programmatically if a GDAL
driver supports the GDAL Create() and then the writing through RasterIO()
on a subregion
The way I'm trying to figure it now is
...
h = GDALGetDriver(idx);
char** papszMD = GDALGetMetadata(h, nullptr);
if ( CPLFetchBool(papszMD, GDAL_DCAP_RASTER, false) &&
CPLFetchBool(papszMD, GDAL_DCAP_CREATE, false)) {
// OK. Create and RasterIO write supported
}
...
So essentially I'm testing the GDAL_DCAP_CREATE attribute. I've not found
any attribute for testing the driver write capabilities.
For example the above code returns true for VRT driver, but it does not
support writing through VRTSourcedRasterBand.
Thanks,
Calogero
--
Calogero Mauceri
Software Engineer
Applied Coherent Technology Corporation (ACT)
www.actgate.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20210222/be3d109b/attachment.html>
More information about the gdal-dev
mailing list