]> granicus.if.org Git - postgis/commitdiff
Added check for SRID match in ST_Value(raster) geometry variant
authorBborie Park <bkpark at ucdavis.edu>
Mon, 29 Oct 2012 22:22:57 +0000 (22:22 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Mon, 29 Oct 2012 22:22:57 +0000 (22:22 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@10583 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rtpostgis.sql.in.c
raster/test/regress/rt_pixelvalue_expected

index fa2b3673021f3a8168a1af1c6dacf0c9698a5867..caf54a190420d855f5024bbeb271ab15fcb585c3 100644 (file)
@@ -3746,6 +3746,11 @@ CREATE OR REPLACE FUNCTION st_value(rast raster, band integer, pt geometry, excl
         IF ( gtype != 'ST_Point' ) THEN
             RAISE EXCEPTION 'Attempting to get the value of a pixel with a non-point geometry';
         END IF;
+
+                               IF ST_SRID(pt) != ST_SRID(rast) THEN
+            RAISE EXCEPTION 'Raster and geometry do not have the same SRID';
+                               END IF;
+
         x := st_x(pt);
         y := st_y(pt);
         RETURN st_value(rast,
index b8e3ce5ef933de3d90fa3d875f5031fbb479a3c5..4880f48f5783cfd526036b18a9abe6a0a3d98843 100644 (file)
@@ -2,6 +2,8 @@ NOTICE:  Attempting to get pixel value with out of range raster coordinates: (-2
 NOTICE:  Attempting to get pixel value with out of range raster coordinates: (-2, -2)
 NOTICE:  Attempting to get pixel value with out of range raster coordinates: (-2, -2)
 NOTICE:  Attempting to get pixel value with out of range raster coordinates: (-2, -2)
+ERROR:  Raster and geometry do not have the same SRID
+ERROR:  Raster and geometry do not have the same SRID
 NOTICE:  Raster do not have a nodata value defined. Set band nodata value first. Nodata value not set. Returning original raster
 NOTICE:  Raster do not have a nodata value defined. Set band nodata value first. Nodata value not set. Returning original raster
 NOTICE:  Raster do not have a nodata value defined. Set band nodata value first. Nodata value not set. Returning original raster