are handled when passing to GDAL Warp API
- #2215, Fixed raster exclusion constraint for conflicting name of
implicit index
+ - #2251, Fix bad dimensions when rescaling rasters with default
+ geotransform matrix
PostGIS 2.0.3
2013/MM/DD
void **vals, uint16_t *nvals
) {
uint8_t *_vals = NULL;
- rt_pixtype pixtype = PT_END;
int pixsize = 0;
uint8_t *data = NULL;
uint32_t offset = 0;
offset = x + (y * band->width);
RASTER_DEBUGF(4, "offset = %d", offset);
- pixtype = band->pixtype;
pixsize = rt_pixtype_size(band->pixtype);
RASTER_DEBUGF(4, "pixsize = %d", pixsize);
double tmp;
double value;
int sum = 0;
- int user_minmax = 0;
double qmin;
double qmax;
qmax = stats->max;
}
else {
- user_minmax = 1;
qmin = min;
qmax = max;
if (qmin > qmax) {
FLT_EQ(gt[5], -1)
) {
double ngt[6] = {0, 10, 0, 0, 0, -10};
+
+ rtinfo("Raster has default geotransform. Adjusting metadata for use of GDAL Warp API");
+
GDALSetGeoTransform(arg->src.ds, ngt);
GDALFlushCache(arg->src.ds);
) {
_scale[0] = fabs(*scale_x);
_scale[1] = fabs(*scale_y);
+
+ /* special override */
+ if (subgt) {
+ _scale[0] *= 10;
+ _scale[1] *= 10;
+ }
}
else if (
((NULL != scale_x) && (NULL == scale_y)) ||
/* substitute geotransform matrix, reset back to default */
if (subgt) {
double gt[6] = {0, 1, 0, 0, 0, -1};
+
rt_raster_set_geotransform_matrix(rast, gt);
}
), bar AS (
SELECT rid, ST_Metadata(rast) AS meta, ST_SummaryStats(rast) AS stats FROM foo
)
-SELECT rid, (meta).*, (stats).* FROM bar
+SELECT rid, (meta).*, (stats).* FROM bar;
+
+-- edge case
+WITH foo AS (
+ SELECT ST_AddBand(ST_MakeEmptyRaster(10, 10, 0, 0, 1, -1, 0, 0, 0), 1, '8BUI', 1, 0) AS rast
+)
+SELECT
+ ST_Metadata(ST_Rescale(rast, 2, 2)) AS rescale,
+ ST_Metadata(ST_Resize(rast, 0.5, 0.5)) AS resize
+FROM foo;
NOTICE: table "raster_gdalwarp_dst" does not exist, skipping
NOTICE: Values must be provided for both X and Y when specifying the scale. Returning original raster
NOTICE: Values must be provided for both X and Y when specifying the scale. Returning original raster
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
NOTICE: Values must be provided for both X and Y when specifying the scale. Returning original raster
NOTICE: Values must be provided for both X and Y when specifying the scale. Returning original raster
0.0|||||||||||||
5.9|992163|10|11|1|1000.000|-1000.000|0.000|0.000|-500000.000|600009.000|t|t|t
NOTICE: The rasters (pixel corner coordinates) are not aligned
t|f|t
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
1|0|0|500|500|1|-1|0|0|0|1|250000|63750000|255|0|255|255
2|0|0|500|100|1|-1|0|0|0|1|50000|12750000|255|0|255|255
3|0|0|250|900|1|-1|0|0|0|1|225000|57375000|255|0|255|255
4|0|0|512|384|1|-1|0|0|0|1|196608|50135040|255|0|255|255
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
+NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
+(0,0,5,5,1,-1,0,0,0,1)|(0,0,5,5,1,-1,0,0,0,1)