[postgis-devel] ST_Rescale issues again
Sandro Santilli
strk at keybit.net
Thu Aug 28 01:21:08 PDT 2014
On Thu, Aug 28, 2014 at 09:57:21AM +0200, Sandro Santilli wrote:
> On Thu, Aug 28, 2014 at 09:56:20AM +0200, Sandro Santilli wrote:
> > On Thu, Aug 28, 2014 at 09:53:46AM +0200, Sandro Santilli wrote:
> > > I keep getting suprised by ST_Rescale/ST_Resample/etc outputs.
> > > What do you think about this.
> > >
> > >
> > > Original table tiles are fully aligned: 10x10 sized, all with scale 1,-1:
> > >
> > > =# select distinct st_scalex(r), st_scaley(r), st_width(r), st_height(r)
> > > => from ( select r from res1 ) f;
> > > st_scalex | st_scaley | st_width | st_height
> > > -----------+-----------+----------+-----------
> > > 1 | -1 | 10 | 10
> > > (1 row)
> > >
> > > Passing each of them through ST_Rescale with values 2.0, -2.0 result in
> > > some tiles getting the new scale requested and some not:
> > >
> > > =# select distinct st_scalex(r), st_scaley(r), st_width(r), st_height(r)
> > > => from ( select ST_Rescale(r,2.0,-2.0) r from res1 ) f;
> > > st_scalex | st_scaley | st_width | st_height
> > > -----------+-----------+----------+-----------
> > > 2 | -2 | 5 | 5
> > > 1 | -1 | 5 | 5
> > > (2 rows)
> > >
> > > Why is that ?
> >
> > I shall add that I get this warning 4 times:
> >
> > NOTICE: Raster has default geotransform. Adjusting metadata for use of GDAL Warp API
> > CONTEXT: SQL function "st_rescale" statement 1
> >
> > And that the deviant tile is a single one over a total of 648 tiles:
> >
> > count | st_scalex | st_scaley | st_width | st_height
> > -------+-----------+-----------+----------+-----------
> > 647 | 2 | -2 | 5 | 5
> > 1 | 1 | -1 | 5 | 5
> > (2 rows)
> >
> > Should I file a ticket ?
>
> Also, GDAL is "GDAL 1.11.0, released 2014/04/16"
It fails in both 2.1 branch and trunk.
The offending tile has extent (0 -10, 10 0), scale (1,-1) and size (10,10).
Out of ST_Rescale(2.0, -2.0) it gets an extent of (0, -5, 5 0), scale(1,-1)
and size of (5,5).
Ain't that a (pretty big) bug ?
--strk;
More information about the postgis-devel
mailing list