[Qgis-developer] Raster resampling suggestion

Nick Dolezal ndolezal at gmail.com
Tue Feb 18 16:15:53 PST 2014


Hey Marco,

Here's the code I have for a bilinear-based implementation (attached),
though I've omitted the actual NN and bilinear resampling code itself for
brevity.  This does have a number of implementation-specific assumptions
which would need to be reworked for the general case.  (the general case in
GIS is hard and makes my brain bleed.)  So it's not really close to the
point of being ready for a pull request.

It could be adapted to work on RGBA output, though with some modifications
mostly involving using the alpha channel with a NN resample in place of the
NODATA values.

It should be all ANSI C with no external dependencies. (except for one
irrelevant Accelerate framework call)

Hope this is useful -- let me know if anything else is needed.


On Tue, Feb 18, 2014 at 1:14 AM, Marco Hugentobler <
marco.hugentobler at sourcepole.ch> wrote:

> Hi Nick
>
> Resampling on data level does not work in case of colormap rasters,
> therefore the resampling filter currently comes after assigning rgba. One
> possibility would be to provide a user choice if resampling should be done
> on color values or on data.
>
> I think it is best if you post your code (as a pull request on github or
> via mailing list), then others can give it a try and provide feedback. I'm
> not really a raster power user myself (mostly working with rasters as
> background images for maps).
>
> Regards,
> Marco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140218/5a662264/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RasterBilinearResampleWithNoData.c
Type: text/x-csrc
Size: 14594 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140218/5a662264/attachment-0001.c>


More information about the Qgis-developer mailing list