I can't load a georeferenced/skewed raster in QGIS if it is stored in a PostGIS database.
For some reasons, I need to create a skewed raster in a PostGIS database, and use it in my custom application. Firstly, I can create a raster in PostGIS like this:
create table grids( rid serial primary key, rdata raster ); create index idx_grids on grids using gist(ST_ConvexHull(rdata)); -- Parameters: width, height, upperleft-x, upperleft-y, scale-x, scale-y (almost always negative), skew-x, skew-y, EPSG insert into grids(rid,rdata) values (1, ST_MakeEmptyRaster(1000,2000,690000.5,4299999.5,12.5*sqrt(2),-6.25*sqrt(2),-6.25*sqrt(2),-12.5*sqrt(2),4509) update grids set rdata=ST_AddBand(rdata, '32BSI'::text, 128) where rid=1;
It should produce a raster that's square, but rotated by 45 degrees.
Then, I could draw a small rectangle by using
update grids set rdata=ST_SetValues(rdata,1,200,200,50,50,255)
But when I load the raster into QGIS, the raster is shown upright rather than skewed.
I'm using QGIS 3.14.16 and PostgreSQL 12/PostGIS 3.0 under Windows 10 2004.
Is that the limitation of QGIS itself or its underlying libraries like GDAL? Or if there's anything wrong with my SQL syntax?