<div dir="ltr"><div>Hi all</div><div><br></div><div>Thanks for your answers</div><div><br></div><div>Just to get some values, the VRT was enough to get an idea. Thanks Jukka.</div><div>The questions was more like "this should be somewhere, and I do not find it", but apparently "it was not there".</div><div>I see that GDALRasterInterpolateAtPoint could be useful (I am surprised it was was not needed before). I will try to add it at some point.</div><div><br></div><div>Best regards,</div><div>Javier.<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 24 Apr 2024 at 15:16, 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><br>
</p>
<div>Le 24/04/2024 à 15:00, Michael Sumner a
écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">Or a grouping function that returned the cell index
for neighbours and weighting that are involved in whatever
calculation summary is wanted. <br>
</div>
</blockquote>
That doesn't seem super user friendly, as users would still be left
to do the raster value extraction and applying the weights, taking
into account nodata, etc. Not trivial. What is the advantage of this
compared to returning the interpolated value? The only one I see is
to potentially save a bit of computation if you need to interpolate
values at the same location in multiple bands, but the performance
gain would probably be marginal (or if not, then a variant of the
function dealing with multiple bands could be offered)<br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Maybe the warper could return this as a starting point
rather than doing the "task at hand". ?</div>
</div>
</blockquote>
The warper code has indeed a "FilterFuncType
GWKGetFilterFunc(GDALResampleAlg eResampleAlg)" method that returns
a function that returns interpolation weights and int
GWKGetFilterRadius(GDALResampleAlg eResampleAlg). The code in
GDALRPCGetDEMHeight() has an interesting logic where it caches a
window of interest around the first queried pixel so that subsequent
queries in the neighbouroud can be honoured without going to
RasterIO(). This substantially improves performance in the RPC case,
in particular during reverse transformation where you use an
iterative method and thus may need a lot of DEM extraction to
compute a single point.<br>
<blockquote type="cite">
<div dir="ltr">
<div><br>
</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, Apr 24, 2024 at
8:51 PM Even Rouault via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</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">
<div>
<p>Hi,</p>
<p>I guess this discussion, and past similar ones, calls for
an enhancement. A new API function, like CPLErr
GDALRasterInterpolateAtPoint(GDALRasterBandH, double
dfPixel, double dfLocation, GDALRIOResampleAlg
eInterpolation, double *pdfValue), that could be used by a
new mode of gdallocationinfo. The GDALRPCGetDEMHeight()
function in alg/gdal_rpc.cpp is a plausible candidate
implementation for bilinear and bicubic (we could
potentially restrict to that at the moment).<br>
</p>
<p>Even<br>
</p>
<div>Le 24/04/2024 à 10:33, Javier Jimenez Shaw via gdal-dev
a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>I would like to read in QGIS or GDAL an
interpolated value in a DSM (well, actually it is a
geoid model, but it is the same behaviour). See that I
do not want the pixel value, but the linear
interpolation among the neighbour pixels, assuming
that the pixel value is in the center of the pixel.<br>
</div>
<div>For instance, this file</div>
<div><a href="https://www.isgeoid.polimi.it/Geoid/Asia/Japan/japan2000_g.html" target="_blank">https://www.isgeoid.polimi.it/Geoid/Asia/Japan/japan2000_g.html</a></div>
<div><br>
</div>
<div>Is there any way to get it (without implementing
the interpolation myself)?</div>
<div>If I understood correctly gdallocationinfo is not
interpolating, just giving the pixel value.<br>
</div>
<div><br>
</div>
<div>Thanks<br>
</div>
<div><br>
</div>
<div>
<div>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>.___ ._ ..._ .. . ._. .___ .. __ . _. .
__.. ... .... ._ .__</div>
</div>
</div>
</div>
</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>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature">Michael Sumner<br>
Software and Database Engineer<br>
Australian Antarctic Division<br>
Hobart, Australia<br>
e-mail: <a href="mailto:mdsumner@gmail.com" target="_blank">mdsumner@gmail.com</a></div>
</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>