From: Bborie Park Date: Sat, 24 Dec 2011 01:08:20 +0000 (+0000) Subject: Fix issue with RASTER_sameAlignment where the deserializing of the raster is not... X-Git-Tag: 2.0.0alpha1~339 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c56b34995e684993afa02be961150fcd8d46062c;p=postgis Fix issue with RASTER_sameAlignment where the deserializing of the raster is not being limited to just the header. git-svn-id: http://svn.osgeo.org/postgis/trunk@8536 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/rt_pg/rt_pg.c b/raster/rt_pg/rt_pg.c index 8a60e873f..67b0d8545 100644 --- a/raster/rt_pg/rt_pg.c +++ b/raster/rt_pg/rt_pg.c @@ -8132,7 +8132,7 @@ Datum RASTER_sameAlignment(PG_FUNCTION_ARGS) j++; /* raster */ - rast[i] = rt_raster_deserialize(pgrast, FALSE); + rast[i] = rt_raster_deserialize(pgrast, TRUE); if (!rast[i]) { elog(ERROR, "RASTER_sameAlignment: Could not deserialize the %s raster", i < 1 ? "first" : "second"); for (k = 0; k < i; k++) rt_raster_destroy(rast[k]); @@ -8147,11 +8147,11 @@ Datum RASTER_sameAlignment(PG_FUNCTION_ARGS) err = 1; } /* scales must match */ - else if (FLT_NEQ(rt_raster_get_x_scale(rast[0]), rt_raster_get_x_scale(rast[1]))) { + else if (FLT_NEQ(fabs(rt_raster_get_x_scale(rast[0])), fabs(rt_raster_get_x_scale(rast[1])))) { elog(NOTICE, "The two rasters provided have different scales on the X axis"); err = 1; } - else if (FLT_NEQ(rt_raster_get_y_scale(rast[0]), rt_raster_get_y_scale(rast[1]))) { + else if (FLT_NEQ(fabs(rt_raster_get_y_scale(rast[0])), fabs(rt_raster_get_y_scale(rast[1])))) { elog(NOTICE, "The two rasters provided have different scales on the Y axis"); err = 1; }