[postgis-devel] ST_Rescale vs. ST_Resize

Bborie Park dustymugs at gmail.com
Tue Jul 1 10:25:43 PDT 2014


ST_Resize and ST_Rescale may give different answers as they're operating on
two different components of the raster. ST_Resize uses the desired output
width/height to determine the output scaleX/scaleY. ST_Resample uses the
desired scaleX/scaleY to determine the output width/height.

As for the tile to tile gap, I seem to recall that robe experienced a
similar issue several years ago. I'll see if I can test a simple dataset.

-bborie


On Tue, Jul 1, 2014 at 9:10 AM, Sandro Santilli <strk at keybit.net> wrote:

> I implemented automatic resizing of raster tiles in a mapnik plugin
> for postgis raster that's under development. The initial implementation
> has been using ST_Resize() passing as scale arguments the factor between
> the raster scale and the target scale.
>
> Ie, for target scales 0.6, the call was:
>
>  ST_Resize(r, ST_ScaleX(r)/0.6, ST_ScaleY(r)/0.6)
>
> That works very nicely, but then I found there's an ST_Rescale function
> and tried to use it, to save some calls at the SQL level.
>
> Unfortunately the ST_Rescale version:
>
>  ST_Rescale(r, 0.6, -0.6)
>
> Results in visible tile boundaries, subtle gaps between a tile and another,
> as shown here: http://strk.keybit.net/tmp/pgrast-cdb-prescale-gaps.png
>
> Is that expected or is it a bug ?
> Should the two calls above give the same result or not ?
>
> TIA.
>
> --strk;
>
>  ()  ASCII ribbon campaign  --  Keep it simple !
>  /\  http://strk.keybit.net/rants/ascii_mails.txt
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20140701/b506c2a1/attachment.html>


More information about the postgis-devel mailing list