<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
code
{mso-style-priority:99;
font-family:"Courier New";}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:11.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple style='word-wrap:break-word'><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt'>An easier way to compare what is happening is to look at the ST_Polygon output of the two. <a href="https://postgis.net/docs/en/RT_ST_Polygon.html">https://postgis.net/docs/en/RT_ST_Polygon.html</a><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>I’m thinking the confusion (which I had thought myself) is that the width and height is measured against the X y axis, but now I think about it, I think it’s measured along the skew so width and height would remain the same in both cases. In the case of your polygon you rotate and then save as raster, the new raster is axis aligned and so there you do see the width and height change.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>So when I run this query:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>SELECT ST_Polygon(r1.rast) AS orig_geom_rast, ST_Polygon(r2.rast) AS rotated_geom_rast, ST_Width(r1.rast) AS orig_width, ST_Width(r2.rast) AS rotated_width<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> FROM (SELECT rast FROM rast_not_rotated) AS r1,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'> (SELECT ST_SetRotation(rast, -0.5 ) AS rast FROM rast_not_rotated) AS r2;<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'>The dashed polygon is the original polygon and the filled in one is after you rotate the raster. In both cases the ST_Width and ST_Height do not change so that’s not a good measure of what is going on.<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><img border=0 width=387 height=391 style='width:4.0312in;height:4.0729in' id="Picture_x0020_1" src="cid:image001.png@01DA79E2.7B978BB0"><span style='font-size:11.0pt'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt'><o:p> </o:p></span></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Eloi Ribeiro <mail@eloiribeiro.eu> <br><b>Sent:</b> Tuesday, March 19, 2024 6:56 AM<br><b>To:</b> PostGIS Users Discussion <postgis-users@lists.osgeo.org><br><b>Subject:</b> RE: How to properly rotate a raster<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Hi all,<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Here an example with the code.<o:p></o:p></span></p></div><div><p class=MsoNormal>If you compare <u>rast_rotated_from_raster</u> with <u>rast_rotated_from_vector</u>, the latest is rotated as expected and the first is not.<o:p></o:p></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:black'>I guess, I must be doing something wrong when creating <u>rast_rotated_from_raster</u>.<o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:black'>Any guess?<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#6A9955'>-- non rotated raster</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>DROP</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>IF</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>EXISTS</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_not_rotated;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>CREATE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#DCDCAA'>public</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>.rast_not_rotated </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>AS</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> ST_AsRaster(t.geom,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>1000</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>1000</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'8BUI'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>1</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>0</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>) </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>AS</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> rast <o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>FROM</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> (</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> ST_GeomFromText(</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'POLYGON((166989.36462303242 505764.77048559673,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'> 166996.25788353998 505576.476318614,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'> 167265.54134611748 505585.94966528506,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'> 167258.67088940175 505774.2438322678,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'> 166989.36462303242 505764.77048559673))'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>28992</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>) geom) t;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ALTER</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_not_rotated </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ADD</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> COLUMN rid </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SERIAL</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>PRIMARY KEY</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>CREATE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>INDEX</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#DCDCAA'>rast_not_rotated_rast_gist</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ON</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_not_rotated </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>USING</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> gist (st_convexhull(rast));<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> AddRasterConstraints(</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'public'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>, </span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'rast_not_rotated'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'rast'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>);<o:p></o:p></span></p></div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p> </o:p></span></p><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#6A9955'>-- rotate previous raster</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>DROP</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>IF</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>EXISTS</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_rotated_from_raster;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>CREATE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#DCDCAA'>public</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>.rast_rotated_from_raster </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>AS</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> ST_SetRotation(rast, </span><span style='font-size:10.5pt;font-family:"Courier New";color:#D4D4D4'>-</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>0</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>.</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>035162353342492736</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>) rast </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>FROM</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_not_rotated;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ALTER</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_rotated_from_raster </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ADD</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> COLUMN rid </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SERIAL</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>PRIMARY KEY</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>CREATE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>INDEX</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#DCDCAA'>rast_rotated_from_raster_rast_gist</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ON</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_rotated_from_raster </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>USING</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> gist (st_convexhull(rast));<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> AddRasterConstraints(</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'public'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>, </span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'rast_rotated_from_raster'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'rast'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>);<o:p></o:p></span></p></div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p> </o:p></span></p><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#6A9955'>-- rotate polygon and then save as raster</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>DROP</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>IF</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>EXISTS</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_rotated_from_vector;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>CREATE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#DCDCAA'>public</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>.rast_rotated_from_vector </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>AS</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> ST_AsRaster(t.geom,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>1000</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>1000</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'8BUI'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>1</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>0</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>) </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>AS</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> rast <o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>FROM</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> (</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> ST_Rotate(<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> ST_GeomFromText(</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'POLYGON((166989.36462303242 505764.77048559673,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'> 166996.25788353998 505576.476318614,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'> 167265.54134611748 505585.94966528506,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'> 167258.67088940175 505774.2438322678,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'> 166989.36462303242 505764.77048559673))'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>28992</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>)<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> ,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#D4D4D4'>-</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>0</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>.</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>035162353342492736</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>, </span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>166989</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>.</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>36462303242</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>, </span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>505764</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>.</span><span style='font-size:10.5pt;font-family:"Courier New";color:#B5CEA8'>77048559673</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>) geom) t;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ALTER</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>TABLE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_rotated_from_vector </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ADD</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> COLUMN rid </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SERIAL</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>PRIMARY KEY</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>CREATE</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>INDEX</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#DCDCAA'>rast_rotated_from_vector_rast_gist</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>ON</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> public.rast_rotated_from_vector </span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>USING</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> gist (st_convexhull(rast));<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'> AddRasterConstraints(</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'public'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>, </span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'rast_rotated_from_vector'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>,</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CE9178'>'rast'</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>::</span><span style='font-size:10.5pt;font-family:"Courier New";color:#569CD6'>name</span><span style='font-size:10.5pt;font-family:"Courier New";color:#CCCCCC'>);<o:p></o:p></span></p></div></div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><div><div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Eloi<o:p></o:p></span></p></div></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div></div></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal>On Monday, March 18th, 2024 at 19:11, Eloi Ribeiro <<a href="mailto:mail@eloiribeiro.eu">mail@eloiribeiro.eu</a>> wrote:<br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Hi Regina and all,<o:p></o:p></span></p><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Elaborating a bit more. I have a vector layer consisting of a rectangle (farm plot), and this rectangle is subdivided into several (polygons) stripes parallel to the outer edge of the rectangle. I want to produce a raster where the rectangle and stripes long edges are parallel to the latitude line.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Using ST_Rotate(geom, -0.035, x, y) in all vector layers together with ST_AsRaster(), I managed to get what I want. Good.<o:p></o:p></span></p></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Nevertheless, if I first produce the raster and then try to rotated it using ST_SetRotation(rast, -0.035), I barely see any rotation. In this step, I must be doing something wrong.<o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:black'>I would like to first rasterize vector and then rotate the raster. Instead of rasterize non rotated vector and then, again rasterize rotated vector.<o:p></o:p></span></p></div><div><p class=MsoNormal style='background:white'><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:black'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt;background:white'><span style='font-size:10.5pt;font-family:"Arial",sans-serif;color:black'>The change in size (width and height), I mentioned in my first message, was while testing with 0.5 rad, not with -0.035 rad.<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- input raster</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-family:"Courier New";color:#CCCCCC'> ST_Width(rast), ST_Height(rast), ST_SkewX(rast) </span><span style='font-family:"Courier New";color:#569CD6'>FROM</span><span style='font-family:"Courier New";color:#CCCCCC'> plot_3;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- st_width | st_height | st_skewx </span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- ----------+-----------+----------</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- 1000 | 1000 | 0</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#CCCCCC'><o:p> </o:p></span></p><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- output raster of ST_SetRotation(rast, -0.035162353342492736)</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-family:"Courier New";color:#CCCCCC'> ST_Width(rast), ST_Height(rast), ST_SkewX(rast) </span><span style='font-family:"Courier New";color:#569CD6'>FROM</span><span style='font-family:"Courier New";color:#CCCCCC'> plot_3_rotated_from_raster;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- st_width | st_height | st_skewx </span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- ----------+-----------+----------------------</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- 1000 | 1000 | 0.006952538312005269</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#CCCCCC'><o:p> </o:p></span></p><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- output raster of ST_SetRotation(rast, -0.035162353342492736)</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-family:"Courier New";color:#CCCCCC'> ST_Width(rast), ST_Height(rast), ST_SkewX(rast) </span><span style='font-family:"Courier New";color:#569CD6'>FROM</span><span style='font-family:"Courier New";color:#CCCCCC'> plot_3_rotated_from_vect;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- st_width | st_height | st_skewx </span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- ----------+-----------+----------</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- 977 | 964 | 0</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#CCCCCC'><o:p> </o:p></span></p><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- output raster of ST_SetRotation(rast, -0.5)</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#569CD6'>SELECT</span><span style='font-family:"Courier New";color:#CCCCCC'> ST_Width(rast), ST_Height(rast), ST_SkewX(rast) </span><span style='font-family:"Courier New";color:#569CD6'>FROM</span><span style='font-family:"Courier New";color:#CCCCCC'> plot_3_rotated_from_raster_05;<o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- st_width | st_height | st_skewx </span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- ----------+-----------+---------------------</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div><div><p class=MsoNormal style='line-height:14.25pt;background:#1F1F1F'><span style='font-family:"Courier New";color:#6A9955'>-- 1000 | 1000 | 0.09481479675190897</span><span style='font-family:"Courier New";color:#CCCCCC'><o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal style='margin-bottom:12.0pt'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Cheers,<o:p></o:p></span></p></div><div><div><div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Eloi<o:p></o:p></span></p></div></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div></div></div><div><p class=MsoNormal><span style='font-size:10.5pt;font-family:"Arial",sans-serif'><o:p> </o:p></span></p></div><div><p class=MsoNormal>On Monday, March 18th, 2024 at 14:01, Regina Obe <<a href="mailto:lr@pcorp.us">lr@pcorp.us</a>> wrote:<br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt'>By size, what do you mean exactly? It would change the width and height.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt'>What are you expecting rotation to do. Perhaps you can give example out of the below and some sample</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt'>ST_Width, ST_Height, ST_SkewX before and after and what you were expecting.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt'><a href="https://postgis.net/docs/en/RT_ST_SetRotation.html" target="_blank">https://postgis.net/docs/en/RT_ST_SetRotation.html</a></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt'> </span><o:p></o:p></p><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> Eloi Ribeiro <<a href="mailto:mail@eloiribeiro.eu">mail@eloiribeiro.eu</a>> <br><b>Sent:</b> Monday, March 18, 2024 4:57 AM<br><b>To:</b> PostGIS Users Discussion <<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a>><br><b>Subject:</b> How to properly rotate a raster</span><o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Hi all,</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'> </span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>I need to rotate a raster, for that I'm using the function </span><code><b><span style='font-size:10.0pt'>ST_SetRotation</span></b></code><code><span style='font-size:10.0pt'>, like so:</span></code><span style='font-size:10.5pt;font-family:"Arial",sans-serif'> </span><o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;line-height:14.25pt;background:#1F1F1F'><span style='font-size:10.5pt;font-family:"Courier New";color:#6A9955'>CREATE TABLE plot_3_rotated AS <br>SELECT ST_SetRotation(rast, 0.03516235334249185) rast <br>FROM plot_3;</span><o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'> </span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>But I see that is not producing the expected results and is changing size of the raster. What am I doing wrong?<br><br>Cheers,</span><o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'> </span><o:p></o:p></p></div><div><div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'>Eloi</span><o:p></o:p></p></div></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.5pt;font-family:"Arial",sans-serif'> </span><o:p></o:p></p></div></div></div></div></div></blockquote><p class=MsoNormal><o:p> </o:p></p></div></blockquote><p class=MsoNormal><o:p> </o:p></p></div></div></div></body></html>