Merge pull request #4124 from cpaulik/gdal-int32-support

Add Int32 support for gdal driver
This commit is contained in:
Artem Pavlenko 2020-02-11 12:15:32 +00:00 committed by GitHub
commit e3f4e76c47
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 2 deletions

View file

@ -397,6 +397,25 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
feature->set_raster(raster); feature->set_raster(raster);
break; break;
} }
case GDT_Int32:
{
mapnik::image_gray32s image(im_width, im_height);
image.set(std::numeric_limits<std::int32_t>::max());
raster_nodata = band->GetNoDataValue(&raster_has_nodata);
raster_io_error = band->RasterIO(GF_Read, x_off, y_off, width, height,
image.data(), image.width(), image.height(),
GDT_Int32, 0, 0);
if (raster_io_error == CE_Failure)
{
throw datasource_exception(CPLGetLastErrorMsg());
}
mapnik::raster_ptr raster = std::make_shared<mapnik::raster>(feature_raster_extent, intersect, image, filter_factor);
// set nodata value to be used in raster colorizer
if (nodata_value_) raster->set_nodata(*nodata_value_);
else raster->set_nodata(raster_nodata);
feature->set_raster(raster);
break;
}
default: default:
case GDT_Int16: case GDT_Int16:
{ {

@ -1 +1 @@
Subproject commit e83b7f7c6d2d646a638bba404a0d637609722a09 Subproject commit eaf64519e4aecc0b1f689aa96d4d741b22a75a87

@ -1 +1 @@
Subproject commit 54a2c2595c81e838810e413d42a57f09fcf41331 Subproject commit bacfd251da550fa82ea56f6710dc6f85431480c2