<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi all,
<div class=""><br class="">
</div>
<div class="">Many thanks for your help Jukka, much appreciated!</div>
<div class=""><br class="">
</div>
<div class="">What you are saying is indeed very probably the cause. When using gdal_edit, the tif indeed remains on the location I expect it to be, after reprojecting and tiling. </div>
<div class=""><br class="">
</div>
<div class="">So this might actually also show bugs/weird behaviour in both QGIS and rasterio?</div>
<div class="">- QGIS displaying the original file on the correct location -> it probably looks at the EPSG and not the full (kinda-off) WKT string then, correct? Should this be reported?</div>
<div class="">- Rasterio reporting the EPSG as well wrongly, not sure if this is a confidence issue and if this should be reported as well?</div>
<div class=""><br class="">
</div>
<div class="">The issue is solved for me with this workaround, but if anyone on this list believes I should raise the above points somewhere else, let me know and I can take this up. </div>
<div class=""><br class="">
</div>
<div class="">Greetings<br class="">
<div><br class="">
<blockquote type="cite" class="">
<div class="">On 12 Nov 2020, at 09:39, Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" class="">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="WordSection1" style="page: WordSection1; caret-color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class="">Hi,<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">Yes, envelopes should grow every time when the raster is rotated, but they should overlap. If they move like they do in your case, something seems to go wrong. I can only say that obviously Proj is seeing some difference between
 the projection that is stored into your GeoTIFF and what it thinks that EPSG:27573 means. By comparing the WKT text from your mail with the printout of “projinfo epsg:27573” (with Proj version 6.3.2) I can see these differences:<br class="">
<br class="">
Image<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">--------<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">CONVERSION["unnamed",<br class="">
PARAMETER["Latitude of natural origin",54.4444444444445,<br class="">
<br class="">
Proj<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">-----<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">CONVERSION["Lambert zone III",<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">PARAMETER["Latitude of natural origin",49,<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">Experts on the French coordinate systems and Proj may continue from this, I fear I can’t help more than this. And you are right that using “-s_srs” in gdalwarp overrides the projection that is stored into GeoTIFF tags. If the result
 is good you can use that as a workaround. It is also possible to update the geotiff tags with “gdal_edit -a_srs epsg:27573” but before that you should be sure that it is the right thing to do.<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class=""><o:p class=""> </o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class="">-Jukka Rahkonen-<o:p class=""></o:p></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span lang="EN-US" class=""><o:p class=""> </o:p></span></div>
<div class="">
<div style="border-style: solid none none; border-top-width: 1pt; border-top-color: rgb(225, 225, 225); padding: 3pt 0cm 0cm;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<b class="">Lähettäjä:</b><span class="Apple-converted-space"> </span>Evert Etienne (SITEMARK) <<a href="mailto:evert.etienne@sitemark.com" style="color: blue; text-decoration: underline;" class="">evert.etienne@sitemark.com</a>><span class="Apple-converted-space"> </span><br class="">
<b class="">Lähetetty:</b><span class="Apple-converted-space"> </span>torstai 12. marraskuuta 2020 10.00<br class="">
<b class="">Vastaanottaja:</b><span class="Apple-converted-space"> </span>Rahkonen Jukka (MML) <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" style="color: blue; text-decoration: underline;" class="">jukka.rahkonen@maanmittauslaitos.fi</a>><br class="">
<b class="">Aihe:</b><span class="Apple-converted-space"> </span>Re: [gdal-dev] Location change on gdalwarp reprojection<o:p class=""></o:p></div>
</div>
</div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Hi<span class="Apple-converted-space"> </span><o:p class=""></o:p></div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Thanks for your response Jukka!<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Your first explanation about the bounds make sense, but shouldn’t they still be in the same area (overlapping)?<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
When specifying the source epsg as EPSG:27573, there is indeed no changes anymore as visible in the following logs:<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
(Am I correct for thinking this is actually just equivalent to overwriting the CRS included in the tif?)<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
```<o:p class=""></o:p></div>
</div>
<div class="">
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
orig.tif<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
EPSG:27573<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
bounds [828662.0710931281, 3203193.9700861075, 829595.8710931281, 3204344.6700861077]<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
EPSG:27573 bounds [828662.0710931281, 3203193.9700861075, 829595.8710931281, 3204344.6700861077]<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
EPSG:3857 bounds [578066.9358574335, 5479808.142856716, 579420.0775091586, 5481457.907968456]<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
EPSG:4326 bounds [5.192863637248721, 44.09275933293886, 5.205019115521942, 44.103402376252255]<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
gdalwarp -s_srs EPSG:27573 -t_srs EPSG:27573 orig.tif from_27573_into_27573.tif<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
from_27573_into_27573.tif<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
EPSG:27573<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
bounds [828662.0710931281, 3203193.9700861075, 829595.8710931282, 3204344.6700861077]<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
EPSG:27573 bounds [828662.0710931281, 3203193.9700861075, 829595.8710931282, 3204344.6700861077]<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
EPSG:3857 bounds [578066.9358574335, 5479808.142856716, 579420.0775091586, 5481457.907968456]<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
EPSG:4326 bounds [5.192863637248721, 44.09275933293886, 5.205019115521945, 44.103402376252255]<o:p class=""></o:p></div>
</div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
```<o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
So you’re suggesting the included CRS in orig.tif does not match <span style="" class="">EPSG:27573 perfectly then? Would this be a mismatch in the WKT string then?</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="" class=""><br class="">
<br class="">
</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
I am still a bit lost how this would cause that in QGIS the orig.tif and repro.tif show up in a totally different location where <span style="" class="">orig.tif</span> is where I would expect it to be. <o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
And as well why rasterio reads the CRS as being <span style="" class="">EPSG:27573 (see logs), but that might be a separate issue?</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="" class=""><br class="">
<br class="">
</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="" class="">Many thanks</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="" class=""><br class="">
<br class="">
</span><o:p class=""></o:p></div>
</div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
</div>
<div class="">
<div class="">
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
On 11 Nov 2020, at 22:38, jratike80 <<a href="mailto:jukka.rahkonen@maanmittauslaitos.fi" style="color: blue; text-decoration: underline;" class="">jukka.rahkonen@maanmittauslaitos.fi</a>> wrote:<o:p class=""></o:p></div>
</div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<o:p class=""> </o:p></div>
<div class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">Hi,<br class="">
<br class="">
The bounds do not mean exactly what you think. Re-projecting a rectangular<br class="">
image from EPSG:27573 into EPSG:4326 rotates the image somewhat<br class="">
counter-clockwise. This image is from another context<br class="">
</span><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.usgs.gov%2Fmedia%2Fimages%2Flandsat-1-8-landsatlook-image-examples&data=04%7C01%7Cevert.etienne%40sitemark.com%7Cfeaf0ee3588b4e52d2b408d886e68280%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407671880779985%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=wLYFUkTxcVuEAQ39eI0pG4ZDMvv8%2FCFilZOrrPBGymY%3D&reserved=0" originalsrc="https://www.usgs.gov/media/images/landsat-1-8-landsatlook-image-examples" shash="oR1K5DiLwKNT06pg/n3i53GHpQDO/E3UtpVWO77eRHC7cJXUkZj8CYkyO3F18/H5gTMPzvbPjEe4HHP9YQIIpufEIz1KPH3ODD9qAyC9nJIIU7uomEQBGPXhHakHbNi5yHpDaVfpDAUzSccclevf7OfTAFqXtLwnOEcLOHkA69c=" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.usgs.gov%2Fmedia%2Fimages%2Flandsat-1-8-landsatlook-image-examples&amp;data=04%7C01%7Cevert.etienne%40sitemark.com%7C3300bad68a154491a2d308d8868a300f%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407275358259724%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=IIj2gHAu18%2Fd%2F%2BJyxHQxutxFg%2F0cqzNwSgIhNkEyNF8%3D&amp;reserved=0</span></a><span class="apple-converted-space"><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""> </span></span><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">but<br class="">
you can get the idea. The new bounds report the min-max coordinates of the<br class="">
envelope that contains that rotated image. The corners of the original image<br class="">
are not at the corners of the warped image. That explains why WGS 84 bounds<br class="">
in EPSG:3857 are different.<br class="">
<br class="">
The difference when you warp to EPSG:27573  may mean that the coordinate<br class="">
system of the original image is not EPSG:27573, at least not for the Proj<br class="">
library. What happens with command:<br class="">
<br class="">
gdalwarp -s_srs EPSG:27573 -t_srs EPSG:27573 orig.tif<br class="">
from_27573_into_27573.tif<br class="">
<br class="">
-Jukka Rahkonen-<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
Evert Etienne (SITEMARK) wrote<br style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<br class="">
</span><o:p class=""></o:p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">It does not happen when just warping, but it does occur when warping to<br class="">
the same EPSG as can be seen in the follow logs<br class="">
```<br class="">
orig.tif<br class="">
EPSG:27573<br class="">
bounds [828662.0710931281, 3203193.9700861075, 829595.8710931281,<br class="">
3204344.6700861077]<br class="">
EPSG:27573 bounds [828662.0710931281, 3203193.9700861075,<br class="">
829595.8710931281, 3204344.6700861077]<br class="">
EPSG:3857 bounds [578066.9358574335, 5479808.142856716, 579420.0775091586,<br class="">
5481457.907968456]<br class="">
EPSG:4326 bounds [5.192863637248721, 44.09275933293886, 5.205019115521942,<br class="">
44.103402376252255] <----- OK<br class="">
gdalwarp orig.tif justwarp.tif<br class="">
justwarp.tif<br class="">
EPSG:27573<br class="">
bounds [828662.0710931281, 3203193.9700861075, 829595.8710931282,<br class="">
3204344.6700861077]<br class="">
EPSG:27573 bounds [828662.0710931281, 3203193.9700861075,<br class="">
829595.8710931282, 3204344.6700861077]<br class="">
EPSG:3857 bounds [578066.9358574335, 5479808.142856716, 579420.0775091586,<br class="">
5481457.907968456]<br class="">
EPSG:4326 bounds [5.192863637248721, 44.09275933293886, 5.205019115521945,<br class="">
44.103402376252255] <----- SAME<br class="">
gdalwarp -t_srs EPSG:27573 orig.tif noreproj.tif<br class="">
noreproj.tif<br class="">
EPSG:27573<br class="">
bounds [829527.7905651039, 3748136.6066527413, 830468.8074871361,<br class="">
3749294.6346238866]<br class="">
EPSG:27573 bounds [829527.7905651039, 3748136.6066527413,<br class="">
830468.8074871361, 3749294.6346238866]<br class="">
EPSG:3857 bounds [608015.3560148155, 6272484.6841915725,<br class="">
609507.2374494626, 6274297.96416575]<br class="">
EPSG:4326 bounds [5.461894872874811, 48.98599094207838, 5.475296671823179,<br class="">
48.99667932763942] <----- CHANGED<br class="">
```<br class="">
<br class="">
GDAL info of orig.tif:<br class="">
```<br class="">
Driver: GTiff/GeoTIFF<br class="">
Files: orig.tif<br class="">
Size is 18676, 23014<br class="">
Coordinate System is:<br class="">
PROJCRS["NTF (Paris) / Lambert zone III",<br class="">
   BASEGEOGCRS["NTF (Paris)",<br class="">
       DATUM["Nouvelle Triangulation Francaise (Paris)",<br class="">
           ELLIPSOID["Clarke 1880 (IGN)",6378249.2,293.466021293627,<br class="">
               LENGTHUNIT["metre",1]]],<br class="">
       PRIMEM["Paris",2.5969213,<br class="">
           ANGLEUNIT["grad",0.0157079632679489]],<br class="">
       ID["EPSG",4807]],<br class="">
   CONVERSION["unnamed",<br class="">
       METHOD["Lambert Conic Conformal (1SP)",<br class="">
           ID["EPSG",9801]],<br class="">
       PARAMETER["Latitude of natural origin",54.4444444444445,<br class="">
           ANGLEUNIT["grad",0.0157079632679489],<br class="">
           ID["EPSG",8801]],<br class="">
       PARAMETER["Longitude of natural origin",0,<br class="">
           ANGLEUNIT["grad",0.0157079632679489],<br class="">
           ID["EPSG",8802]],<br class="">
       PARAMETER["Scale factor at natural origin",0.999877499,<br class="">
           SCALEUNIT["unity",1],<br class="">
           ID["EPSG",8805]],<br class="">
       PARAMETER["False easting",600000,<br class="">
           LENGTHUNIT["metre",1],<br class="">
           ID["EPSG",8806]],<br class="">
       PARAMETER["False northing",3200000,<br class="">
           LENGTHUNIT["metre",1],<br class="">
           ID["EPSG",8807]]],<br class="">
   CS[Cartesian,2],<br class="">
       AXIS["easting",east,<br class="">
           ORDER[1],<br class="">
           LENGTHUNIT["metre",1]],<br class="">
       AXIS["northing",north,<br class="">
           ORDER[2],<br class="">
           LENGTHUNIT["metre",1]],<br class="">
   ID["EPSG",27573]]<br class="">
Data axis to CRS axis mapping: 1,2<br class="">
Origin = (828662.071093128062785,3204344.670086107682437)<br class="">
Pixel Size = (0.050000000000002,-0.050000000000008)<br class="">
Metadata:<br class="">
 AREA_OR_POINT=Area<br class="">
Image Structure Metadata:<br class="">
 COMPRESSION=LZW<br class="">
 INTERLEAVE=PIXEL<br class="">
Corner Coordinates:<br class="">
Upper Left  (  828662.071, 3204344.670) (  3d 7'33.28"E, 48d59'48.23"N)<br class="">
Lower Left  (  828662.071, 3203193.970) (  3d 7'30.95"E, 48d59'11.01"N)<br class="">
Upper Right (  829595.871, 3204344.670) (  3d 8'19.19"E, 48d59'46.98"N)<br class="">
Lower Right (  829595.871, 3203193.970) (  3d 8'16.85"E, 48d59' 9.76"N)<br class="">
Center      (  829128.971, 3203769.320) (  3d 7'55.07"E, 48d59'28.99"N)<br class="">
Band 1 Block=256x256 Type=Byte, ColorInterp=Red<br class="">
 Overviews: 9338x11507, 4669x5754, 2335x2877, 1168x1439, 584x720,<br class="">
292x360, 146x180<br class="">
 Mask Flags: PER_DATASET ALPHA<span class="apple-converted-space"> </span><br class="">
 Overviews of mask band: 9338x11507, 4669x5754, 2335x2877, 1168x1439,<br class="">
584x720, 292x360, 146x180<br class="">
 Unit Type: metre<br class="">
Band 2 Block=256x256 Type=Byte, ColorInterp=Green<br class="">
 Overviews: 9338x11507, 4669x5754, 2335x2877, 1168x1439, 584x720,<br class="">
292x360, 146x180<br class="">
 Mask Flags: PER_DATASET ALPHA<span class="apple-converted-space"> </span><br class="">
 Overviews of mask band: 9338x11507, 4669x5754, 2335x2877, 1168x1439,<br class="">
584x720, 292x360, 146x180<br class="">
 Unit Type: metre<br class="">
Band 3 Block=256x256 Type=Byte, ColorInterp=Blue<br class="">
 Overviews: 9338x11507, 4669x5754, 2335x2877, 1168x1439, 584x720,<br class="">
292x360, 146x180<br class="">
 Mask Flags: PER_DATASET ALPHA<span class="apple-converted-space"> </span><br class="">
 Overviews of mask band: 9338x11507, 4669x5754, 2335x2877, 1168x1439,<br class="">
584x720, 292x360, 146x180<br class="">
 Unit Type: metre<br class="">
Band 4 Block=256x256 Type=Byte, ColorInterp=Alpha<br class="">
 Overviews: 9338x11507, 4669x5754, 2335x2877, 1168x1439, 584x720,<br class="">
292x360, 146x180<br class="">
 Unit Type: metre<br class="">
```<br class="">
<br class="">
<br class="">
<o:p class=""></o:p></span></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">On 11 Nov 2020, at 20:32, Evert Etienne (SITEMARK) &lt;<o:p class=""></o:p></span></div>
</blockquote>
</blockquote>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<br class="">
</span><o:p class=""></o:p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">evert.etienne@<o:p class=""></o:p></span></div>
</blockquote>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<br class="">
</span><o:p class=""></o:p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">&gt; wrote:<br class="">
<br class="">
<o:p class=""></o:p></span></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<p class="MsoNormal" style="margin: 0cm 0cm 12pt; font-size: 11pt; font-family: Calibri, sans-serif;">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">
<br class="">
Hey all,<br class="">
<br class="">
I have some behaviour that I can’t wrap my head around. When I reproject<br class="">
a tif using gdalwarp, the location (as visible in QGIS or after using<br class="">
gdal2tiles on a map) changes. It is visible when checking the bounds<br class="">
using QGIS.<br class="">
It is also noticeable when checking the bounds with rasterio:<br class="">
<br class="">
```<br class="">
orig.tif<br class="">
EPSG:27573<br class="">
bounds [828662.0710931281, 3203193.9700861075, 829595.8710931281,<br class="">
3204344.6700861077]<br class="">
EPSG:27573 bounds [828662.0710931281, 3203193.9700861075,<br class="">
829595.8710931281, 3204344.6700861077]<br class="">
EPSG:3857 bounds [578066.9358574335, 5479808.142856716,<br class="">
579420.0775091586, 5481457.907968456]<br class="">
EPSG:4326 bounds [5.192863637248721, 44.09275933293886,<br class="">
5.205019115521942, 44.103402376252255] <----- 1<br class="">
gdalwarp -t_srs EPSG:3857 orig.tif repro.tif<br class="">
repro.tif<br class="">
EPSG:3857<br class="">
bounds [608015.5294828439, 6272484.913981743, 609507.0864301398,<br class="">
6274297.75045133]<br class="">
EPSG:27573 bounds [829484.0038619096, 3748101.0103735547,<br class="">
830512.7970793804, 3749330.248761157]<br class="">
EPSG:3857 bounds [608015.5294828439, 6272484.913981743,<br class="">
609507.0864301398, 6274297.75045133]<br class="">
EPSG:4326 bounds [5.46189643116462, 48.98599229672266, 5.475295315193526,<br class="">
48.99667806803407]  <----- 2<br class="">
gdalwarp -t_srs EPSG:27573 repro.tif back.tif<br class="">
back.tif<br class="">
EPSG:27573<br class="">
bounds [829484.0038619096, 3748101.034601565, 830512.7912119445,<br class="">
3749330.2487611575]<br class="">
EPSG:27573 bounds [829484.0038619096, 3748101.034601565,<br class="">
830512.7912119445, 3749330.2487611575]<br class="">
EPSG:3857 bounds [607947.003095218, 6272428.113526381, 609575.9130150724,<br class="">
6274354.58877996]<br class="">
EPSG:4326 bounds [5.461280848150926, 48.98565744919683,<br class="">
5.475913594925499, 48.99701306471833]  <----- 3<br class="">
```<br class="">
<br class="">
The accompanying python code is three times like the following<br class="">
```<br class="">
input_file = folder + 'orig.tif'<br class="">
img = rasterio.open(input_file)<br class="">
print('orig.tif')<br class="">
print(img.crs)<br class="">
print('bounds', list(warp.transform_bounds(img.crs, img.crs,<br class="">
*img.bounds)))<br class="">
print('EPSG:27573 bounds',list(warp.transform_bounds(img.crs,<br class="">
'EPSG:27573', *img.bounds)))<br class="">
print('EPSG:3857 bounds',list(warp.transform_bounds(img.crs, 'EPSG:3857',<br class="">
*img.bounds)))<br class="">
print('EPSG:4326 bounds', list(warp.transform_bounds(img.crs,<br class="">
'EPSG:4326', *img.bounds)))<br class="">
```<br class="">
<br class="">
As the arrows show, the bounds change between 1 and 2 (this is the<br class="">
unexpected behaviour for me). Yet they don’t change when projecting back.<br class="">
<br class="">
I am unsure if this is a bug in GDAL, something weird with this specific<br class="">
EPSG or the source tif. Any further steps for investigation or ideas<br class="">
would be very welcome<br class="">
<br class="">
Many thanks<br class="">
<br class="">
Evert<br class="">
_______________________________________________<br class="">
gdal-dev mailing list<o:p class=""></o:p></span></p>
</blockquote>
</blockquote>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<br class="">
</span><o:p class=""></o:p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><a href="mailto:gdal-dev@.osgeo" style="color: blue; text-decoration: underline;" class="">gdal-dev@.osgeo</a><o:p class=""></o:p></span></div>
</blockquote>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<br class="">
</span><o:p class=""></o:p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=04%7C01%7Cevert.etienne%40sitemark.com%7Cfeaf0ee3588b4e52d2b408d886e68280%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407671880789981%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GN7KZj2sVcynjI0PY9hLgKo3gY60ivKbne4HAs1kTtY%3D&reserved=0" originalsrc="https://lists.osgeo.org/mailman/listinfo/gdal-dev" shash="n1FwSW56GPs89OKN27hT2z9iE08hqme0YGxsX/qncbhJWg2nVFSFUNEFgwjQmVHpPX7uW8NagEUEEMjpVR6hqB5zAvxeFrUJ0xV4v6puE3zZ/8kHlHD0gm6ONbCaFDfxbwtS/+cxdhsDxtMLlyMKqhzf9GLaUBKSM0XCE9JBVKo=" style="color: blue; text-decoration: underline;" class="">https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&amp;data=04%7C01%7Cevert.etienne%40sitemark.com%7C3300bad68a154491a2d308d8868a300f%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407275358259724%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=WcvmUQ4g9%2FEBwzFxF4d4vWX3OlQwQmVvyNUAVCvrj4A%3D&amp;reserved=0</a><o:p class=""></o:p></span></div>
</blockquote>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">
_______________________________________________<br class="">
gdal-dev mailing list<o:p class=""></o:p></span></div>
</blockquote>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<br class="">
</span><o:p class=""></o:p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><a href="mailto:gdal-dev@.osgeo" style="color: blue; text-decoration: underline;" class="">gdal-dev@.osgeo</a><o:p class=""></o:p></span></div>
</blockquote>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br style="caret-color: rgb(0, 0, 0); font-variant-caps: normal; text-align: start; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class="">
<br class="">
</span><o:p class=""></o:p></div>
<blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=04%7C01%7Cevert.etienne%40sitemark.com%7Cfeaf0ee3588b4e52d2b408d886e68280%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407671880789981%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GN7KZj2sVcynjI0PY9hLgKo3gY60ivKbne4HAs1kTtY%3D&reserved=0" originalsrc="https://lists.osgeo.org/mailman/listinfo/gdal-dev" shash="n1FwSW56GPs89OKN27hT2z9iE08hqme0YGxsX/qncbhJWg2nVFSFUNEFgwjQmVHpPX7uW8NagEUEEMjpVR6hqB5zAvxeFrUJ0xV4v6puE3zZ/8kHlHD0gm6ONbCaFDfxbwtS/+cxdhsDxtMLlyMKqhzf9GLaUBKSM0XCE9JBVKo=" style="color: blue; text-decoration: underline;" class="">https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&amp;data=04%7C01%7Cevert.etienne%40sitemark.com%7C3300bad68a154491a2d308d8868a300f%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407275358259724%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=WcvmUQ4g9%2FEBwzFxF4d4vWX3OlQwQmVvyNUAVCvrj4A%3D&amp;reserved=0</a><o:p class=""></o:p></span></div>
</blockquote>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">
<br class="">
<br class="">
<br class="">
<br class="">
--<br class="">
Sent from:<span class="apple-converted-space"> </span></span><a href="https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fosgeo-org.1560.x6.nabble.com%2FGDAL-Dev-f3742093.html&data=04%7C01%7Cevert.etienne%40sitemark.com%7Cfeaf0ee3588b4e52d2b408d886e68280%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407671880799978%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=J1bgclpj07UjPCNxgrKT5YFXE1rEyr7LUaeHBlNMx30%3D&reserved=0" originalsrc="http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html" shash="Fbiu6OZvxErweezbPxwBml+LKLAmxFXKtx27kelm7ADZYV4hrHQ0hxRLMPjsRmj6mSKXgVWtW831XVEkxDFYGnJF23VfYzq/yUhZcqKYs7Jd1OWq9N+bdWicaxoARYivWCY+C7qPo17IPfvwyDw082HL4Ed9y/dE3PrzoPz5qt0=" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">https://eur03.safelinks.protection.outlook.com/?url=http%3A%2F%2Fosgeo-org.1560.x6.nabble.com%2FGDAL-Dev-f3742093.html&amp;data=04%7C01%7Cevert.etienne%40sitemark.com%7C3300bad68a154491a2d308d8868a300f%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407275358259724%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=3FP%2Fo4GIWEzFS9CUz0cjEVbT02XPgKCoTnI%2F6EC%2Bhzw%3D&amp;reserved=0</span></a><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">
_______________________________________________<br class="">
gdal-dev mailing list<br class="">
</span><a href="mailto:gdal-dev@lists.osgeo.org" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">gdal-dev@lists.osgeo.org</span></a><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">
</span><a href="https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&data=04%7C01%7Cevert.etienne%40sitemark.com%7Cfeaf0ee3588b4e52d2b408d886e68280%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407671880799978%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=yVbmyGYQELLIeKqcepWFSvuSoSlrC9KRTW8%2BDIaN0t4%3D&reserved=0" originalsrc="https://lists.osgeo.org/mailman/listinfo/gdal-dev" shash="GOZqWidVW6pHLm3uOgLHOYVAGRodiz4IMZ/N+lYlVO0DPBeOSk2/VNyO+G9PJJq7CR1JRVOlElcQybjJU5eRNcZJpVjUg18U8hggDWLVmmryhF1gsUaTd2f7TJCdTX5bACBSap28/IbMqODWwghKu6EBQyN4FetejibXgSvzr7E=" style="color: blue; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.osgeo.org%2Fmailman%2Flistinfo%2Fgdal-dev&amp;data=04%7C01%7Cevert.etienne%40sitemark.com%7C3300bad68a154491a2d308d8868a300f%7Cfc89adff07ac47008853b7b7e906068e%7C0%7C0%7C637407275358259724%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=WcvmUQ4g9%2FEBwzFxF4d4vWX3OlQwQmVvyNUAVCvrj4A%3D&amp;reserved=0</span></a></div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>