<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="ydp66bb2564yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;"><div></div>
<div dir="ltr" data-setdir="false">Hello again,</div><div dir="ltr" data-setdir="false">thanks for all the suggestions. While I haven't found the solution yet for my issue, I definitely learned a lot of new powerful tools in GDAL. It took me a bit of time to test the solutions and understand why it was not working for me (just yet).</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">@Even - the solutions you provided would work 'if' my data was pixel-to-pixel overlaid with the image data. I understand your workflow which is really nice (and I hope to use it in other simpler cases).</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false">I also hoped that the rfc4 solution would do it but this only would work if the spacing is regular. In my case, the spacing is 'time based' so the geogrphic spacing is not regular. On the rfc4 page (<a href="https://gdal.org/en/latest/development/rfc/rfc4_geolocate.html" rel="nofollow" target="_blank">https://gdal.org/en/latest/development/rfc/rfc4_geolocate.html</a>) there is reference to: <span>netCDF: NetCDF files can have differently varying maps in x and y directions, which are represented as geolocation arrays when they are encoded as CF conventions "two-dimensional coordinate variables". See the netcdf driver page for details. -> I'm working with such a NetCDF dataset. Is there a solution based on this?</span></div><div dir="ltr" data-setdir="false"><span><br></span></div><div dir="ltr" data-setdir="false"><span>Just to let you know, the geo raster = <span>Band 1 Block=973x819 Type=Int32, ColorInterp=Undefined</span></span></div><div dir="ltr" data-setdir="false"><span><span>image = <span>Band 1 Block=1217x1023 Type=UInt16, ColorInterp=Undefined.</span></span></span></div><div dir="ltr" data-setdir="false"><span><span><span><br></span></span></span></div><div dir="ltr" data-setdir="false"><span><span><span>One solution that I did not test yet (thanks Trent) is to use gdal_grid to interpolate the X and Y locations to the same grid as the image. Then I should be able to apply the suggested solution because the location information should be in the same grid. <br></span></span></span></div><div dir="ltr" data-setdir="false"><span><span><span><br></span></span></span></div><div dir="ltr" data-setdir="false"><span><span><span>Fingers crossed,</span></span></span></div><div dir="ltr" data-setdir="false"><span><span><span>Conrad<br></span></span></span></div><div dir="ltr" data-setdir="false"><span><span><span><br></span></span></span></div><div><br></div>
</div><div id="ydp9e5074e6yahoo_quoted_0096255107" class="ydp9e5074e6yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
<div>
On Saturday, October 19, 2024 at 05:47:44 AM GMT+1, Michael Sumner <mdsumner@gmail.com> wrote:
</div>
<div><br></div>
<div><br></div>
<div><div id="ydp9e5074e6yiv0361424079"><div><p dir="ltr">Nice one, thanks! (I had a fomenting PR to implement on the fly geolocation array config, so I'll use your hallucination for the design phase).</p>
<p dir="ltr">🤟</p>
<br clear="none"><div id="ydp9e5074e6yiv0361424079yqt33024" class="ydp9e5074e6yiv0361424079yqt8596631720"><div class="ydp9e5074e6yiv0361424079gmail_quote"><div dir="ltr" class="ydp9e5074e6yiv0361424079gmail_attr">On Sat, 19 Oct 2024, 14:44 Even Rouault, <<a shape="rect" href="mailto:even.rouault@spatialys.com" rel="nofollow" target="_blank">even.rouault@spatialys.com</a>> wrote:<br clear="none"></div><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;" class="ydp9e5074e6yiv0361424079gmail_quote"><u></u>
<div>
<p><br clear="none">
</p>
<div>Le 18/10/2024 Ã 23:32, Michael Sumner a
écrit :<br clear="none">
</div>
<blockquote type="cite">
<p dir="ltr">I didn't know you could do that with -to!! That's
awesome </p>
<p dir="ltr">🤟</p>
</blockquote>
<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="ydp9e5074e6yiv0361424079gmail_quote">
<div dir="ltr" class="ydp9e5074e6yiv0361424079gmail_attr">On Sat, 19 Oct 2024, 05:01
Even Rouault via gdal-dev, <<a shape="rect" href="mailto:gdal-dev@lists.osgeo.org" 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="ydp9e5074e6yiv0361424079gmail_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" rel="nofollow" target="_blank" class="enhancr_card_9879858417">RFC 4: Geolocation Arrays — GDAL documentation</a><br clear="none">
</p><div><br></div><div id="ydp55609b9enhancr_card_9879858417" class="ydp55609b9yahoo-link-enhancr-card ydp55609b9yahoo-link-enhancr-not-allow-cover ydp55609b9ymail-preserve-class ydp55609b9ymail-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/development/rfc/rfc4_geolocate.html" data-type="YENHANCER" data-size="MEDIUM" contenteditable="false"><a href="https://gdal.org/en/latest/development/rfc/rfc4_geolocate.html" style="text-decoration-color: currentcolor !important; text-decoration-line: none !important; text-decoration-style: solid !important; color: rgb(0, 0, 0) !important;" class="ydp55609b9yahoo-enhancr-cardlink" rel="nofollow" target="_blank"><table border="0" class="ydp55609b9card-wrapper ydp55609b9yahoo-ignore-table" cellpadding="0" cellspacing="0" style="max-width:400px"><tbody><tr><td width="400"><table border="0" class="ydp55609b9card ydp55609b9yahoo-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="ydp55609b9card-info ydp55609b9yahoo-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="ydp55609b9card-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;">RFC 4: Geolocation Arrays — GDAL documentation</h2><p class="ydp55609b9card-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> there is <br><div><br></div><div><br></div>
<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="ydp9e5074e6yiv0361424079gmail_quote">
<div dir="ltr" class="ydp9e5074e6yiv0361424079gmail_attr">On Fri, 18 Oct 2024 at
12:20, Conrad Bielski via gdal-dev <<a shape="rect" href="mailto:gdal-dev@lists.osgeo.org" 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="ydp9e5074e6yiv0361424079gmail_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" 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" 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" rel="nofollow" target="_blank">gdal-dev@lists.osgeo.org</a>
<a shape="rect" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="nofollow" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre>--
<a shape="rect" href="http://www.spatialys.com" 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>
_______________________________________________<br clear="none">
gdal-dev mailing list<br clear="none">
<a shape="rect" href="mailto:gdal-dev@lists.osgeo.org" 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" rel="nofollow" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br clear="none">
</blockquote>
</div>
</blockquote>
<pre>--
<a shape="rect" href="http://www.spatialys.com" 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>
</blockquote></div></div>
</div></div></div>
</div>
</div></body></html>