[postgis-devel] ST_Rescale issues again

Sandro Santilli strk at keybit.net
Thu Aug 28 00:53:46 PDT 2014


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 ?


--strk; 

 ()  ASCII ribbon campaign  --  Keep it simple !
 /\  http://strk.keybit.net/rants/ascii_mails.txt  



More information about the postgis-devel mailing list