- #4356, ST_Accum removed. Use array_agg instead. (Darafei Praliaskouski)
- #4414, Include version number in address_standardizer lib (Raúl Marín)
- #4334, Fix upgrade issues related to renamed function parameters (Raúl Marín)
+ - #4442, raster2pgsql now skips NODATA tiles. Use -k option if you still want
+ them in database for some reason. (Darafei Praliaskouski)
* New Features *
- #2902, postgis_geos_noop (Sandro Santilli)
_tile_size[1] = info->tile_size[1];
for (xtile = 0; xtile < ntiles[0]; xtile++) {
+ int tile_is_nodata = !config->skip_nodataval_check;
/* edge x tile */
if (!config->pad_tile && ntiles[0] > 1 && (xtile + 1) == ntiles[0])
/* inspect each band of raster where band is NODATA */
if (!config->skip_nodataval_check)
- rt_band_check_is_nodata(band);
+ tile_is_nodata = tile_is_nodata && rt_band_check_is_nodata(band);
}
/* convert rt_raster to hexwkb */
- hex = rt_raster_to_hexwkb(rast, FALSE, &hexlen);
+ if (!tile_is_nodata)
+ hex = rt_raster_to_hexwkb(rast, FALSE, &hexlen);
raster_destroy(rast);
- if (hex == NULL) {
+ if (!hex && !tile_is_nodata)
+ {
rterror(_("convert_raster: Could not convert PostGIS raster to hex WKB"));
return 0;
}
/* add hexwkb to tileset */
- append_stringbuffer(tileset, hex);
+ if (!tile_is_nodata)
+ append_stringbuffer(tileset, hex);
/* flush if tileset gets too big */
if (tileset->length > 10) {
_tile_size[1] = info->tile_size[1];
for (xtile = 0; xtile < ntiles[0]; xtile++) {
+ int tile_is_nodata = !config->skip_nodataval_check;
/*
char fn[100];
sprintf(fn, "/tmp/tile%d.vrt", (ytile * ntiles[0]) + xtile);
for (i = 0; i < numbands; i++) {
band = rt_raster_get_band(rast, i);
if (band != NULL && !config->skip_nodataval_check)
- rt_band_check_is_nodata(band);
+ tile_is_nodata = tile_is_nodata && rt_band_check_is_nodata(band);
}
/* convert rt_raster to hexwkb */
- hex = rt_raster_to_hexwkb(rast, FALSE, &hexlen);
+ if (!tile_is_nodata)
+ hex = rt_raster_to_hexwkb(rast, FALSE, &hexlen);
raster_destroy(rast);
- if (hex == NULL) {
+ if (!hex && !tile_is_nodata)
+ {
rterror(_("convert_raster: Could not convert PostGIS raster to hex WKB"));
GDALClose(hdsDst);
return 0;
}
/* add hexwkb to tileset */
- append_stringbuffer(tileset, hex);
+ if (!tile_is_nodata)
+ append_stringbuffer(tileset, hex);
GDALClose(hdsDst);