]> granicus.if.org Git - postgis/commitdiff
Inclusion of missing ST_PixelWidth and ST_PixelHeight functions and regression tests.
authorBborie Park <bkpark at ucdavis.edu>
Wed, 24 Aug 2011 15:23:25 +0000 (15:23 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Wed, 24 Aug 2011 15:23:25 +0000 (15:23 +0000)
Associated ticket is #928

git-svn-id: http://svn.osgeo.org/postgis/trunk@7779 b70326c6-7e19-0410-871a-916f4a2858ee

raster/rt_pg/rtpostgis.sql.in.c
raster/test/regress/Makefile.in
raster/test/regress/rt_pixelsize.sql [new file with mode: 0644]
raster/test/regress/rt_pixelsize_expected [new file with mode: 0644]

index 8d66a3ec19fc87c582b8b98f2f3969e171764448..7db90815e363ff192910768c0e99bd1883e5949d 100644 (file)
@@ -135,6 +135,16 @@ CREATE OR REPLACE FUNCTION st_width(raster)
     AS 'MODULE_PATHNAME','RASTER_getWidth'
     LANGUAGE 'C' IMMUTABLE STRICT;
 
+CREATE OR REPLACE FUNCTION st_pixelwidth(raster)
+    RETURNS float8
+    AS 'MODULE_PATHNAME', 'RASTER_getPixelWidth'
+    LANGUAGE 'C' IMMUTABLE STRICT;
+
+CREATE OR REPLACE FUNCTION st_pixelheight(raster)
+    RETURNS float8
+    AS 'MODULE_PATHNAME', 'RASTER_getPixelHeight'
+    LANGUAGE 'C' IMMUTABLE STRICT;
+
 CREATE OR REPLACE FUNCTION st_rotation(raster)
     RETURNS float8
     AS 'MODULE_PATHNAME','RASTER_getRotation'
index 2a86cbe5fa50054fd2f2510a81dc4a6ca12e687c..6b55e3929d7742a08b8c038c10c359ca3aa03c07 100644 (file)
@@ -54,6 +54,7 @@ TEST_PROPS = \
        create_rt_properties_test.sql \
        rt_dimensions.sql \
        rt_scale.sql \
+       rt_pixelsize.sql \
        rt_upperleft.sql \
        rt_rotation.sql \
        rt_georeference.sql \
diff --git a/raster/test/regress/rt_pixelsize.sql b/raster/test/regress/rt_pixelsize.sql
new file mode 100644 (file)
index 0000000..af49728
--- /dev/null
@@ -0,0 +1,24 @@
+-----------------------------------------------------------------------
+-- $Id$
+--
+-- Copyright (c) 2011 David Zwarg <dzwarg@azavea.com>
+--
+-- This is free software; you can redistribute and/or modify it under
+-- the terms of the GNU General Public Licence. See the COPYING file.
+-----------------------------------------------------------------------
+
+-----------------------------------------------------------------------
+-- st_pixelwidth
+-----------------------------------------------------------------------
+
+SELECT id, name, scalex, skewy
+    FROM rt_properties_test
+    WHERE NOT sqrt(scalex*scalex + skewy*skewy) = st_pixelwidth(rast);
+
+-----------------------------------------------------------------------
+-- st_pixelheight
+-----------------------------------------------------------------------
+
+SELECT id, name, scaley, skewx
+    FROM rt_properties_test
+    WHERE NOT sqrt(scaley*scaley + skewx*skewx) = st_pixelheight(rast);
diff --git a/raster/test/regress/rt_pixelsize_expected b/raster/test/regress/rt_pixelsize_expected
new file mode 100644 (file)
index 0000000..e69de29