<div dir="ltr"><div>Hello everyone,</div><div><br></div><div>I am trying to create fixed dimensions squared png tiles with raster data, but i am getting cropped irregular tiles with varying height and width depending on the values of the pixels. I tried a couple of things to work around this issue, like creating a squared raster and merging it with the cropped one but I can't manage to merge rasters of different dimensions. Can anyone give me a hand? Is there a better way to force the output image not to crop the parts of the squared area with no data?   </div><div><br></div><div>This query illustrates my issue:</div><div><br></div><div>select st_summary(ST_UNION(r))</div><div>from (</div><div><br></div><div> select st_union(ST_Clip(rast,1,g::geometry,TRUE)) as r</div><div> from</div><div>  st_makebox2d(st_makepoint(0,0),st_makepoint(10,10)) as g,</div><div>  </div><div>  (select ST_AsRaster(p,1, 1, '2BUI') as rast</div><div>  from (</div><div>   select st_makepoint(5,2) as p union</div><div>   select st_makepoint(3,4)</div><div>  ) as rast</div><div>  ) as r</div><div> union</div><div> select ST_AsRaster(st_makebox2d(st_makepoint(0,0),st_makepoint(10,10))::geometry,1, 1, '2BUI')</div><div><br></div><div>) as t</div><div><br></div><div>Any help is deeply appreciated.</div><div><br></div><div>Best regards,</div><div> Carlo</div></div>