[Qgis-user] Display of non-axis-aligned pixels

Daniel Evans daniel.fred.evans at gmail.com
Sat Mar 11 13:32:01 PST 2023


Hi Alister,

Thanks for the response, and the link back into the history of the issue.

> I'm not even sure if a fix would involve work on QGIS itself, or gdal, or perhaps both.

I'd be a little surprised if it were GDAL doing something unexpected -
one would have to jump through a couple of extra hoops to get GDAL to
resample the raw, rotated data to north-aligned. However, I can't say
I've ever looked into any of the details of how QGIS uses it to read
rasters, and whether it's a simple read or a far more complex pipeline
(perhaps this will be a prompt to, although illiteracy in C++ is a
minor hurdle!).

Cheers,
Daniel

On Sat, 11 Mar 2023 at 07:30, Alister Hood via QGIS-User
<qgis-user at lists.osgeo.org> wrote:
>>
>> Date: Fri, 10 Mar 2023 13:52:42 +0000
>> From: Daniel Evans <daniel.fred.evans at gmail.com>
>> To: qgis-user at lists.osgeo.org
>> Subject: [Qgis-user] Display of non-axis-aligned pixels
>> Message-ID:
>>         <CANnaQaY0-e_Hio8dww88ZO-aHi4gsjSmTeRLbE0dtH_XqPsXeA at mail.gmail.com>
>> Content-Type: text/plain; charset="UTF-8"
>>
>> Hello,
>>
>> I have some raster data where the pixels are not
>> coordinate-system-aligned - i.e. the geotransform has significant
>> diagonal components. `gdalinfo` reports:
>>
>> GeoTransform =
>>   444048.6420808117, 6.302162394202463, 6.152691784443768
>>   5417729.777950762, 4.143808265940849, -3.26376570161891
>>
>> When viewing the raster in QGIS, I am surprised to find that it
>> displays the pixels as north-aligned. An example is here:
>> https://i.imgur.com/i6y1gtM.png
>>
>> If I make nodata visible, it seems that QGIS is displaying an
>> axis-aligned image corresponding to the bounding box of my original
>> image (data in white, nodata in black). Screenshot here:
>> https://i.imgur.com/ZQJ6Mi5.png
>>
>> This behaviour surprised me, as QGIS is capable of showing pixels at a
>> slant in some circumstances. For example, if I set QGIS to render
>> using a different UTM zone, the pixels are slanted - although in this
>> case, it's applying a second rotation on top of the north-aligning
>> rotation it's already applying: https://i.imgur.com/LoC7jyk.png
>>
>> 1. Is it possible to have QGIS display a raster without resampling the
>> pixels to axis-aligned?
>
>
> I don't believe so.
>
>>
>> 2. Is there a reason for making this the default (or only) behaviour?
>> It caused quite some confusion when trying to diagnose a
>> geotransform-related issue elsewhere.
>
>
> Several bug reports have been filed about this over the years, (e.g. https://github.com/qgis/QGIS/issues/23760, which should really be reopened, unless someone files a new ticket instead), and no one has ever tried to say it "should" be this way.  I'm no expert, but I presume the problem is simply that no one has been both motivated and able to do the work to fix it, or to fund someone to do it.
> I'm not even sure if a fix would involve work on QGIS itself, or gdal, or perhaps both.
>
> Regards,
> Alister
> _______________________________________________
> QGIS-User mailing list
> QGIS-User at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the QGIS-User mailing list