<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"><head><!--[if gte mso 9]><xml><o:OfficeDocumentSettings><o:AllowPNG/><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml><![endif]--></head><body><div class="ydp62f2ef51yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" dir="ltr" data-setdir="false"><div></div>
        <div dir="ltr" data-setdir="false">Hi,</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">so I've tried everything that was suggested and I'm not sure why I'm constantly getting this error when I try to run the gdalwarp command: <span><br></span></div><div dir="ltr" data-setdir="false"><span>ERROR 1: Unable to compute a GEOLOC_ARRAY based transformation between pixel/line and georeferenced coordinates for b1.vrt.</span></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false"><span>For clarity, this is the full command that I'm using:</span></div><div dir="ltr" data-setdir="false"><div>gdalwarp Oa01_radiance.nc b1.tif -to X_DATASET=lon.tif -to X_BAND=1 -to Y_DATASET=lat.tif -to Y_BAND=1 -to PIXEL_OFFSET=0 -to PIXEL_STEP=1 -to LINE_OFFSET=0 -to LINE_STEP=1 -to SRS=EPSG:4326  -overwrite</div><div><br>ERROR 1: The transformation is already "north up" or a transformation between pixel/line and georeferenced coordinates cannot be computed for Oa01_radiance.nc. There is no affine transformation and no GCPs. Specify transformation option SRC_METHOD=NO_GEOTRANSFORM to bypass this check.<br></div><div><br></div><div dir="ltr" data-setdir="false">Of course if I add the 'NO_GEOTRANSFORM' the wanted geo information is lost and the output is not correct.<br></div></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false"><span>The image sizes are the same so I'm wondering what's missing.</span></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false"><span>I have found the list of options here: </span><a href="https://gdal.org/en/latest/api/gdal_alg.html" class="ydp9bf11095enhancr_card_0428405863" rel="nofollow" target="_blank">gdal_alg.h: GDAL Algorithms C API — GDAL  documentation</a> <br></div><div><br></div><div id="ydpc087dbcbenhancr_card_0428405863" class="ydpc087dbcbyahoo-link-enhancr-card ydpc087dbcbyahoo-link-enhancr-not-allow-cover ydpc087dbcbymail-preserve-class ydpc087dbcbymail-preserve-style" style="max-width:400px;font-family:YahooSans VF, YahooSans, OpenSans VF, OpenSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif" data-url="https://gdal.org/en/latest/api/gdal_alg.html" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://gdal.org/en/latest/api/gdal_alg.html" style="text-decoration-color: currentcolor !important; text-decoration-line: none !important; text-decoration-style: solid !important; color: rgb(0, 0, 0) !important;" class="ydpc087dbcbyahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table border="0" class="ydpc087dbcbcard-wrapper ydpc087dbcbyahoo-ignore-table" cellpadding="0" cellspacing="0" style="max-width:400px"><tbody><tr><td width="400"><table border="0" class="ydpc087dbcbcard ydpc087dbcbyahoo-ignore-table" cellpadding="0" cellspacing="0" width="100%" style="max-width:400px;border-width:1px;border-style:solid;border-color:rgb(224, 228, 233);border-radius:2px"><tbody><tr><td><table border="0" class="ydpc087dbcbcard-info ydpc087dbcbyahoo-ignore-table" cellpadding="0" cellspacing="0" style="background-color: rgb(255, 255, 255); background-repeat: repeat; background-attachment: scroll; background-image: none; background-size: auto; position: relative; z-index: 2; width: 100%; max-width: 400px; border-radius: 0px 0px 2px 2px; border-top: 1px solid rgb(224, 228, 233);"><tbody><tr><td style="background-color:#ffffff;padding:16px 0 16px 12px;vertical-align:top;border-radius:0 0 0 2px"></td><td style="vertical-align:middle;padding:12px 24px 16px 12px;width:99%;font-family:YahooSans VF, YahooSans, OpenSans VF, OpenSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif;border-radius:0 0 2px 0"><h2 class="ydpc087dbcbcard-title" style="font-size: 14px; line-height: 19px; margin: 0px 0px 6px; font-family: YahooSans VF, YahooSans, OpenSans VF, OpenSans, Helvetica Neue, Segoe UI, Helvetica, Arial, sans-serif; color: rgb(29, 34, 40); max-width: 314px;">gdal_alg.h: GDAL Algorithms C API — GDAL  documentation</h2><p class="ydpc087dbcbcard-description" style="font-size: 12px; line-height: 16px; margin: 0px; color: rgb(151, 158, 168);"></p></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></a></div>which is quite nice but many have version requirements. At the moment, I'm using <span>GDAL 3.4.3, released 2022/04/22 and wondering whether I need to update in order for this to work?</span></div><div class="ydp62f2ef51yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" dir="ltr" data-setdir="false"><span><br></span></div><div class="ydp62f2ef51yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" dir="ltr" data-setdir="false"><span>Or am I just missing something? Ideas?</span></div><div class="ydp62f2ef51yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" dir="ltr" data-setdir="false"><span><br></span></div><div class="ydp62f2ef51yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" dir="ltr" data-setdir="false"><span>Thanks for your help,</span></div><div class="ydp62f2ef51yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" dir="ltr" data-setdir="false"><span>Conrad<br></span><div><br></div><div><br></div><div><br></div>
        
        </div><div id="ydpb0ce50d4yahoo_quoted_0513029157" class="ydpb0ce50d4yahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                        On Saturday, October 19, 2024 at 04:44:19 AM GMT+1, Even Rouault <even.rouault@spatialys.com> wrote:
                    </div>
                    <div><br></div>
                    <div><br></div>
                
                
                <div><div id="ydpb0ce50d4yiv6878664203"><div>
    <p><br clear="none">
    </p>
    <div class="ydpb0ce50d4yiv6878664203moz-cite-prefix">Le 18/10/2024 à 23:32, Michael Sumner a
      écrit :<br clear="none">
    </div>
    <blockquote type="cite">
      </blockquote></div><div><p dir="ltr">I didn't know you could do that with -to!! That's
        awesome </p>
      <p dir="ltr">🤟</p>
    
    <p>Hum, sorry for giving a wrong track, it seems the newly LLM
      module implemented in my brain has hallucinated... <br clear="none">
    </p>
    <p>So you have rather to create a geoloc.vrt file with</p>
    <p>gdal_translate input.tif geoloc.vrt -b 2 -b 1<br clear="none">
    </p>
    <p>and then;</p>
    <p>gdal_translate input.tif imagery.vrt -b 3<br clear="none">
      <br clear="none">
      gdalwarp imagery.vrt imagery_warped.tif -geoloc -to
      GEOLOC_ARRAY=geoloc.vrt -a_srs EPSG:4326  -overwrite<br clear="none">
    </p>
    <blockquote type="cite">
      <br clear="none">
      <div class="ydpb0ce50d4yiv6878664203gmail_quote">
        <div dir="ltr" class="ydpb0ce50d4yiv6878664203gmail_attr">On Sat, 19 Oct 2024, 05:01
          Even Rouault via gdal-dev, <<a shape="rect" href="mailto:gdal-dev@lists.osgeo.org" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">gdal-dev@lists.osgeo.org</a>>
          wrote:<br clear="none">
        </div>
        <blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;" class="ydpb0ce50d4yiv6878664203gmail_quote">
          <div>
            <p>Conrad,</p>
            <p>Try something like:</p>
            <p>gdal_translate input.tif imagery.vrt -b 3<br clear="none">
            </p>
            <p>gdalwarp imagery.vrt imagery_warped.tif -geoloc -to
              X_DATASET=input.tif -to X_BAND=2 -to Y_DATASET=input.tif
              -to Y_BAND=1 -to PIXEL_OFFSET=0 -to PIXEL_STEP=1 -to
              LINE_OFFSET=0 -to LINE_STEP=1 -to SRS=EPSG:4326 -a_srs
              EPSG:4326  -overwrite<br clear="none">
            </p>
            <p>Obviously I have most certainly got something wrong in
              the above, but hopefully with a tiny tweaking that should
              put you on the right track.<br clear="none">
            </p>
            <p>Reference: <a shape="rect" href="https://gdal.org/en/latest/development/rfc/rfc4_geolocate.html" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">https://gdal.org/en/latest/development/rfc/rfc4_geolocate.html</a><br clear="none">
            </p>
            <p>Even<br clear="none">
            </p>
            <div>Le 18/10/2024 à 12:37, Javier Jimenez Shaw via gdal-dev
              a écrit :<br clear="none">
            </div>
            <blockquote type="cite">
              <div dir="ltr">
                <div>Is it an actual grid? in the meaning of having
                  constant step size in X and Y.</div>
                <div>In that case the geolocation is just the corner and
                  the x and y sizes. You can convert to a georeference
                  raster, and warp it.<br clear="none">
                </div>
                <div>If it is not the case, you have something more like
                  a 2D pointcloud, or a bunch of poins in a strange
                  vector format.<br clear="none">
                </div>
              </div>
              <br clear="none">
              <div class="ydpb0ce50d4yiv6878664203gmail_quote">
                <div dir="ltr" class="ydpb0ce50d4yiv6878664203gmail_attr">On Fri, 18 Oct 2024 at
                  12:20, Conrad Bielski via gdal-dev <<a shape="rect" href="mailto:gdal-dev@lists.osgeo.org" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">gdal-dev@lists.osgeo.org</a>>
                  wrote:<br clear="none">
                </div>
                <blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex;" class="ydpb0ce50d4yiv6878664203gmail_quote">
                  <div>
                    <div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
                      <div dir="ltr">Hello GDAL-experts,</div>
                      <div dir="ltr"><br clear="none">
                      </div>
                      <div dir="ltr">normally when I use GDAL for
                        reprojecting imagery, the projection information
                        that I use is the source spatial reference (SRS)
                        associated with the imagery. However, now I have
                        imagery which is lat/lon geographic and I have
                        two separate bands which also carry the pixel
                        geographic information. So the following raster
                        inputs all the same size:</div>
                      <div dir="ltr">1. Band 1 = latitude</div>
                      <div dir="ltr">2. Band 2 = longitude</div>
                      <div dir="ltr">3. Band 3 = imagery</div>
                      <div dir="ltr"><br clear="none">
                      </div>
                      <div dir="ltr">The question I have is how best to
                        integrate this information into a reprojection
                        workflow?</div>
                      <div dir="ltr"><br clear="none">
                      </div>
                      <div dir="ltr">I presume that gdalwarp is the best
                        option here, but how can I take advantage of the
                        individual pixel location information (rather
                        than just the extents for example)? I know that
                        I can mosaic into an existing file that I have
                        already created in the target projection. Is
                        this the best way to apply gdalwarp in this
                        context?</div>
                      <div dir="ltr"><br clear="none">
                      </div>
                      <div dir="ltr">I'm just wondering what is the best
                        way to integrate the lat/lon pixel information
                        into my warping using gdalwarp.</div>
                      <div dir="ltr"><br clear="none">
                      </div>
                      <div dir="ltr">Thanks in advance for your help,</div>
                      <div dir="ltr">Conrad<br clear="none">
                      </div>
                    </div>
                  </div>
                  _______________________________________________<br clear="none">
                  gdal-dev mailing list<br clear="none">
                  <a shape="rect" href="mailto:gdal-dev@lists.osgeo.org" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">gdal-dev@lists.osgeo.org</a><br clear="none">
                  <a shape="rect" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br clear="none">
                </blockquote>
              </div>
              <br clear="none">
              <fieldset></fieldset>
              <pre>_______________________________________________
gdal-dev mailing list
<a shape="rect" href="mailto:gdal-dev@lists.osgeo.org" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">gdal-dev@lists.osgeo.org</a>
<a shape="rect" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
            </blockquote>
            <pre>-- 
<a shape="rect" href="http://www.spatialys.com" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.</pre>
          </div><div id="ydpb0ce50d4yiv6878664203yqtfd52391" class="ydpb0ce50d4yiv6878664203yqt6222329734">
          _______________________________________________<br clear="none">
          gdal-dev mailing list<br clear="none">
          <a shape="rect" href="mailto:gdal-dev@lists.osgeo.org" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">gdal-dev@lists.osgeo.org</a><br clear="none">
          <a shape="rect" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br clear="none">
        </div></blockquote><div id="ydpb0ce50d4yiv6878664203yqtfd24594" class="ydpb0ce50d4yiv6878664203yqt6222329734">
      </div></div><div id="ydpb0ce50d4yiv6878664203yqtfd76467" class="ydpb0ce50d4yiv6878664203yqt6222329734">
    </div></blockquote><div id="ydpb0ce50d4yiv6878664203yqtfd13137" class="ydpb0ce50d4yiv6878664203yqt6222329734">
    <pre class="ydpb0ce50d4yiv6878664203moz-signature">-- 
<a shape="rect" href="http://www.spatialys.com" class="ydpb0ce50d4yiv6878664203moz-txt-link-freetext" rel="nofollow" target="_blank">http://www.spatialys.com</a>
My software is free, but my time generally not.
Butcher of all kinds of standards, open or closed formats. At the end, this is just about bytes.</pre>
  </div></div></div></div>
            </div>
        </div></body></html>