]> granicus.if.org Git - postgis/commitdiff
Fixed handling of negative X-scale or positive Y-scale in rt_raster_gdal_rasterize...
authorBborie Park <bkpark at ucdavis.edu>
Tue, 14 Feb 2012 17:29:45 +0000 (17:29 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Tue, 14 Feb 2012 17:29:45 +0000 (17:29 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9187 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_core/rt_api.c

index 605b6bb283d7e85991011eb58a6ff3244a2abae2..6a25524a6b225e0f2942b71ca43f52761754341b 100644 (file)
@@ -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);