[Qgis-developer] Are there convenience functions to do bilinear or cubic raster sampling?

Denis Rouzaud denis.rouzaud at gmail.com
Tue Jun 24 22:23:33 PDT 2014


Hi Anita,

I don't know if it can be useful, but you'll find the python code here 
to do interpolation (nearest, linear, bicubic) on single points:
https://github.com/3nids/rasterinterpolation/blob/master/core/rasterinterpolator.py

Cheers,

Denis

On 24.06.2014 19:32, Anita Graser wrote:
> Thanks everyone for your answers!
>
>> On Tue, Jun 24, 2014 at 12:31 PM, Denis Rouzaud <denis.rouzaud at gmail.com> wrote:
>>> But, you can have such functionality through processing or via plugins (e.g.
>>> Raster Interpolation).
> True, but I would like to expand my profile from line script with
> these interpolation methods so using other tools is not really an
> option.
>
>>> Anyway, that would be an idea to bring such functionality in core!
> On Tue, Jun 24, 2014 at 7:46 AM, Martin Dobias <wonder.sk at gmail.com> wrote:
>> There are QgsBilinearRasterResampler and QgsCubicRasterResampler
>> classes for bilinear/cubic resampling used for raster rendering. As of
>> now they operate only on the whole raster image, not with individual
>> points.
> Exactly, something like those raster classes but working on individual
> points would be great to have in core and in the python API. Do you
> think this is a lot of work or is the raster code reusable?
>
> Should I open feature requests for this?
>
> Best wishes,
> Anita



More information about the Qgis-developer mailing list