From 2834b2ad92e354ec3fde5ab8cf05aa403d513be1 Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 19 Sep 2012 13:51:53 +0100 Subject: [PATCH 1/2] + not sure why we have do { } while(false); - removing --- src/proj_transform.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/proj_transform.cpp b/src/proj_transform.cpp index 3ffd7f7e9..b604fa094 100644 --- a/src/proj_transform.cpp +++ b/src/proj_transform.cpp @@ -150,7 +150,7 @@ bool proj_transform::backward (double * x, double * y , double * z, int point_co } } - do { + { #if defined(MAPNIK_THREADSAFE) && PJ_VERSION < 480 mutex::scoped_lock lock(projection::mutex_); #endif @@ -160,7 +160,7 @@ bool proj_transform::backward (double * x, double * y , double * z, int point_co { return false; } - } while(false); + } if (is_source_longlat_) { From 97463abf3de788ccd8fee472eba896ae5f78cc57 Mon Sep 17 00:00:00 2001 From: artemp Date: Wed, 19 Sep 2012 13:53:56 +0100 Subject: [PATCH 2/2] + ensure mesh doesn't overflow source raster extent - #1480 --- src/warp.cpp | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/src/warp.cpp b/src/warp.cpp index ee0dc6a05..60232b01e 100644 --- a/src/warp.cpp +++ b/src/warp.cpp @@ -58,17 +58,19 @@ void reproject_and_scale_raster(raster & target, raster const& source, CoordTransform tt(target.data_.width(), target.data_.height(), target.ext_, offset_x, offset_y); unsigned i, j; - unsigned mesh_nx = ceil(source.data_.width()/double(mesh_size)+1); - unsigned mesh_ny = ceil(source.data_.height()/double(mesh_size)+1); + unsigned mesh_nx = ceil(source.data_.width()/double(mesh_size) + 1); + unsigned mesh_ny = ceil(source.data_.height()/double(mesh_size) + 1); ImageData xs(mesh_nx, mesh_ny); ImageData ys(mesh_nx, mesh_ny); // Precalculate reprojected mesh - for(j=0; j