<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Giovanni,</p>
    <p>gdalwarp takes the absolute value of the second tr value, so -tr
      10 -10 is understood as -tr 10 10</p>
    <p>It is expected that gdalinfo reports a negative value for the
      pixel size factor for the vertical axis, as in GeoTIFF when the
      image is north-up, the first line of the image is intended to be
      the one displayed at the top of your screen, and as the line
      number of your screen increase from the top of your screen to the
      bottom, northings or latitudes increase from the bottom to the
      top, hence the negative sign...</p>
    <p>More detailed equivalent explanation at
      <a class="moz-txt-link-freetext" href="https://gis.stackexchange.com/a/229807/218992">https://gis.stackexchange.com/a/229807/218992</a> (you can ignore the
      paragraph "As to why the image flipped..." which is specific to
      the question in that stackexchange thread)<br>
    </p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 19/11/2023 à 02:15, Giovanni
      Anconitano via gdal-dev a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CADpTLOmJ9mNDPG4Ht4_OoFEXLxATtiVhnbNv+miNeGC+1iKkBg@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <div dir="ltr">Hello,<br>
        <br>
        I have a question about how to properly set the -tr flag when
        using gdalwarp.<br>
        In particular, I'm using gdalwarp for resampling a GeoTiff from
        its original resolution to a target resolution. <br>
        Let's consider, for simplicity, the original pixel size equal to
        (5m, 5m) and the target resolution equal to (10m, 10m).<br>
        <br>
        This is the command I use: gdalwarp -tr 10 -10 input.tif
        output.tif<br>
        <br>
        I'm using a negative <yres> because when I open the
        GeoTiff file in QGIS, or if I use gdalinfo, I get a pixel size
        equal to (5, -5) for the source raster.<br>
        <br>
        Is it correct to use a negative <yres> with gdalwarp? I
        also tried -tr 10 10, but the result seems to be the same as the
        case in which I use -tr 10 -10.<br>
        In both cases gdalinfo and QGIS display (10,-10) as the pixel
        size.<br>
        <br>
        How does gdalwarp treat a negative yres value?<br>
        <br>
        <div>Thank you</div>
        <div><br>
        </div>
        <div>Giovanni<br>
        </div>
      </div>
      <br>
      <div
style="font-size:small;font-family:arial;background-color:rgb(255,255,255)"><span><span><span><span></span></span></span></span><b>
          <div><font color="#ff0000"><b>Fai crescere le giovani
                ricercatrici e i giovani ricercatori</b><br>
            </font></div>
        </b>
        <div><b><font color="#ff0000">con il 5 per mille alla Sapienza</font><br>
          </b>
          <div>
            <div dir="ltr">
              <div dir="ltr">
                <div>
                  <div dir="ltr">
                    <div>
                      <div dir="ltr">
                        <div>
                          <div dir="ltr">
                            <div>
                              <div dir="ltr">
                                <div>
                                  <div>
                                    <div>Scrivi il codice fiscale
                                      dell'Università <b>80209930587<br>
                                        <a
href="https://www.uniroma1.it/it/node/23149" target="_blank"
                                          moz-do-not-send="true">Cinque
                                          per mille</a></b></div>
                                  </div>
                                </div>
                                <div><br>
                                </div>
                                <div><img
src="https://www.uniroma1.it/sites/default/files/field_galleria/footer_sapienza_romaexpo_.jpg"
                                    moz-do-not-send="true"><br>
                                </div>
                                <div><br>
                                </div>
                                <div><br>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>