]> granicus.if.org Git - postgis/commitdiff
Fixed variable datatype in ST_Neighborhood. Ticket #2384
authorBborie Park <bkpark at ucdavis.edu>
Wed, 17 Jul 2013 14:45:32 +0000 (14:45 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Wed, 17 Jul 2013 14:45:32 +0000 (14:45 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11692 b70326c6-7e19-0410-871a-916f4a2858ee

NEWS
raster/rt_pg/rtpostgis.sql.in
raster/test/regress/rt_neighborhood.sql
raster/test/regress/rt_neighborhood_expected

diff --git a/NEWS b/NEWS
index 9bf157cdcb17ae693e4b1f3a6dc5a2654fcc35f2..c86d0eebcfcd23630f79f3b69b36072e677a6b14 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ PostGIS 2.2.0
 
   - #2371, Support GEOS versions with more than 1 digit in micro
   - #2383, Removed unsafe use of \' from raster warning message
+  - #2384, Fixed variable datatype in ST_Neighborhood
 
 PostGIS 2.1.0
 2013/MM/DD
index c0a2b1b36167c67f47cfe4e55dcb8ecea8fe0d82..43dcad6b220f3267e4a75771ade4ada4559d07d6 100644 (file)
@@ -6609,8 +6609,8 @@ CREATE OR REPLACE FUNCTION st_neighborhood(
        RETURNS double precision[][]
        AS $$
        DECLARE
-               wx int;
-               wy int;
+               wx double precision;
+               wy double precision;
                rtn double precision[][];
        BEGIN
                IF (st_geometrytype($3) != 'ST_Point') THEN
index 25bc74bb9964e8604f38ac975c93e9f5b9a69bca..2d422404fc1aff2a809a297c1bbebdc072c1ca39 100644 (file)
@@ -87,4 +87,11 @@ SELECT
        ST_Neighborhood(rast, 1, 4, 4, 1, 0)
 FROM raster_neighborhood;
 
+SELECT
+       ST_Neighborhood(rast, 1, 'POINT(0 0)'::geometry, 1, 1)
+FROM raster_neighborhood;
+SELECT
+       ST_Neighborhood(rast, 1, 'POINT(3 -3)'::geometry, 2, 2)
+FROM raster_neighborhood;
+
 DROP TABLE IF EXISTS raster_neighborhood;
index e801c8ae55344c602a2a9b2dbee09642b9d230e1..6e53cd877d6f099c85a861b3a8f04cc8ee611263 100644 (file)
@@ -15,3 +15,5 @@ NOTICE:  table "raster_neighborhood" does not exist, skipping
 {{1,1,1,1,1},{NULL,1,1,NULL,1},{1,1,1,1,1},{1,NULL,1,1,NULL},{1,1,1,1,1}}
 {{1,1,1},{1,1,NULL},{1,1,1},{NULL,1,1},{1,1,1}}
 {{1,1,1}}
+{{NULL,NULL,NULL},{NULL,NULL,1},{NULL,1,1}}
+{{1,1,1,1,1},{NULL,1,1,NULL,1},{1,1,1,1,1},{1,NULL,1,1,NULL},{1,1,1,1,1}}