[gdal-dev] Interpolation when using the WMS format
Even Rouault
even.rouault at spatialys.com
Fri Sep 26 10:22:59 PDT 2014
Peter,
This is an interesting proof of concept.
I have several notes :
- not sure about your naming conventions. For me your 'top' and 'bottom' must
be inverted. In imaging convention, the y of top is < to the y of bottom
- the formula is only appropriate for a resampling up to a factor of 2
- you might have edge effects at block border since you clamp to the current
block. For example, this could be problematic when operating on blocks with a
1-line height.
- something ready for upstreaming would probably involve adding a new argument
to RasterIO to specify the resampling method, and as you noted, generalizing
to other data types.
- taking into nodata, alpha channel, etc.. would be necessary
Would probably be interesting to think if we cannot share code with overview
computation. But not immediately trivial to do so.
Best regards,
Even
>
> I finally took the time to have a better look at this.
>
> The attached patch is only for our special case, where data arrives in 8
> bit bands and is certainly far from being decent (I've written my last
> C++ code approx. 15 years ago). Anyway, the image quality seems indeed
> to improve sensibly.
>
> I used the current SVN version as a base for the development.
>
> Applying the patch I get from
> https://dl.dropboxusercontent.com/u/4935329/resampling_tests/basemap.2000x2
> 000-quasiorig.jpg to this
> https://dl.dropboxusercontent.com/u/4935329/resampling_tests/basemap.2000x2
> 000.bilinear.jpg .
>
> Anyway, the execution time approximatly doubles (on my 2011 notebook it
> passes from ~ 1.8 s to ~ 3.4 s), which in our case is not really an
> issue, but probaly for almost everybody else.
>
> The command line is, starting from the compilation dir:
>
> apps/gdal_translate -srcwin 35555000 23538000 2500 2500 -of JPEG
> -outsize 2000 2000 basemap.xml basemap.2000x2000.bilinear.jpg .
>
> Any comment is highly appreciated.
>
> Regards and a nice weekend,
>
> Peter
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the gdal-dev
mailing list