<div dir="ltr"><span style="font-family:monospace">$ listgeo sa.tif <br>Geotiff_Information:<br> Version: 1<br> Key_Revision: 1.0<br> Tagged_Information:<br> ModelTiepointTag (2,3):<br> 0 0 0 <br> -43632.85501 -3629566.02205 0 <br> ModelPixelScaleTag (1,3):<br> 0.27582675862069 0.275760660066007 0 <br> End_Of_Tags.<br> Keyed_Information:<br> GTModelTypeGeoKey (Short,1): ModelTypeProjected<br> GTRasterTypeGeoKey (Short,1): RasterPixelIsArea<br> GTCitationGeoKey (Ascii,24): "Hartebeesthoek94 / Lo21"<br> GeogCitationGeoKey (Ascii,17): "Hartebeesthoek94"<br> GeogAngularUnitsGeoKey (Short,1): Angular_Degree<br> ProjectedCSTypeGeoKey (Short,1): Code-2049 (Hartebeesthoek94 / Lo21)<br> ProjLinearUnitsGeoKey (Short,1): Linear_Meter<br> End_Of_Keys.<br> End_Of_Geotiff.<br><br>PCS = 2049 (Hartebeesthoek94 / Lo21)<br>Projection = 17521 (South African Survey Grid zone 21)<br>Projection Method: CT_TransvMercator_SouthOrientated<br> ProjNatOriginLatGeoKey: 0.000000 ( 0d 0' 0.00"N)<br> ProjNatOriginLongGeoKey: 21.000000 ( 21d 0' 0.00"E)<br> ProjScaleAtNatOriginGeoKey: 1.000000<br> ProjFalseEastingGeoKey: 0.000000 m<br> ProjFalseNorthingGeoKey: 0.000000 m<br>GCS: 4148/Hartebeesthoek94<br>Datum: 6148/Hartebeesthoek94<br>Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)<br>Prime Meridian: 8901/Greenwich (0.000000/ 0d 0' 0.00"E)<br>Projection Linear Units: 9001/metre (1.000000m)<br><br>Corner Coordinates:<br>proj_create: unrecognized format / unknown name<br>Upper Left ( -43632.855,-3629566.022)<br>proj_create: unrecognized format / unknown name<br>Lower Left ( -43632.855,-3629816.688)<br>proj_create: unrecognized format / unknown name<br>Upper Right ( -43272.901,-3629566.022)<br>proj_create: unrecognized format / unknown name<br>Lower Right ( -43272.901,-3629816.688)<br>proj_create: unrecognized format / unknown name<br>Center ( -43452.878,-3629691.355)</span><br><div><br></div><div>(the pixel sizes are not exactly equal because this is a downscaled version (10%). The original file had same pixel sizes.</div><div>Both use CT_TransvMercator_SouthOrientated)</div><div>The actual original file, in case it helps listed this</div><div><br></div><div><span style="font-family:monospace">Geotiff_Information:<br> Version: 1<br> Key_Revision: 1.0<br> Tagged_Information:<br> ModelTiepointTag (2,3):<br> 0 0 0 <br> -43632.85501 -3629566.02205 0 <br> ModelPixelScaleTag (1,3):<br> 0.02757 0.02757 0 <br> End_Of_Tags.<br> Keyed_Information:<br> GTModelTypeGeoKey (Short,1): ModelTypeProjected<br> GTRasterTypeGeoKey (Short,1): RasterPixelIsArea<br> GTCitationGeoKey (Ascii,24): "Hartebeesthoek94 / Lo21"<br> GeogCitationGeoKey (Ascii,17): "Hartebeesthoek94"<br> GeogAngularUnitsGeoKey (Short,1): Angular_Degree<br> ProjectedCSTypeGeoKey (Short,1): Code-2049 (Hartebeesthoek94 / Lo21)<br> ProjLinearUnitsGeoKey (Short,1): Linear_Meter<br> End_Of_Keys.<br> End_Of_Geotiff.<br><br>PCS = 2049 (Hartebeesthoek94 / Lo21)<br>Projection = 17521 (South African Survey Grid zone 21)<br>Projection Method: CT_TransvMercator_SouthOrientated<br> ProjNatOriginLatGeoKey: 0.000000 ( 0d 0' 0.00"N)<br> ProjNatOriginLongGeoKey: 21.000000 ( 21d 0' 0.00"E)<br> ProjScaleAtNatOriginGeoKey: 1.000000<br> ProjFalseEastingGeoKey: 0.000000 m<br> ProjFalseNorthingGeoKey: 0.000000 m<br>GCS: 4148/Hartebeesthoek94<br>Datum: 6148/Hartebeesthoek94<br>Ellipsoid: 7030/WGS 84 (6378137.00,6356752.31)<br>Prime Meridian: 8901/Greenwich (0.000000/ 0d 0' 0.00"E)<br>Projection Linear Units: 9001/metre (1.000000m)<br><br>Corner Coordinates:<br>proj_create: unrecognized format / unknown name<br>Upper Left ( -43632.855,-3629566.022)<br>proj_create: unrecognized format / unknown name<br>Lower Left ( -43632.855,-3629816.688)<br>proj_create: unrecognized format / unknown name<br>Upper Right ( -43272.901,-3629566.022)<br>proj_create: unrecognized format / unknown name<br>Lower Right ( -43272.901,-3629816.688)<br>proj_create: unrecognized format / unknown name<br>Center ( -43452.878,-3629691.355)</span></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, 25 Sept 2025 at 17:50, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
<p>Javier,</p>
<p>can you post the output of "listgeo sa.tif" (on the original
GeoTIFF) ? It would be interesting to see if they correctly use
the CT_TransvMercator_SouthOrientated ProjCoordTransGeoKey</p>
<p>I don't remember a change that would explicily try to respect the
negative sign of the x-pixelsize parameter in gdalwarp as those
are rather untypical, but it might be a side effect of other
changes. For those untypical geotransforms, QGIS will use GDAL's
AutoWarpVRT functionality, which indeed has a runtime cost.</p>
<p>You may generate a "correctly" oriented file by specifying
explicit -te to gdalwarp</p>
<p>Even<br>
</p>
<div>Le 25/09/2025 à 17:24, Javier Jimenez
Shaw via gdal-dev a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>I got a GeoTIFF from South Africa that is displayed in the
Mediterranean sea in QGIS.</div>
<div><br>
</div>
<div><span style="font-family:monospace">$ gdalinfo sa.tif <br>
Driver: GTiff/GeoTIFF<br>
Files: sa.tif<br>
Size is 1305, 909<br>
Coordinate System is:<br>
PROJCRS["Hartebeesthoek94 / Lo21",<br>
BASEGEOGCRS["Hartebeesthoek94",</span></div>
<div><span style="font-family:monospace">...<br>
ID["EPSG",2049]]<br>
Data axis to CRS axis mapping: 1,2<br>
Origin = (-43632.855010000006587,-3629566.022050000261515)<br>
Pixel Size = (0.275826758620690,-0.275760660066007)<br>
Metadata:<br>
AREA_OR_POINT=Area<br>
TIFFTAG_SOFTWARE=pix4dmapper<br>
Image Structure Metadata:<br>
COMPRESSION=LZW<br>
INTERLEAVE=PIXEL<br>
PREDICTOR=2</span><br>
<br>
</div>
<div>As you can see, the Origin is very negative, and in Lo21 it
should be positive.</div>
<div>Ok, lets change the geotransform parameters:</div>
<div><br>
</div>
<div><span style="font-family:monospace">$ gdal_translate -a_gt
43632.8550100000 -0.275760660 0 3629566.0220500 0 0.27576066
-co COMPRESS=LZW -co PREDICTOR=2 sa.tif sa.located.tif</span></div>
<div><span style="font-family:monospace">$ gdalinfo
sa.located.tif <br>
Driver: GTiff/GeoTIFF<br>
Files: sa.located.tif<br>
Size is 1305, 909<br>
Coordinate System is:<br>
PROJCRS["Hartebeesthoek94 / Lo21",<br>
BASEGEOGCRS["Hartebeesthoek94",<br>
DATUM["Hartebeesthoek94",<br>
...<br>
ID["EPSG",2049]]<br>
Data axis to CRS axis mapping: 1,2<br>
Origin = (43632.855009999999311,3629566.022049999795854)<br>
Pixel Size = (-0.275760660000000,0.275760660000000)</span><br>
<br>
</div>
<div>That appears properly located in QGIS. But I think that due
to the signs in the pixel size, it is performing really bad
(it is not doing some optimizations)</div>
<div><br>
</div>
<div>I run gdalwarp hoping that it changes it. And it does in
GDAL 3.8.4</div>
<div><span style="font-family:monospace">$ gdalinfo --version<br>
GDAL 3.8.4, released 2024/02/08</span></div>
<div><span style="font-family:monospace">$ gdalwarp
sa.located.tif sa.cog.3.8.4.tif -of COG<br>
$ gdalinfo sa.cog.3.8.4.tif<br>
Driver: GTiff/GeoTIFF<br>
Files: sa.cog.3.8.4.tif<br>
Size is 1305, 909<br>
Coordinate System is:<br>
PROJCRS["Hartebeesthoek94 / Lo21",<br>
BASEGEOGCRS["Hartebeesthoek94",<br>
ID["EPSG",2049]]<br>
Data axis to CRS axis mapping: 1,2<br>
Origin = (43272.987348700000439,3629816.688489940017462)<br>
Pixel Size = (0.275760660000079,-0.275760660000079)</span></div>
<div><br>
</div>
<div>See how it changes the origin and the signs of the pixel
size</div>
<div><br>
</div>
<div>However in 3.11.4 it is different</div>
<div><span style="font-family:monospace"><br>
</span></div>
<div><span style="font-family:monospace">$ gdalinfo
sa.cog.3.11.4.tif<br>
Driver: GTiff/GeoTIFF<br>
Files: sa.cog.3.11.4.tif<br>
Size is 1305, 909<br>
Coordinate System is:<br>
PROJCRS["Hartebeesthoek94 / Lo21",<br>
BASEGEOGCRS["Hartebeesthoek94",<br>
...<br>
ID["EPSG",2049]]<br>
Data axis to CRS axis mapping: 1,2<br>
Origin = (43632.855009999999311,3629816.688489940017462)<br>
Pixel Size = (-0.275760660000000,-0.275760660000000)</span><br>
<br>
</div>
<div>Having the negative pixel size for the first coordinate is
affecting the performance in QGIS? </div>
<div><br>
</div>
<div>Is there a better way to do all this?</div>
<div><br>
</div>
<div>Thank you,</div>
<div>Javier</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote></div>