[GRASS-SVN] r60479 - grass/trunk/raster/r.in.gdal
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun May 25 14:21:03 PDT 2014
Author: martinl
Date: 2014-05-25 14:21:03 -0700 (Sun, 25 May 2014)
New Revision: 60479
Modified:
grass/trunk/raster/r.in.gdal/main.c
Log:
r.in.gdal: Starting with GDAL 2.0, vector drivers can also be returned (fix -f flag)
Modified: grass/trunk/raster/r.in.gdal/main.c
===================================================================
--- grass/trunk/raster/r.in.gdal/main.c 2014-05-25 20:16:23 UTC (rev 60478)
+++ grass/trunk/raster/r.in.gdal/main.c 2014-05-25 21:21:03 UTC (rev 60479)
@@ -221,6 +221,13 @@
GDALDriverH hDriver = GDALGetDriver(iDr);
const char *pszRWFlag;
+#ifdef GDAL_DCAP_RASTER
+ /* Starting with GDAL 2.0, vector drivers can also be returned */
+ /* Only keep raster drivers */
+ if (!GDALGetMetadataItem(hDriver, GDAL_DCAP_RASTER, NULL))
+ continue;
+#endif
+
if (GDALGetMetadataItem(hDriver, GDAL_DCAP_CREATE, NULL))
pszRWFlag = "rw+";
else if (GDALGetMetadataItem(hDriver, GDAL_DCAP_CREATECOPY, NULL))
More information about the grass-commit
mailing list