[postgis-commits] svn - r3836 - spike/wktraster/rt_pg

postgis-commits at postgis.refractions.net postgis-commits at postgis.refractions.net
Tue Mar 10 12:22:37 PDT 2009


Author: mloskot
Date: 2009-03-10 12:22:37 -0700 (Tue, 10 Mar 2009)
New Revision: 3836

Modified:
   spike/wktraster/rt_pg/rtpostgis.sql.in.c
Log:
First version of metadata table RASTER_COLUMNS based on the discussions at the ToCoSprint2009. Added stubs for related functions AddRasterColumn and DropRasterColumn. The functions are available from SQL but they do nothing, just return dummy message and print TODO notice. Added a bunch of comments. Let's spin, rock to roll\!

Modified: spike/wktraster/rt_pg/rtpostgis.sql.in.c
===================================================================
--- spike/wktraster/rt_pg/rtpostgis.sql.in.c	2009-03-10 18:20:20 UTC (rev 3835)
+++ spike/wktraster/rt_pg/rtpostgis.sql.in.c	2009-03-10 19:22:37 UTC (rev 3836)
@@ -11,6 +11,12 @@
 -- the terms of the GNU General Public Licence. See the COPYING file.
 --  
 -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+--
+-- TODO: Complete the warning and notes below.
+-- 
+-- WARNING: Any change in this file must be evaluated for compatibility.
+--
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 
 #define CREATEFUNCTION CREATE OR REPLACE FUNCTION
 #define _IMMUTABLE_STRICT IMMUTABLE STRICT
@@ -314,6 +320,88 @@
 );
 
 -------------------------------------------------------------------
+-- RASTER_COLUMNS
+--
+-- The metadata is documented in the WKT Raster specification:
+-- http://www.cef-cfr.ca/index.php?n=Membres.PierreRacineWKTRasterSpecifications
+--
+-- WARNING:
+-- The definition is still being discussed, so chances are it will
+-- change in near future. Consider current state a PROTOTYPE.
+-------------------------------------------------------------------
+
+CREATE TABLE raster_columns (
+    r_table_catalog varchar(256) not null,
+    r_table_schema varchar(256) not null,
+    r_table_name varchar(256) not null,
+    r_column varchar(256) not null,
+    srid integer not null,
+    pixel_types integer[] not null, -- TODO: int or char see the spec.
+    pixel_size double precision[] not null,
+    regular_blocking integer,
+    out_db integer,
+
+    -- TODO: See "What to put and not to put in it?"
+
+    CONSTRAINT raster_columns_pk primary key ( 
+		r_table_catalog, 
+		r_table_schema, 
+		r_table_name, 
+		r_column )
+) WITH OIDS;
+
+
+-------------------------------------------------------------------
+-- ADDRASTERCOLUMN
+-------------------------------------------------------------------
+
+CREATEFUNCTION AddRasterColumn(varchar, varchar, varchar, varchar, integer)
+    RETURNS text
+    AS 
+$$
+DECLARE
+	catalog_name alias for $1;
+	schema_name alias for $2;
+	table_name alias for $3;
+	column_name alias for $4;
+	new_srid alias for $5;
+
+BEGIN
+
+    RAISE NOTICE 'TODO: TO BE IMPLEMENTED';
+
+    RETURN schema_name || '.' || table_name || '.' || column_name ||' NOT added.';
+
+END;
+$$
+LANGUAGE 'plpgsql' _VOLATILE_STRICT; -- WITH (isstrict);
+
+
+-------------------------------------------------------------------
+-- DROPRASTERCOLUMN
+-------------------------------------------------------------------
+
+CREATEFUNCTION DropRasterColumn(varchar, varchar, varchar, varchar)
+    RETURNS text
+    AS 
+$$
+DECLARE
+	catalog_name alias for $1;
+	schema_name alias for $2;
+	table_name alias for $3;
+	column_name alias for $4;
+
+BEGIN
+
+    RAISE NOTICE 'TODO: TO BE IMPLEMENTED';
+
+    RETURN schema_name || '.' || table_name || '.' || column_name ||' NOT removed.';
+
+END;
+$$
+LANGUAGE 'plpgsql' _VOLATILE_STRICT; -- WITH (isstrict);
+
+-------------------------------------------------------------------
 --  END
 -------------------------------------------------------------------
 



More information about the postgis-commits mailing list