From ce290556e65c7a19a21070ed58248577ead36f52 Mon Sep 17 00:00:00 2001 From: Bborie Park Date: Tue, 14 Feb 2012 17:29:45 +0000 Subject: [PATCH] Fixed handling of negative X-scale or positive Y-scale in rt_raster_gdal_rasterize(). Ticket is #1574. git-svn-id: http://svn.osgeo.org/postgis/trunk@9187 b70326c6-7e19-0410-871a-916f4a2858ee --- raster/rt_core/rt_api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/raster/rt_core/rt_api.c b/raster/rt_core/rt_api.c index 605b6bb28..6a25524a6 100644 --- a/raster/rt_core/rt_api.c +++ b/raster/rt_core/rt_api.c @@ -8443,6 +8443,9 @@ rt_raster_gdal_rasterize(const unsigned char *wkb, if (ul_user) { _width = (int) fmax((fabs(src_env.MaxX - src_env.MinX) + (_scale_x / 2.)) / _scale_x, 1); _height = (int) fmax((fabs(src_env.MaxY - src_env.MinY) + (_scale_y / 2.)) / _scale_y, 1); + + src_env.MaxX = src_env.MinX + (_width * _scale_x); + src_env.MinY = src_env.MaxY - (_height * _scale_y); } RASTER_DEBUGF(3, "shift is: %f, %f", grid_shift_xw, grid_shift_yw); -- 2.50.1