PostGIS
Description
Returns the uniform rotation of the raster in radian. If a raster does not have uniform rotation, NaN is returned. Refer to World File for more details.
Examples
SELECT rid, ST_Rotation(ST_SetScale(ST_SetSkew(rast, sqrt(2)), sqrt(2))) as rot FROM dummy_rast;
rid | rot
-----+-------------------
1 | 0.785398163397448
2 | 0.785398163397448