artemp/mapnik — Issue #885: expose resampling options when using raster reprojection
Author: artemp
Created: 2011-10-11 16:41:08+00:00
State: open
Labels: Core_Library

From looking at the latest reprojection code using agg it appears that bilinear filtering is hardcoded.

I am currently running this patch in the hope that it is faster (because I do not need top quality). Ideally we could support all modes even when reprojecting.

{{{
#!diff

Index: src/agg/process_raster_symbolizer.cpp
===================================================================
--- src/agg/process_raster_symbolizer.cpp (revision 3347)
+++ src/agg/process_raster_symbolizer.cpp (working copy)
@@ -36,6 +36,7 @@
// agg
#include "agg_image_filters.h"
#include "agg_trans_bilinear.h"
+#include "agg_trans_affine.h"
#include "agg_span_interpolator_linear.h"
#include "agg_span_image_filter_rgba.h"
#include "agg_rendering_buffer.h"
@@ -142,10 +143,10 @@
unsigned x1 = (i+1) * mesh_size;
unsigned y1 = (j+1) * mesh_size;

- agg::trans_bilinear tr(polygon, x0, y0, x1, y1);
+ agg::trans_affine tr(polygon, x0, y0, x1, y1);
if (tr.is_valid())
{
- typedef agg::span_interpolator_linear
+ typedef agg::span_interpolator_linear
interpolator_type;
interpolator_type interpolator(tr);

}}}