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

raster/rt_pg/rtpostgis.sql.in.c

index c73028127e75466acf7b7f4bdaa6f7808b862e86..3257438d58317048cadcba66b1bebbdef222dec6 100644 (file)
@@ -5613,6 +5613,11 @@ CREATE OR REPLACE FUNCTION st_neighborhood(
                IF (st_geometrytype($3) != 'ST_Point') THEN
                        RAISE EXCEPTION 'Attempting to get the neighbor of a pixel with a non-point geometry';
                END IF;
+
+               IF ST_SRID(rast) != ST_SRID(pt) THEN
+                       RAISE EXCEPTION 'Raster and geometry do not have the same SRID';
+               END IF;
+
                wx := st_x($3);
                wy := st_y($3);