AS 'MODULE_PATHNAME','RASTER_convex_hull'
LANGUAGE 'C' IMMUTABLE STRICT;
-CREATE OR REPLACE FUNCTION box2d(raster)
- RETURNS box2d
- AS 'select box2d(st_convexhull($1))'
+CREATE OR REPLACE FUNCTION box3d(raster)
+ RETURNS box3d
+ AS 'select box3d(st_convexhull($1))'
LANGUAGE 'SQL' IMMUTABLE STRICT;
CREATE OR REPLACE FUNCTION st_envelope(raster)
-- Casts
------------------------------------------------------------------------------
-CREATE CAST (raster AS box2d)
- WITH FUNCTION box2d(raster) AS IMPLICIT;
+CREATE CAST (raster AS box3d)
+ WITH FUNCTION box3d(raster) AS IMPLICIT;
CREATE CAST (raster AS geometry)
WITH FUNCTION st_convexhull(raster) AS IMPLICIT;
SELECT
id,
env as expected,
- rast::box2d as obtained
-FROM rt_box2d_test
+ rast::box3d as obtained
+FROM rt_box3d_test
WHERE
- rast::box2d::text != env::text;
+ rast::box3d::text != env::text;
SELECT
id,
env as expected,
- box2d(rast) as obtained
-FROM rt_box2d_test
+ box3d(rast) as obtained
+FROM rt_box3d_test
WHERE
- box2d(rast)::text != env::text;
+ box3d(rast)::text != env::text;
SELECT
id,
env as expected,
- box2d(st_convexhull(rast)) as obtained
-FROM rt_box2d_test
+ box3d(st_convexhull(rast)) as obtained
+FROM rt_box3d_test
WHERE
- box2d(st_convexhull(rast))::text != env::text;
+ box3d(st_convexhull(rast))::text != env::text;
SELECT
id,
env as expected,
- box2d(st_envelope(rast)) as obtained
-FROM rt_box2d_test
+ box3d(st_envelope(rast)) as obtained
+FROM rt_box3d_test
WHERE
- box2d(st_envelope(rast))::text != env::text;
+ box3d(st_envelope(rast))::text != env::text;
-- the terms of the GNU General Public Licence. See the COPYING file.
-----------------------------------------------------------------------
-CREATE TABLE rt_box2d_test (
+CREATE TABLE rt_box3d_test (
id numeric,
name text,
rast raster,
- env box2d
+ env box3d
);
-- 10x20, ip:0.5,0.5 scale:2,3
-INSERT INTO rt_box2d_test
+INSERT INTO rt_box3d_test
VALUES ( 0, '10x20, ip:0.5,0.5 scale:2,3 skew:0,0',
(
'01' -- little endian (uint8 ndr)
||
'1400' -- height (uint16 20)
)::raster
-,'BOX(0.5 0.5,20.5 60.5)' -- expected envelope (20x60) == (10*2 x 20*3)
+,'BOX3D(0.5 0.5,20.5 60.5 0)' -- expected envelope (20x60) == (10*2 x 20*3)
);
-INSERT INTO rt_box2d_test
+INSERT INTO rt_box3d_test
VALUES ( 1, '1x1, ip:2.5,2.5 scale:5,5 skew:0,0',
(
'01' -- little endian (uint8 ndr)
||
'0100' -- height (uint16 1)
)::raster
-,'BOX(2.5 2.5,7.5 7.5)' -- expected envelope
+,'BOX3D(2.5 2.5,7.5 7.5 0)' -- expected envelope
);
-INSERT INTO rt_box2d_test
+INSERT INTO rt_box3d_test
VALUES ( 2, '1x1, ip:7.5,2.5 scale:5,5 skew:0,0',
(
'01' -- little endian (uint8 ndr)
||
'0100' -- height (uint16 1)
)::raster
-,'BOX(7.5 2.5,12.5 7.5)' -- expected envelope
+,'BOX3D(7.5 2.5,12.5 7.5 0)' -- expected envelope
);