[gdal-dev] Wondering gdal_grid moving average interpolation

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Wondering gdal_grid moving average interpolation

Ari Jolma-2
I'm translating things on QGIS and now looking at GDAL tool rasterizing
point data set with moving average interpolation.

That's making a call to gdal_grid with -a average.

I've got the attached result from a point set (circles with red border
and inside inverse grayscale with interpolated value). The call was

gdal_grid -l INPUT -zfield suuntap -a
average:radius1=8000.0:radius2=8000.0:angle=0.0:min_points=0:nodata=0.0
-ot Float32 -of GTiff INPUT.shp OUTPUT.tif

I'm wondering is that the expected since it looks like the raster cell
value is determined by point locations. I would have expected a much
more smooth surface without any obvious circular shapes. To me it looks
like the computation was not done cell by cell but instead point by point.

What am I missing or misunderstanding?

Ari

ps: This tool is in group 'Raster analysis'. In my opinion it should be
in a group 'Point data tools' or something.



_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

ma.jpg (30K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Fwd: Re: Wondering gdal_grid moving average interpolation

a.hagen-zanker



Hi Ari,

Interesting result. It looks roughly right: pixels with only dark points in their surrounding window are dark and pixels with only light point in the window are light.

However, it does seem that the legend used for pixels uses different interval values than that for the pixels. Otherwise it would be hard to explain why pixels that have only a single point in their window do not have the same color as that point.

The second thing that is concerning is the ragged edge of the apparent circles. It suggests that the distance calculation is not accurate. It shouldn't be more than a pixel off.

You will always have these awkward edge effects in moving window analysis. However it can be reduced by 1) using a window radius considerably larger than the distance between points. 2) use a distance weighted kernel (my weapon of choice).

Kind regards, Alex
From: gdal-dev <[hidden email]> on behalf of Ari Jolma <[hidden email]>
Sent: Saturday, March 10, 2018 10:00:00 AM
Subject: [gdal-dev] Wondering gdal_grid moving average interpolation
 
I'm translating things on QGIS and now looking at GDAL tool rasterizing
point data set with moving average interpolation.

That's making a call to gdal_grid with -a average.

I've got the attached result from a point set (circles with red border
and inside inverse grayscale with interpolated value). The call was

gdal_grid -l INPUT -zfield suuntap -a
average:radius1=8000.0:radius2=8000.0:angle=0.0:min_points=0:nodata=0.0
-ot Float32 -of GTiff INPUT.shp OUTPUT.tif

I'm wondering is that the expected since it looks like the raster cell
value is determined by point locations. I would have expected a much
more smooth surface without any obvious circular shapes. To me it looks
like the computation was not done cell by cell but instead point by point.

What am I missing or misunderstanding?

Ari

ps: This tool is in group 'Raster analysis'. In my opinion it should be
in a group 'Point data tools' or something.





_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Wondering gdal_grid moving average interpolation

Rutger
In reply to this post by Ari Jolma-2
It looks alright to me. The moving average algorithm searches (for each
pixel) for points within the specified radius, and then averages the values
of all those points.

"gdal_grid" also supports inverse distance or linear interpolation if you
want a more smooth result.

It is perhaps surprising that QGIS only exposes a small subset of
gdal_grid's capabilities.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html
_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Wondering gdal_grid moving average interpolation

Ari Jolma-2
On 13.03.2018 09:54, Rutger wrote:
> It looks alright to me. The moving average algorithm searches (for each
> pixel) for points within the specified radius, and then averages the values
> of all those points.
>
> "gdal_grid" also supports inverse distance or linear interpolation if you
> want a more smooth result.
>
> It is perhaps surprising that QGIS only exposes a small subset of
> gdal_grid's capabilities.

Yes, you're right, I was just a bit flabbergasted that it looked so bad.
There's nothing to make it smooth.

The QGIS "bindings" to GDAL are a bit limited, perhaps there hasn't been
much interest in expanding them from the initial commits(?). I believe
there are also some things that could be thought as bugs - I did a PR(*)
a year ago which was not merged (but the issue has been fixed since) - I
think a good review of them would be useful. I fixed one issue
recently(**) but it is a rather slow process.

Ari

*) https://github.com/qgis/QGIS/pull/4220
**) https://github.com/qgis/QGIS/pull/6564

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev