Merge pull request #4126 from cpaulik/v3.0.x-gdal-int32-support

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

View file

@ -399,6 +399,25 @@ feature_ptr gdal_featureset::get_feature(mapnik::query const& q)
feature->set_raster(raster);
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:
case GDT_Int16:
{

@ -1 +1 @@
Subproject commit b4aa4c462fd827c388805ddeb5a163edefd62c7e
Subproject commit 6636c04550c489db52180c47325513cf9bc09d6d

@ -1 +1 @@
Subproject commit 6a1af6c24b2f5b15f1165b33efb4ce339c955a4c
Subproject commit 629fefc6994033085e55d8532e0a7b4b45227290