[GRASS-SVN] r60481 - grass/trunk/raster/r.external

svn_grass at osgeo.org svn_grass at osgeo.org
Sun May 25 14:22:26 PDT 2014


Author: martinl
Date: 2014-05-25 14:22:26 -0700 (Sun, 25 May 2014)
New Revision: 60481

Modified:
   grass/trunk/raster/r.external/list.c
Log:
r.external: Starting with GDAL 2.0, vector drivers can also be returned (fix -f flag)

Modified: grass/trunk/raster/r.external/list.c
===================================================================
--- grass/trunk/raster/r.external/list.c	2014-05-25 21:21:29 UTC (rev 60480)
+++ grass/trunk/raster/r.external/list.c	2014-05-25 21:22:26 UTC (rev 60481)
@@ -24,6 +24,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