workaround old GDAL bug regarding rgba images and alpha reporting - closes #2310

This commit is contained in:
Dane Springmeyer 2014-07-22 14:33:59 -07:00
parent 5fe68f6d1b
commit 48f920ab95

View file

@ -277,8 +277,21 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
break;
}
case GCI_Undefined:
#if GDAL_VERSION_NUM <= 1730
if (nbands_ == 4)
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming alpha band)";
alpha = band;
}
else
{
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming gray band)";
grey = band;
}
#else
MAPNIK_LOG_DEBUG(gdal) << "gdal_featureset: Found undefined band (assumming gray band)";
grey = band;
#endif
break;
default:
MAPNIK_LOG_WARN(gdal) << "gdal_featureset: Band type unknown!";