Opened 12 years ago
Closed 10 years ago
#2251 closed defect (fixed)
[raster ] Rescaling raster chooses wrong values
Reported by: | dzwarg | Owned by: | dustymugs |
---|---|---|---|
Priority: | critical | Milestone: | PostGIS 2.1.0 |
Component: | raster | Version: | master |
Keywords: | Cc: |
Description
Using a test raster with 1 band, 8BUI, rescale uses the wrong scale factor to rescale the raster.
The raster with id=1 was created with {{{ select ST_AddBand(ST_MakeEmptyRaster(10,10,0,0,1,-1,0,0,0), '8BUI'::text, 1); }}}
Running rescale works on rasters that are not positioned on the origin, but the (0,0) upperleftx, upperlefty raster is scaled by the wrong factor.
raster=# select id,st_metadata(rast), st_metadata(st_rescale(rast, 2, -2, 'NearestNeighbor'::text)) from test order by id; id | st_metadata | st_metadata ----+-----------------------------+--------------------------- 1 | (0,0,10,10,1,-1,0,0,0,1) | (0,0,50,50,1,-1,0,0,0,1)
Change History (6)
comment:1 by , 12 years ago
Component: | postgis → raster |
---|---|
Keywords: | raster removed |
Milestone: | → PostGIS 2.1.0 |
Status: | new → assigned |
Version: | 2.0.x → trunk |
comment:4 by , 10 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
I'm reopening this because the test introduced for it is clearly bogus to me. Using ST_Resize asking for halfing the size and ST_Rescale asking for doubling the scale are both expected to return a tile which has the same scale as the input tile, which is exactly the problem reported in #2911
comment:5 by , 10 years ago
Why are we multiplying scales by 10 in the "subgt" case in r11215 ? In trunk it bacame a division by 10, what is 10 ? What's the division for ?
comment:6 by , 10 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
re-closing for mental sanity. Better handled in #2911
The following should result in the same answer and exposes the error in this ticket.