return (double) rt_util_clamp_to_1BB((double) CHAR_MIN);
}
case PT_2BUI: {
- return (double) rt_util_clamp_to_2BUI((double) CHAR_MIN);
+ return 0;
}
case PT_4BUI: {
- return (double) rt_util_clamp_to_4BUI((double) CHAR_MIN);
+ return 0;
}
case PT_8BUI: {
- return (double) rt_util_clamp_to_8BUI((double) CHAR_MIN);
+ return 0;
}
case PT_8BSI: {
return (double) rt_util_clamp_to_8BSI((double) SCHAR_MIN);
return (double) rt_util_clamp_to_16BSI((double) SHRT_MIN);
}
case PT_16BUI: {
- return (double) rt_util_clamp_to_16BUI((double) SHRT_MIN);
+ return 0;
}
case PT_32BSI: {
return (double) rt_util_clamp_to_32BSI((double) INT_MIN);
}
case PT_32BUI: {
- return (double) rt_util_clamp_to_32BUI((double) INT_MIN);
+ return 0;
}
case PT_32BF: {
return (double) -FLT_MAX;
ptr += 1;
break;
}
- case PT_16BSI:
+ case PT_16BSI: {
+ int16_t v = band->nodataval;
+ memcpy(ptr, &v, 2);
+ ptr += 2;
+ break;
+ }
case PT_16BUI: {
uint16_t v = band->nodataval;
memcpy(ptr, &v, 2);
ptr += 2;
break;
}
- case PT_32BSI:
+ case PT_32BSI: {
+ int32_t v = band->nodataval;
+ memcpy(ptr, &v, 4);
+ ptr += 4;
+ break;
+ }
case PT_32BUI: {
uint32_t v = band->nodataval;
memcpy(ptr, &v, 4);
ptr += 1;
break;
}
- case PT_16BSI:
+ case PT_16BSI: {
+ int16_t v = band->nodataval;
+ memcpy(ptr, &v, 2);
+ ptr += 2;
+ break;
+ }
case PT_16BUI: {
uint16_t v = band->nodataval;
memcpy(ptr, &v, 2);
ptr += 2;
break;
}
- case PT_32BSI:
+ case PT_32BSI: {
+ int32_t v = band->nodataval;
+ memcpy(ptr, &v, 4);
+ ptr += 4;
+ break;
+ }
case PT_32BUI: {
uint32_t v = band->nodataval;
memcpy(ptr, &v, 4);
#3055 ST_Clip() on a raster without band crashes the server
******************************************************************************/
SELECT ST_SummaryStats(ST_Clip(ST_MakeEmptyRaster(42, 42, 0, 0, 1.0, 1.0, 0, 0, 4269), ST_MakeEnvelope(0, 0, 20, 20, 4269)));
+
+-- #4102 negative nodata values don't apply on Raspberry Pi
+SELECT '#4102.1', ST_BandNoDataValue(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 0), 1, '16BSI', 0, -10), 1) AS rast;
+SELECT '#4102.2', ST_BandNoDataValue(ST_AddBand(ST_MakeEmptyRaster(2, 2, 0, 0, 1, -1, 0, 0, 0), 1, '32BSI', 0, -10), 1) AS rast;