mapnik-org/mapnik — Issue #878: Raster reprojection needs robust proj_transform in order not to overclip source raster
Author: artemp
Created: 2011-10-11 08:16:04+00:00
State: open
Labels: Core_Library

I'm attaching to images as proof. *5.png is before patch, *6.png after. Patch is:
{{{
#!diff
Index: src/feature_style_processor.cpp
===================================================================
--- src/feature_style_processor.cpp (revision 3335)
+++ src/feature_style_processor.cpp (working copy)
@@ -229,7 +229,7 @@
box2d layer_ext = lay.envelope();

// first, try intersection of map extent forward projected into layer srs
- if (prj_trans.forward(map_ext) && map_ext.intersects(layer_ext))
+ if (prj_trans.forward(map_ext, 20) && map_ext.intersects(layer_ext))
{
layer_ext.clip(map_ext);
}
@@ -242,7 +242,7 @@
return;
}
// next try intersection of layer extent back projected into map srs
- else if (prj_trans.backward(layer_ext) && map_ext.intersects(layer_ext))
+ else if (prj_trans.backward(layer_ext, 20) && map_ext.intersects(layer_ext))
{
layer_ext.clip(map_ext);
// forward project layer extent back into native projection
@@ -261,7 +261,7 @@
}

box2d query_ext = m_.get_current_extent();
- prj_trans.forward(query_ext);
+ prj_trans.forward(query_ext, 20);
query::resolution_type res(m_.width()/query_ext.width(),
m_.height()/query_ext.height());
}}}