basic support for GDAL 2.0

git-svn-id: http://svn.osgeo.org/postgis/trunk@12584 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Bborie Park 2014-05-25 19:51:01 +00:00
parent e29722f668
commit 6042e16a83
2 changed files with 13 additions and 0 deletions

View file

@ -910,7 +910,12 @@ rt_raster_gdal_polygonize(
/*****************************
* Register ogr mem driver
*****************************/
#ifdef GDAL_DCAP_RASTER
/* in GDAL 2.0, OGRRegisterAll() is an alias to GDALAllRegister() */
rt_util_gdal_register_all(0);
#else
OGRRegisterAll();
#endif
RASTER_DEBUG(3, "creating OGR MEM vector");

View file

@ -1728,6 +1728,14 @@ rt_raster_gdal_drivers(uint32_t *drv_count, uint8_t cancc) {
for (i = 0, j = 0; i < count; i++) {
drv = GDALGetDriver(i);
#ifdef GDAL_DCAP_RASTER
/* Starting with GDAL 2.0, vector drivers can also be returned */
/* Only keep raster drivers */
state = GDALGetMetadataItem(drv, GDAL_DCAP_RASTER, NULL);
if (state == NULL || !EQUAL(state, "YES"))
continue;
#endif
if (cancc) {
/* CreateCopy support */
state = GDALGetMetadataItem(drv, GDAL_DCAP_CREATECOPY, NULL);