Переглянути джерело

Initial commit of the temporal GIS extension in grass. The file names
are still objects of change.


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@48132 15284696-431f-4ddb-bdfa-cd5b030d7da7

Soeren Gebbert 13 роки тому
батько
коміт
a3a45e61b4

+ 1 - 1
lib/python/Makefile

@@ -8,7 +8,7 @@ PYDIR = $(ETC)/python
 GDIR = $(PYDIR)/grass
 DSTDIR = $(GDIR)/script
 
-MODULES = core db raster raster3d vector array setup task
+MODULES = core db raster raster3d vector array setup task temporal
 
 PYFILES := $(patsubst %,$(DSTDIR)/%.py,$(MODULES) __init__)
 PYCFILES := $(patsubst %,$(DSTDIR)/%.pyc,$(MODULES) __init__)

+ 1 - 0
lib/python/__init__.py

@@ -3,3 +3,4 @@ from db     import *
 from raster import *
 from raster3d import *
 from vector import *
+from temporal import *

Різницю між файлами не показано, бо вона завелика
+ 1354 - 0
lib/python/temporal.py


+ 37 - 0
lib/temporal/map_stds_register_table_template.sql

@@ -0,0 +1,37 @@
+--#############################################################################
+-- This SQL script generates the table listing all STDS in
+-- which the GRASS_MAP map is registered
+--
+-- This table is map specific and created for each GRASS_MAP map which is registered 
+-- in a STDS. MAP_NAME is a placeholder for the dataset name.
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+PRAGMA foreign_keys = ON;
+
+-- MAP_NAME is a placeholder for specific map name (SQL compliant): name_mapset
+-- MAP_ID is a placeholder for specific map id: name@mapset
+-- GRASS_MAP is a placeholder for specific map type: raster, raster3d or vector
+-- STDS is a placeholder for specific space-time dataset type: strds, str3ds, stvds
+
+-- This table stores the names of the space-time datasets in which this map is registered 
+CREATE TABLE  MAP_NAME_STDS_register (
+  id VARCHAR NOT NULL, -- This column is a primary foreign key storing the STDS names
+  PRIMARY KEY (id),
+  FOREIGN KEY (id) REFERENCES  STDS_base (id) ON DELETE CASCADE
+);
+
+CREATE TRIGGER MAP_NAME_STDS_register_insert AFTER INSERT ON MAP_NAME_STDS_register 
+  BEGIN
+    UPDATE GRASS_MAP_base SET modification_time = datetime("NOW") WHERE GRASS_MAP_base.id = "MAP_ID";
+    UPDATE GRASS_MAP_base SET revision = (revision + 1) WHERE GRASS_MAP_base.id = "MAP_ID";
+  END;
+
+CREATE TRIGGER MAP_NAME_STDS_register_delete AFTER DELETE ON MAP_NAME_STDS_register 
+  BEGIN
+    UPDATE GRASS_MAP_base SET modification_time = datetime("NOW") WHERE GRASS_MAP_base.id = "MAP_ID";
+    UPDATE GRASS_MAP_base SET revision = (revision + 1) WHERE GRASS_MAP_base.id = "MAP_ID";
+  END;
+
+

+ 79 - 0
lib/temporal/map_tables_template.sql

@@ -0,0 +1,79 @@
+--#############################################################################
+-- This SQL script generates the grass map tables to store time stamps, revision
+-- and spatial extent for SQL queries and temporal GIS support.
+-- Additionally several triggers are created for convenient functions
+-- The grass map metadata is map specific (raster, raster3d and vector maps are 
+-- supported)
+--
+-- The placeholder GRASS_MAP will be replaced by raster, raster3d and vector
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+-- GRASS_MAP is a placeholder for specific map type: raster, raster3d or vector
+
+PRAGMA foreign_keys = ON;
+
+CREATE TABLE  GRASS_MAP_base (
+  id VARCHAR NOT NULL,                  -- The id (PK) is the unique identifier for all tables, it is based on name and mapset (name@mapset) and is used as primary key
+  name VARCHAR NOT NULL,                -- name of the grass map
+  mapset VARCHAR NOT NULL,              -- mapset of the grass map
+  creator VARCHAR NOT NULL,
+  temporal_type VARCHAR,                -- The temporal type of the grass map "absolute" or "relative" or NULL in case no time stamp is available
+  creation_time TIMESTAMP NOT NULL,      -- The time of creation of the grass map
+  modification_time TIMESTAMP NOT NULL,  -- The time of the last modification of the grass map
+  revision SMALLINT NOT NULL,           -- The revision number
+  PRIMARY KEY (id)
+);
+
+CREATE TABLE  GRASS_MAP_relative_time (
+  id VARCHAR NOT NULL,                  -- The id (PFK) is the unique identifier for all tables, it is based on name and mapset (name@mapset) and is used as primary foreign key
+  interval DOUBLE PRECISION,  -- The relative time interval in [days], this interval starts always from 0 or the event befor this event
+  PRIMARY KEY (id),
+  FOREIGN KEY (id) REFERENCES  GRASS_MAP_base (id) ON DELETE CASCADE
+);
+
+CREATE TABLE  GRASS_MAP_absolute_time (
+  id VARCHAR NOT NULL,                  -- The id (PFK) is the unique identifier for all tables, it is based on name and mapset (name@mapset) and is used as primary foreign key
+  start_time TIMESTAMP,    --  Start of the valid time, can be NULL if no time information is available
+  end_time TIMESTAMP,      --  End of the valid time, can be NULL if no time information is available or valid time is a single point in time
+  timezone SMALLINT,      -- The timezone of the valid time
+  PRIMARY KEY (id),
+  FOREIGN KEY (id) REFERENCES  GRASS_MAP_base (id) ON DELETE CASCADE
+);
+
+-- The spatial extent of a raster map
+
+CREATE TABLE  GRASS_MAP_spatial_extent (
+  id VARCHAR NOT NULL,                  -- The id (PFK) is the unique identifier for all tables, it is based on name and mapset (name@mapset) and is used as primary foreigen key
+  -- below is the spatial extent of the map
+  north DOUBLE PRECISION NOT NULL,
+  south DOUBLE PRECISION NOT NULL,
+  east DOUBLE PRECISION NOT NULL,
+  west DOUBLE PRECISION NOT NULL,
+  top DOUBLE PRECISION NOT NULL,
+  bottom DOUBLE PRECISION NOT NULL,
+  PRIMARY KEY (id),
+  FOREIGN KEY (id) REFERENCES  GRASS_MAP_base (id) ON DELETE CASCADE
+);
+
+-- Create a trigger to update the modification time and revision number in case the metadata or timestanps have been updated 
+
+CREATE TRIGGER update_GRASS_MAP_absolute_time AFTER UPDATE ON GRASS_MAP_absolute_time 
+  BEGIN
+    UPDATE GRASS_MAP_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE GRASS_MAP_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+CREATE TRIGGER update_GRASS_MAP_relative_time AFTER UPDATE ON GRASS_MAP_relative_time 
+  BEGIN
+    UPDATE GRASS_MAP_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE GRASS_MAP_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+
+CREATE TRIGGER update_GRASS_MAP_spatial_extent AFTER UPDATE ON GRASS_MAP_spatial_extent 
+  BEGIN
+    UPDATE GRASS_MAP_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE GRASS_MAP_base SET revision = (revision + 1) WHERE id = old.id;
+  END;

+ 81 - 0
lib/temporal/raster3d_metadata_table.sql

@@ -0,0 +1,81 @@
+--#############################################################################
+-- This SQL script generates the raster3d metadata table to store 
+-- and metadata for SQL queries and temporal GIS support. Additionally two views
+-- are created to access all map specific tables
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+PRAGMA foreign_keys = ON;
+
+-- The metadata table reflects most of the raster3d metadata available in grass
+
+CREATE TABLE  raster3d_metadata (
+  id VARCHAR NOT NULL,                  -- The id (PFK) is the unique identifier for all tables, it is based on name and mapset (name@mapset) and is used as primary foreign key
+  str3ds_register VARCHAR, -- The name of the table storing all space-time raster3d datasets in which this map is registered
+  maptype VARCHAR NOT NULL,
+  cols INTEGER NOT NULL,
+  rows INTEGER NOT NULL,
+  depths INTEGER NOT NULL,
+  number_of_cells INTEGER NOT NULL,
+  nsres DOUBLE PRECISION NOT NULL,
+  ewres DOUBLE PRECISION NOT NULL,
+  tbres DOUBLE PRECISION NOT NULL,
+  min DOUBLE PRECISION NOT NULL,
+  max DOUBLE PRECISION NOT NULL,
+  PRIMARY KEY (id),
+  FOREIGN KEY (id) REFERENCES  raster3d_base (id) ON DELETE CASCADE
+);
+
+-- Create the views to access all cols for the absolute and relative time
+
+CREATE VIEW raster3d_view_abs_time AS SELECT 
+            A1.id, A1.mapset,
+            A1.name, A1.temporal_type,
+            A1.creation_time, A1.modification_time,
+            A1.revision, A1.creator, 
+	    A2.start_time, A2.end_time, 
+            A3.north, A3.south, A3.east, A3.west,
+	    A4.maptype, A4.cols, A4.rows, A4.depths,
+            A4.nsres, A4.ewres, A4.tbres,
+            A4.min, A4.max,
+	    A4.str3ds_register,
+            A4.number_of_cells
+	    FROM raster3d_base A1, raster3d_absolute_time A2, 
+            raster3d_spatial_extent A3, raster3d_metadata A4 
+	    WHERE A1.id = A2.id AND A1.id = A3.id AND A1.id = A4.id;
+
+CREATE VIEW raster3d_view_rel_time AS SELECT 
+            A1.id, A1.mapset,
+            A1.name, A1.temporal_type,
+            A1.creation_time, A1.modification_time,
+            A1.revision, A1.creator, 
+	    A2.interval,
+            A3.north, A3.south, A3.east, A3.west,
+	    A4.maptype, A4.cols, A4.rows, A4.depths,
+            A4.nsres, A4.ewres, A4.tbres,
+            A4.min, A4.max,
+	    A4.str3ds_register,
+            A4.number_of_cells
+	    FROM raster3d_base A1, raster3d_relative_time A2, 
+            raster3d_spatial_extent A3, raster3d_metadata A4 
+	    WHERE A1.id = A2.id AND A1.id = A3.id AND A1.id = A4.id;
+
+-- Create a trigger to update the modification time and revision number in case the metadata have been updated 
+
+CREATE TRIGGER update_raster3d_metadata AFTER UPDATE ON raster3d_metadata 
+  BEGIN
+    UPDATE raster3d_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE raster3d_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+-- Create trigger for automated deletion of dependent rows, this should normally be done using foreign keys 
+
+CREATE TRIGGER delete_raster3d_base AFTER DELETE ON raster3d_base
+  BEGIN
+    DELETE FROM raster3d_absolute_time WHERE id = old.id;
+    DELETE FROM raster3d_relative_time WHERE id = old.id;
+    DELETE FROM raster3d_spatial_extent WHERE id = old.id;
+    DELETE FROM raster3d_metadata WHERE id = old.id;
+  END;
+

+ 77 - 0
lib/temporal/raster_metadata_table.sql

@@ -0,0 +1,77 @@
+--#############################################################################
+-- This SQL script generates the raster metadata table to store 
+-- and metadata for SQL queries and temporal GIS support. Additionally two views
+-- are created to access all map specific tables
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+PRAGMA foreign_keys = ON;
+
+-- The metadata table reflects most of the raster metadata available in grass
+
+CREATE TABLE  raster_metadata (
+  id VARCHAR NOT NULL,                  -- The id (PFK) is the unique identifier for all tables, it is based on name and mapset (name@mapset) and is used as primary foreign key
+  strds_register VARCHAR, -- The name of the table storing all space-time raster datasets in which this map is registered
+  datatype VARCHAR NOT NULL,
+  cols INTEGER NOT NULL,
+  rows INTEGER NOT NULL,
+  number_of_cells INTEGER NOT NULL,
+  nsres DOUBLE PRECISION NOT NULL,
+  ewres DOUBLE PRECISION NOT NULL,
+  min DOUBLE PRECISION NOT NULL,
+  max DOUBLE PRECISION NOT NULL,
+  PRIMARY KEY (id),
+  FOREIGN KEY (id) REFERENCES  raster_base (id) ON DELETE CASCADE
+);
+
+-- Create the views to access all cols for the absolute and relative time
+
+CREATE VIEW raster_view_abs_time AS SELECT 
+            A1.id, A1.mapset,
+            A1.name, A1.temporal_type,
+            A1.creation_time, A1.modification_time,
+            A1.revision, A1.creator, 
+	    A2.start_time, A2.end_time, 
+            A3.north, A3.south, A3.east, A3.west,
+	    A4.datatype, A4.cols, A4.rows,
+            A4.nsres, A4.ewres, A4.min, A4.max,
+	    A4.strds_register,
+            A4.number_of_cells
+	    FROM raster_base A1, raster_absolute_time A2, 
+            raster_spatial_extent A3, raster_metadata A4 
+	    WHERE A1.id = A2.id AND A1.id = A3.id AND A1.id = A4.id;
+
+CREATE VIEW raster_view_rel_time AS SELECT 
+            A1.id, A1.mapset,
+            A1.name, A1.temporal_type,
+            A1.creation_time, A1.modification_time,
+            A1.revision, A1.creator, 
+	    A2.interval,
+            A3.north, A3.south, A3.east, A3.west,
+	    A4.datatype, A4.cols, A4.rows,
+            A4.nsres, A4.ewres, A4.min, A4.max,
+	    A4.strds_register,
+            A4.number_of_cells
+	    FROM raster_base A1, raster_relative_time A2, 
+            raster_spatial_extent A3, raster_metadata A4 
+	    WHERE A1.id = A2.id AND A1.id = A3.id AND A1.id = A4.id;
+
+-- Create a trigger to update the modification time and revision number in case the metadata have been updated 
+
+CREATE TRIGGER update_raster_metadata AFTER UPDATE ON raster_metadata 
+  BEGIN
+    UPDATE raster_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE raster_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+-- Create trigger for automated deletion of dependent rows, this should normally be done using foreign keys 
+
+CREATE TRIGGER delete_raster_base AFTER DELETE ON raster_base
+  BEGIN
+    DELETE FROM raster_absolute_time WHERE id = old.id;
+    DELETE FROM raster_relative_time WHERE id = old.id;
+    DELETE FROM raster_spatial_extent WHERE id = old.id;
+    DELETE FROM raster_metadata WHERE id = old.id;
+  END;
+

+ 111 - 0
lib/temporal/stds_map_register_table_template.sql

@@ -0,0 +1,111 @@
+--#############################################################################
+-- This SQL script generates the table in which all registered GRASS_MAP maps 
+-- are listed in.
+--
+-- This table will be created for each STDS.
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+-- SPACETIME_NAME is a placeholder for specific stds name (SQL compliant): name_mapset
+-- SPACETIME_ID is a placeholder for specific stds id: name@mapset
+-- GRASS_MAP is a placeholder for specific map type: raster, raster3d or vector
+-- STDS is a placeholder for specific space-time dataset type: strds, str3ds, stvds
+
+PRAGMA foreign_keys = ON;
+
+-- This table stores the.ids of the GRASS_MAP maps registered in the current spacetime GRASS_MAP table
+CREATE TABLE  SPACETIME_NAME_GRASS_MAP_register (
+  id VARCHAR NOT NULL, -- This colum is a primary foreign key storing the registered GRASS_MAP map.ids
+  PRIMARY KEY (id),
+  FOREIGN KEY (id) REFERENCES  GRASS_MAP_base (id) ON DELETE CASCADE
+);
+
+CREATE TRIGGER SPACETIME_NAME_GRASS_MAP_register_insert_trigger AFTER INSERT ON SPACETIME_NAME_GRASS_MAP_register 
+  BEGIN
+    UPDATE STDS_base SET modification_time = datetime("NOW") WHERE id = "SPACETIME_ID";
+    UPDATE STDS_base SET revision = (revision + 1) WHERE id = "SPACETIME_ID";
+    -- Number of registered maps
+    UPDATE STDS_metadata SET number_of_registered_maps = 
+           (SELECT count.id) FROM  SPACETIME_NAME_GRASS_MAP_register)
+           WHERE id = "SPACETIME_ID";
+    -- Update the temporal extent
+    UPDATE STDS_absolute_time SET start_time = 
+           (SELECT min(start_time) FROM GRASS_MAP_absolute_time WHERE GRASS_MAP_absolute_time.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_absolute_time SET end_time = 
+           (SELECT max(end_time) FROM GRASS_MAP_absolute_time WHERE GRASS_MAP_absolute_time.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    -- Update the spatial extent
+    UPDATE STDS_spatial_extent SET north = 
+           (SELECT max(north) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET south = 
+           (SELECT min(south) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET east = 
+           (SELECT max(east) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET west = 
+           (SELECT min(west) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET top = 
+           (SELECT max(top) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET bottom = 
+           (SELECT min(bottom) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+  END;
+
+CREATE TRIGGER SPACETIME_NAME_GRASS_MAP_register_delete_trigger AFTER DELETE ON SPACETIME_NAME_GRASS_MAP_register 
+  BEGIN
+    UPDATE STDS_base SET modification_time = datetime("NOW") WHERE id = "SPACETIME_ID";
+    UPDATE STDS_base SET revision = (revision + 1) WHERE id = "SPACETIME_ID";
+    -- Number of registered maps
+    UPDATE STDS_metadata SET number_of_registered_maps = 
+           (SELECT count.id) FROM  SPACETIME_NAME_GRASS_MAP_register)
+           WHERE id = "SPACETIME_ID";
+    -- Update the temporal extent
+    UPDATE STDS_absolute_time SET start_time = 
+           (SELECT min(start_time) FROM GRASS_MAP_absolute_time WHERE GRASS_MAP_absolute_time.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_absolute_time SET end_time = 
+           (SELECT max(end_time) FROM GRASS_MAP_absolute_time WHERE GRASS_MAP_absolute_time.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    -- Update the spatial extent
+    UPDATE STDS_spatial_extent SET north = 
+           (SELECT max(north) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET south = 
+           (SELECT min(south) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET east = 
+           (SELECT max(east) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET west = 
+           (SELECT min(west) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET top = 
+           (SELECT max(top) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE STDS_spatial_extent SET bottom = 
+           (SELECT min(bottom) FROM GRASS_MAP_spatial_extent WHERE GRASS_MAP_spatial_extent.id IN 
+			(SELECT id FROM SPACETIME_NAME_GRASS_MAP_register)
+           ) WHERE id = "SPACETIME_ID";
+  END;
+

+ 104 - 0
lib/temporal/stds_raster3d_register_trigger_template.sql

@@ -0,0 +1,104 @@
+--#############################################################################
+-- This SQL script creates a trigger to update a space-time raster3d dataset
+-- metadata
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+-- SPACETIME_NAME is a placeholder for specific stds name (SQL compliant): name_mapset
+-- SPACETIME_ID is a placeholder for specific stds id: name@mapset
+
+PRAGMA foreign_keys = ON;
+
+CREATE TRIGGER SPACETIME_NAME_raster3d_metadata_register_insert_trigger AFTER INSERT ON SPACETIME_NAME_raster3d_register 
+  BEGIN
+    -- Update the min and max values
+    UPDATE str3ds_metadata SET min_min = 
+           (SELECT min(min) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET min_max = 
+           (SELECT max(min) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET max_min = 
+           (SELECT min(max) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET max_max = 
+           (SELECT max(max) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    -- Update the resolution
+    UPDATE str3ds_metadata SET nsres_min = 
+           (SELECT min(nsres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET nsres_max = 
+           (SELECT max(nsres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET ewres_min = 
+           (SELECT min(ewres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET ewres_max = 
+           (SELECT max(ewres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET tbres_min = 
+           (SELECT min(tbres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET tbres_max = 
+           (SELECT max(tbres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+  END;
+
+CREATE TRIGGER SPACETIME_NAME_raster3d_metadata_register_delete_trigger AFTER DELETE ON SPACETIME_NAME_raster3d_register 
+  BEGIN
+    -- Update the min and max values
+    UPDATE str3ds_metadata SET min_min = 
+           (SELECT min(min) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET min_max = 
+           (SELECT max(min) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET max_min = 
+           (SELECT min(max) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET max_max = 
+           (SELECT max(max) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    -- Update the resolution
+    UPDATE str3ds_metadata SET nsres_min = 
+           (SELECT min(nsres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET nsres_max = 
+           (SELECT max(nsres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET ewres_min = 
+           (SELECT min(ewres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET ewres_max = 
+           (SELECT max(ewres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET tbres_min = 
+           (SELECT min(tbres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE str3ds_metadata SET tbres_max = 
+           (SELECT max(tbres) FROM raster3d_metadata WHERE raster3d_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster3d_register)
+           ) WHERE id = "SPACETIME_ID";
+  END;
+

+ 88 - 0
lib/temporal/stds_raster_register_trigger_template.sql

@@ -0,0 +1,88 @@
+--#############################################################################
+-- This SQL script creates a trigger to update a space-time raster dataset
+-- metadata
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+-- SPACETIME_NAME is a placeholder for specific stds name (SQL compliant): name_mapset
+-- SPACETIME_ID is a placeholder for specific stds id: name@mapset
+
+PRAGMA foreign_keys = ON;
+
+CREATE TRIGGER SPACETIME_NAME_raster_metadata_register_insert_trigger AFTER INSERT ON SPACETIME_NAME_raster_register 
+  BEGIN
+    -- Update the min and max values
+    UPDATE strds_metadata SET min_min = 
+           (SELECT min(min) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET min_max = 
+           (SELECT max(min) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET max_min = 
+           (SELECT min(max) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET max_max = 
+           (SELECT max(max) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    -- Update the resolution
+    UPDATE strds_metadata SET nsres_min = 
+           (SELECT min(nsres) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET nsres_max = 
+           (SELECT max(nsres) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET ewres_min = 
+           (SELECT min(ewres) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET ewres_max = 
+           (SELECT max(ewres) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+  END;
+
+CREATE TRIGGER SPACETIME_NAME_raster_metadata_register_delete_trigger AFTER DELETE ON SPACETIME_NAME_raster_register 
+  BEGIN
+    -- Update the min and max values
+    UPDATE strds_metadata SET min_min = 
+           (SELECT min(min) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET min_max = 
+           (SELECT max(min) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET max_min = 
+           (SELECT min(max) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET max_max = 
+           (SELECT max(max) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    -- Update the resolution
+    UPDATE strds_metadata SET nsres_min = 
+           (SELECT min(nsres) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET nsres_max = 
+           (SELECT max(nsres) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET ewres_min = 
+           (SELECT min(ewres) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+    UPDATE strds_metadata SET ewres_max = 
+           (SELECT max(ewres) FROM raster_metadata WHERE raster_metadata.id IN 
+			(SELECT id FROM SPACETIME_NAME_raster_register)
+           ) WHERE id = "SPACETIME_ID";
+  END;
+

+ 74 - 0
lib/temporal/stds_tables_template.sql

@@ -0,0 +1,74 @@
+--#############################################################################
+-- This SQL script generates the space time dataset tables to store time 
+-- stamps and revision for SQL queries and temporal GIS support.
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+-- STDS is a placeholder for specific space-time dataset type: strds, str3ds, stvds
+
+PRAGMA foreign_keys = ON;
+
+CREATE TABLE  STDS_base (
+  id VARCHAR NOT NULL,                 -- Id of the space-time dataset, name@mapset this is the primary key
+  name VARCHAR NOT NULL,               -- name of the space-time dataset
+  mapset VARCHAR NOT NULL,             -- mapset of the space-time dataset
+  creator VARCHAR NOT NULL,            -- Name of the creator
+  temporal_type VARCHAR NOT NULL,      -- The temporal type of the dataset "absolute" or "relative" 
+  semantic_type VARCHAR NOT NULL,      -- The semantic data description used for aggregation/decomposition algorithm selection
+  creation_time TIMESTAMP NOT NULL,     -- The time of creation of the space-time dataset
+  modification_time TIMESTAMP NOT NULL, -- The time of the last modification of the space-time dataset
+  revision SMALLINT NOT NULL,          -- The revision number
+  PRIMARY KEY (id)
+);
+
+CREATE TABLE  STDS_relative_time (
+  id VARCHAR NOT NULL,            -- Id of the space-time dataset, this is the primary foreign key
+  interval DOUBLE,                -- The relative time interval in [days], this interval starts always at 0 days 
+  granularity DOUBLE,             -- The granularity in [days]
+  PRIMARY KEY (id),  
+  FOREIGN KEY (id) REFERENCES  STDS_base (id) ON DELETE CASCADE
+);
+
+CREATE TABLE  STDS_absolute_time (
+  id VARCHAR NOT NULL,            -- Id of the space-time dataset, this is the primary foreign key
+  start_time TIMESTAMP,            -- Start of the valid time, can be NULL if no map is registered
+  end_time TIMESTAMP,              -- End of the valid time, can be NULL if no map is registered
+  granularity VARCHAR,            -- The granularity "NNN seconds, NNN minutes, NNN hours, NNN days, NNN weeks, NNN months, NNN years"
+  timezone SMALLINT,              -- The time zone number
+  PRIMARY KEY (id),  
+  FOREIGN KEY (id) REFERENCES  STDS_base (id) ON DELETE CASCADE
+);
+
+CREATE TABLE  STDS_spatial_extent (
+  id VARCHAR NOT NULL,      -- Id of the space-time dataset, this is the primary foreign key
+  north DOUBLE PRECISION,   -- The spatial north extent, derived from the registered maps
+  south DOUBLE PRECISION,   -- The spatial south extent, derived from the registered maps
+  east DOUBLE PRECISION,    -- The spatial east extent, derived from the registered maps
+  west DOUBLE PRECISION,    -- The spatial west extent, derived from the registered maps
+  top DOUBLE PRECISION,     -- The spatial top extent, derived from the registered maps
+  bottom DOUBLE PRECISION,  -- The spatial bottom extent, derived from the registered maps
+  PRIMARY KEY (id),  
+  FOREIGN KEY (id) REFERENCES  STDS_base (id) ON DELETE CASCADE
+);
+
+-- Create a trigger to update the modification time and revision number in case the metadata or timestanps have been updated 
+
+CREATE TRIGGER update_STDS_abs_time AFTER UPDATE ON STDS_absolute_time 
+  BEGIN
+    UPDATE STDS_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE STDS_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+CREATE TRIGGER update_STDS_rel_time AFTER UPDATE ON STDS_relative_time 
+  BEGIN
+    UPDATE STDS_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE STDS_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+CREATE TRIGGER update_STDS_spatial_extent AFTER UPDATE ON STDS_spatial_extent 
+  BEGIN
+    UPDATE STDS_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE STDS_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+

+ 87 - 0
lib/temporal/str3ds_metadata_table.sql

@@ -0,0 +1,87 @@
+--#############################################################################
+-- This SQL script generates the space time raster3d dataset metadata table,
+-- view and trigger
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+PRAGMA foreign_keys = ON;
+
+CREATE TABLE  str3ds_metadata (
+  id VARCHAR NOT NULL,               -- Id of the space-time raster3d dataset, this is the primary foreign key
+  raster3d_register VARCHAR,         -- The id of the table in which the raster3d maps are registered for this dataset
+  number_of_registered_maps INTEGER, -- The number of registered raster3d maps
+  max_min DOUBLE PRECISION,          -- The minimal maximum of the registered raster3d maps
+  min_min DOUBLE PRECISION,          -- The minimal minimum of the registered raster3d maps
+  max_max DOUBLE PRECISION,          -- The maximal maximum of the registered raster3d maps
+  min_max DOUBLE PRECISION,          -- The maximal minimum of the registered raster3d maps
+  nsres_min DOUBLE PRECISION,        -- The lowest north-south resolution of the registered raster3d maps
+  nsres_max DOUBLE PRECISION,        -- The highest north-south resolution of the registered raster3d maps
+  ewres_min DOUBLE PRECISION,        -- The lowest east-west resolution of the registered raster3d maps
+  ewres_max DOUBLE PRECISION,        -- The highest east-west resolution of the registered raster3d maps
+  tbres_min DOUBLE PRECISION,        -- The lowest top-bottom resolution of the registered raster3d maps
+  tbres_max DOUBLE PRECISION,        -- The highest top-bottom resolution of the registered raster3d maps
+  title VARCHAR,                     -- Title of the space-time raster3d dataset
+  description VARCHAR,               -- Detailed description of the space-time raster3d dataset
+  PRIMARY KEY (id),  
+  FOREIGN KEY (id) REFERENCES  str3ds_base (id) ON DELETE CASCADE
+);
+-- Create the views to access all cols for absolute or relative time
+
+CREATE VIEW str3ds_view_abs_time AS SELECT 
+            A1.id, A1.temporal_type,
+            A1.creator, A1.semantic_type,  
+            A1.creation_time, A1.modification_time,
+            A1.revision, A2.start_time,
+	    A2.end_time, A2.granularity,
+	    A3.north, A3.south, A3.east, A3.west,
+	    A4.raster3d_register,
+	    A4.number_of_registered_maps, 
+            A4.nsres_min, A4.ewres_min, 
+            A4.nsres_max, A4.ewres_max, 
+            A4.tbres_min, A4.tbres_max, 
+	    A4.min_min, A4.min_max,
+	    A4.max_min, A4.max_max,
+            A4.title, A4.description	
+	    FROM str3ds_base A1, str3ds_absolute_time A2,  
+            str3ds_spatial_extent A3, str3ds_metadata A4 WHERE A1.id = A2.id AND 
+	    A1.id = A3.id AND A1.id = A4.id;
+
+CREATE VIEW str3ds_view_rel_time AS SELECT 
+            A1.id, A1.temporal_type,
+            A1.creator, A1.semantic_type,  
+            A1.creation_time, A1.modification_time,
+            A1.revision, 
+	    A2.interval, A2.granularity,
+	    A3.north, A3.south, A3.east, A3.west,
+	    A4.raster3d_register,
+	    A4.number_of_registered_maps, 
+            A4.nsres_min, A4.ewres_min, 
+            A4.nsres_max, A4.ewres_max, 
+            A4.tbres_min, A4.tbres_max, 
+	    A4.min_min, A4.min_max,
+	    A4.max_min, A4.max_max,
+            A4.title, A4.description	
+	    FROM str3ds_base A1, str3ds_relative_time A2,  
+            str3ds_spatial_extent A3, str3ds_metadata A4 WHERE A1.id = A2.id AND 
+	    A1.id = A3.id AND A1.id = A4.id;
+
+
+-- Create a trigger to update the modification time and revision number in case the metadata or timestanps have been updated 
+
+CREATE TRIGGER update_str3ds_metadata AFTER UPDATE ON str3ds_metadata 
+  BEGIN
+    UPDATE str3ds_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE str3ds_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+-- Create trigger for automated deletion of dependent rows, this should normally be done using foreign keys 
+
+CREATE TRIGGER delete_str3ds_base AFTER DELETE ON str3ds_base
+  BEGIN
+    DELETE FROM str3ds_absolute_time WHERE id = old.id;
+    DELETE FROM str3ds_relative_time WHERE id = old.id;
+    DELETE FROM str3ds_spatial_extent WHERE id = old.id;
+    DELETE FROM str3ds_metadata WHERE id = old.id;
+  END;
+

+ 83 - 0
lib/temporal/strds_metadata_table.sql

@@ -0,0 +1,83 @@
+--#############################################################################
+-- This SQL script generates the space time raster dataset metadata table,
+-- view and trigger
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+PRAGMA foreign_keys = ON;
+
+CREATE TABLE  strds_metadata (
+  id VARCHAR NOT NULL,            -- Id of the space-time dataset, this is the primary foreign key
+  raster_register VARCHAR,                    -- The id of the table in which the raster maps are registered for this dataset
+  number_of_registered_maps INTEGER,          -- The number of registered raster maps
+  max_min DOUBLE PRECISION,                   -- The minimal maximum of the registered raster maps
+  min_min DOUBLE PRECISION,                   -- The minimal minimum of the registered raster maps
+  max_max DOUBLE PRECISION,                   -- The maximal maximum of the registered raster maps
+  min_max DOUBLE PRECISION,                   -- The maximal minimum of the registered raster maps
+  nsres_min DOUBLE PRECISION,                 -- The lowest north-south resolution of the registered raster maps
+  nsres_max DOUBLE PRECISION,                 -- The highest north-south resolution of the registered raster maps
+  ewres_min DOUBLE PRECISION,                 -- The lowest east-west resolution of the registered raster maps
+  ewres_max DOUBLE PRECISION,                 -- The highest east-west resolution of the registered raster maps
+  title VARCHAR,                              -- Title of the space-time raster dataset
+  description VARCHAR,                        -- Detailed description of the space-time raster dataset
+  PRIMARY KEY (id),  
+  FOREIGN KEY (id) REFERENCES  strds_base (id) ON DELETE CASCADE
+);
+-- Create the views to access all cols for absolute or relative time
+
+CREATE VIEW strds_view_abs_time AS SELECT 
+            A1.id, A1.temporal_type,
+            A1.creator, A1.semantic_type,  
+            A1.creation_time, A1.modification_time,
+            A1.revision, A2.start_time,
+	    A2.end_time, A2.granularity,
+	    A3.north, A3.south, A3.east, A3.west,
+	    A4.raster_register,
+	    A4.number_of_registered_maps, 
+            A4.nsres_min, A4.ewres_min, 
+            A4.nsres_max, A4.ewres_max, 
+	    A4.min_min, A4.min_max,
+	    A4.max_min, A4.max_max,
+            A4.title, A4.description	
+	    FROM strds_base A1, strds_absolute_time A2,  
+            strds_spatial_extent A3, strds_metadata A4 WHERE A1.id = A2.id AND 
+	    A1.id = A3.id AND A1.id = A4.id;
+
+CREATE VIEW strds_view_rel_time AS SELECT 
+            A1.id, A1.temporal_type,
+            A1.creator, A1.semantic_type,  
+            A1.creation_time, A1.modification_time,
+            A1.revision, 
+	    A2.interval, A2.granularity,
+	    A3.north, A3.south, A3.east, A3.west,
+	    A4.raster_register,
+	    A4.number_of_registered_maps, 
+            A4.nsres_min, A4.ewres_min, 
+            A4.nsres_max, A4.ewres_max, 
+	    A4.min_min, A4.min_max,
+	    A4.max_min, A4.max_max,
+            A4.title, A4.description	
+	    FROM strds_base A1, strds_relative_time A2,  
+            strds_spatial_extent A3, strds_metadata A4 WHERE A1.id = A2.id AND 
+	    A1.id = A3.id AND A1.id = A4.id;
+
+
+-- Create a trigger to update the modification time and revision number in case the metadata or timestanps have been updated 
+
+CREATE TRIGGER update_strds_metadata AFTER UPDATE ON strds_metadata 
+  BEGIN
+    UPDATE strds_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE strds_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+-- Create trigger for automated deletion of dependent rows, this should normally be done using foreign keys 
+
+CREATE TRIGGER delete_strds_base AFTER DELETE ON strds_base
+  BEGIN
+    DELETE FROM strds_absolute_time WHERE id = old.id;
+    DELETE FROM strds_relative_time WHERE id = old.id;
+    DELETE FROM strds_spatial_extent WHERE id = old.id;
+    DELETE FROM strds_metadata WHERE id = old.id;
+  END;
+

+ 67 - 0
lib/temporal/stvds_metadata_table.sql

@@ -0,0 +1,67 @@
+--#############################################################################
+-- This SQL script generates the space time vector dataset metadata table,
+-- view and trigger
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+PRAGMA foreign_keys = ON;
+
+CREATE TABLE  stvds_metadata (
+  id VARCHAR NOT NULL,                -- Name of the space-time vector dataset, this is the primary foreign key
+  vector_register VARCHAR,                    -- The id of the table in which the vector maps are registered for this dataset
+  number_of_registered_maps INTEGER,          -- The number of registered vector maps
+  title VARCHAR,                              -- Title of the space-time vector dataset
+  description VARCHAR,                        -- Detailed description of the space-time vector dataset
+  PRIMARY KEY (id),  
+  FOREIGN KEY (id) REFERENCES  stvds_base (id) ON DELETE CASCADE
+);
+-- Create the views to access all columns for absolute or relative time
+
+CREATE VIEW stvds_view_abs_time AS SELECT 
+            A1.id, A1.temporal_type,
+            A1.creator, A1.semantic_type,  
+            A1.creation_time, A1.modification_time,
+            A1.revision, A2.start_time,
+	    A2.end_time, A2.granularity,
+	    A3.north, A3.south, A3.east, A3.west,
+	    A4.vector_register,
+	    A4.number_of_registered_maps, 
+            A4.title, A4.description	
+	    FROM stvds_base A1, stvds_absolute_time A2,  
+            stvds_spatial_extent A3, stvds_metadata A4 WHERE A1.id = A2.id AND 
+	    A1.id = A3.id AND A1.id = A4.id;
+
+CREATE VIEW stvds_view_rel_time AS SELECT 
+            A1.id, A1.temporal_type,
+            A1.creator, A1.semantic_type,  
+            A1.creation_time, A1.modification_time,
+            A1.revision, 
+	    A2.interval, A2.granularity,
+	    A3.north, A3.south, A3.east, A3.west,
+	    A4.vector_register,
+	    A4.number_of_registered_maps, 
+            A4.title, A4.description	
+	    FROM stvds_base A1, stvds_relative_time A2,  
+            stvds_spatial_extent A3, stvds_metadata A4 WHERE A1.id = A2.id AND 
+	    A1.id = A3.id AND A1.id = A4.id;
+
+
+-- Create a trigger to update the modification time and revision number in case the metadata or timestanps have been updated 
+
+CREATE TRIGGER update_stvds_metadata AFTER UPDATE ON stvds_metadata 
+  BEGIN
+    UPDATE stvds_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE stvds_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+-- Create trigger for automated deletion of dependent rows, this should normally be done using foreign keys 
+
+CREATE TRIGGER delete_stvds_base AFTER DELETE ON stvds_base
+  BEGIN
+    DELETE FROM stvds_absolute_time WHERE id = old.id;
+    DELETE FROM stvds_relative_time WHERE id = old.id;
+    DELETE FROM stvds_spatial_exntent WHERE id = old.id;
+    DELETE FROM stvds_metadata WHERE id = old.id;
+  END;
+

+ 374 - 0
lib/temporal/test.temporal.py

@@ -0,0 +1,374 @@
+from temporal import *
+import os
+
+###############################################################################
+
+def test_dict_sql_serializer():
+    t = dict_sql_serializer()
+    t.test()
+
+def test_dataset_identifer():
+	for i in range(2):
+	    base = raster_base(ident="soil" + str(i) + "@PERMANENT", name="soil" + str(i), mapset="PERMANENT", creator="soeren", temporal_type="absolute", revision=1)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_creator("rene")
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = raster3d_base(ident="soil" + str(i) + "@PERMANENT", name="soil" + str(i), mapset="PERMANENT", creator="soeren")
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_creator("rene")
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = vector_base(ident="soil" + str(i) + "@PERMANENT", name="soil" + str(i), mapset="PERMANENT", creator="soeren")
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_creator("rene")
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+def test_absolute_timestamp():
+	for i in range(2):
+	    base = raster_absolute_time(ident="soil" + str(i) + "@PERMANENT", start_time=datetime(2011,01,01), end_time=datetime(2011,07,01), timezone=1)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_start_time(datetime(2010,01,01))
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = raster3d_absolute_time(ident="soil" + str(i) + "@PERMANENT", start_time=datetime(2011,01,01), end_time=datetime(2011,07,01), timezone=1)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_start_time(datetime(2010,01,01))
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = vector_absolute_time(ident="soil" + str(i) + "@PERMANENT", start_time=datetime(2011,01,01), end_time=datetime(2011,07,01), timezone=1)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_start_time(datetime(2010,01,01))
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+def test_spatial_extent():
+	for i in range(2):
+	    base = raster_spatial_extent(ident="soil" + str(i) + "@PERMANENT", north=100 + i, south=10+i, east=50+i, west=20+i, top=i, bottom=0)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_north(120+i)
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = raster3d_spatial_extent(ident="soil" + str(i) + "@PERMANENT", north=100 + i, south=10+i, east=50+i, west=20+i, top=i, bottom=0)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_north(120+i)
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = vector_spatial_extent(ident="soil" + str(i) + "@PERMANENT", north=100 + i, south=10+i, east=50+i, west=20+i, top=i, bottom=0)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_north(120+i)
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+def test_relative_timestamp():
+	for i in range(2):
+	    base = raster_relative_time(ident="soil" + str(i) + "@PERMANENT", interval=i)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_interval(i+1)
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = raster3d_relative_time(ident="soil" + str(i) + "@PERMANENT", interval=i)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_interval(i+1)
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = vector_relative_time(ident="soil" + str(i) + "@PERMANENT", interval=i)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_interval(i+1)
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+def test_map_metadata():
+	for i in range(2):
+	    base = raster_metadata(ident="soil" + str(i) + "@PERMANENT", strds_register="PERMANENT_soil_strds-register", maptype="CELL", \
+			    cols=500, rows=400, number_of_cells=200000,nsres=1, ewres=1, min=0, max=33)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_maptype("FCELL")
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = raster3d_metadata(ident="soil" + str(i) + "@PERMANENT", str3ds_register="PERMANENT_soil_str3ds-register", maptype="FCELL", \
+			    cols=500, rows=400, depths=20, number_of_cells=200000,nsres=1, ewres=1, tbres=10, min=0, max=33)
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_maptype("DCELL")
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+	for i in range(2):
+	    base = vector_metadata(ident="soil" + str(i) + "@PERMANENT", stvds_register="PERMANENT_soil_stvds_register")
+	    base.insert()
+	    base.select()
+	    base.print_self()
+	    base.clear()
+	    base.set_stvds_register("PERMANENT_soil_stvds_register")
+	    base.update()
+	    base.select()
+	    base.print_self()
+
+def test_base_absolute_time_extent_metadata():
+
+	for i in range(10):
+	    base = vector_base(ident="water" + str(i) + "@PERMANENT", name="water" + str(i), mapset="PERMANENT", creator="soeren")
+	    base.insert()
+	    base = raster_base(ident="water" + str(i) + "@PERMANENT", name="water" + str(i), mapset="PERMANENT", creator="soeren")
+	    base.insert()
+	    base = raster3d_base(ident="water" + str(i) + "@PERMANENT", name="water" + str(i), mapset="PERMANENT", creator="soeren")
+	    base.insert()
+
+	for i in range(10):
+	    base = vector_base(ident="water" + str(i) + "@PERMANENT")
+	    base.set_creator("rene")
+	    base.update()
+	    base = raster_base(ident="water" + str(i) + "@PERMANENT")
+	    base.set_creator("rene")
+	    base.update()
+	    base = raster3d_base(ident="water" + str(i) + "@PERMANENT")
+	    base.set_creator("rene")
+	    base.update()
+
+	for i in range(10):
+	    base = vector_absolute_time(ident="water" + str(i) + "@PERMANENT", start_time=datetime.now(), end_time=datetime.now(), timezone=1)
+	    base.insert()
+	    base = raster_absolute_time(ident="water" + str(i) + "@PERMANENT", start_time=datetime.now(), end_time=datetime.now(), timezone=1)
+	    base.insert()
+	    base = raster3d_absolute_time(ident="water" + str(i) + "@PERMANENT", start_time=datetime.now(), end_time=datetime.now(), timezone=1)
+	    base.insert()
+
+	for i in range(10):
+	    base = vector_absolute_time(ident="water" + str(i) + "@PERMANENT")
+	    base.set_start_time(datetime(2010, 6, 1))
+	    base.update()
+	    base = raster_absolute_time(ident="water" + str(i) + "@PERMANENT")
+	    base.set_start_time(datetime(2010, 6, 1))
+	    base.update()
+	    base = raster3d_absolute_time(ident="water" + str(i) + "@PERMANENT")
+	    base.set_start_time(datetime(2010, 6, 1))
+	    base.update()
+
+	for i in range(10):
+	    base = vector_spatial_extent(ident="water" + str(i) + "@PERMANENT", north=100 + i, south=10+i, east=50+i, west=20+i, top=i, bottom=0)
+	    base.insert()
+	    base = raster_spatial_extent(ident="water" + str(i) + "@PERMANENT", north=100 + i, south=10+i, east=50+i, west=20+i, top=0, bottom=0)
+	    base.insert()
+	    base = raster3d_spatial_extent(ident="water" + str(i) + "@PERMANENT", north=100 + i, south=10+i, east=50+i, west=20+i, top=i, bottom=0)
+	    base.insert()
+
+	for i in range(10):
+	    base = vector_spatial_extent(ident="water" + str(i) + "@PERMANENT")
+	    base.set_north(120 + i)
+	    base.set_south(20 + i)
+	    base.update()
+	    base = raster_spatial_extent(ident="water" + str(i) + "@PERMANENT")
+	    base.set_north(120 + i)
+	    base.set_south(20 + i)
+	    base.update()
+	    base = raster3d_spatial_extent(ident="water" + str(i) + "@PERMANENT")
+	    base.set_north(120 + i)
+	    base.set_south(20 + i)
+	    base.update()
+
+	for i in range(10):
+	    base = vector_metadata(ident="water" + str(i) + "@PERMANENT", stvds_register="PERMANENT_water_stvds_register")
+	    base.insert()
+	    base = raster_metadata(ident="water" + str(i) + "@PERMANENT", strds_register="PERMANENT_water_strds-register", maptype="CELL", \
+			    cols=500, rows=400, number_of_cells=200000,nsres=1, ewres=1, min=0, max=33)
+	    base.insert()
+	    base = raster3d_metadata(ident="water" + str(i) + "@PERMANENT", str3ds_register="PERMANENT_water_str3ds-register", maptype="FCELL", \
+			    cols=500, rows=400, depths=20, number_of_cells=200000,nsres=1, ewres=1, tbres=10, min=0, max=33)
+	    base.insert()
+
+	for i in range(10):
+	    base = vector_metadata(ident="water" + str(i) + "@PERMANENT")
+	    base.set_stvds_register("PERMANENT_water_stvds_register")
+	    base.update()
+	    base = raster_metadata(ident="water" + str(i) + "@PERMANENT")
+	    base.set_maptype("DCELL")
+	    base.update()
+	    base = raster3d_metadata(ident="water" + str(i) + "@PERMANENT")
+	    base.set_maptype("DCELL")
+	    base.update()
+
+	for i in range(10):
+	    base = vector_base(ident="water" + str(i) + "@PERMANENT")
+	    base.select()
+	    base.print_self()
+	    base = raster_base(ident="water" + str(i) + "@PERMANENT")
+	    base.select()
+	    base.print_self()
+	    base = raster3d_base(ident="water" + str(i) + "@PERMANENT")
+	    base.select()
+	    base.print_self()
+
+	print "Create a raster object"
+
+	rds = raster_dataset("water0@PERMANENT")
+	rds.select()
+	rds.print_self()
+
+	print rds.temporal_relation(rds)
+
+def test_absolut_time_temporal_relations():
+
+    A = raster_absolute_time(ident="test1@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2001, month=1, day=1), timezone=1)
+    B = raster_absolute_time(ident="test2@PERMANENT", start_time=datetime(year=2001, month=1, day=1), \
+		                                        end_time=datetime(year=2002, month=1, day=1), timezone=1)
+
+    print "Precedes: ", A.temporal_relation(B)
+    print "Follows:  ", B.temporal_relation(A)
+
+    A = raster_absolute_time(ident="test1@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2001, month=1, day=1), timezone=1)
+    B = raster_absolute_time(ident="test2@PERMANENT", start_time=datetime(year=2001, month=1, day=2), \
+		                                        end_time=datetime(year=2002, month=1, day=1), timezone=1)
+
+    print "Before:   ", A.temporal_relation(B)
+    print "After:    ", B.temporal_relation(A)
+
+    A = raster_absolute_time(ident="test1@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2001, month=1, day=1), timezone=1)
+    B = raster_absolute_time(ident="test2@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2002, month=1, day=1), timezone=1)
+
+    print "Starts:   ", A.temporal_relation(B)
+    print "Started:  ", B.temporal_relation(A)
+
+    A = raster_absolute_time(ident="test1@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2001, month=1, day=1), timezone=1)
+    B = raster_absolute_time(ident="test2@PERMANENT", start_time=datetime(year=2000, month=1, day=2), \
+		                                        end_time=datetime(year=2001, month=1, day=1), timezone=1)
+
+    print "Finished: ", A.temporal_relation(B)
+    print "Finishes: ", B.temporal_relation(A)
+
+    A = raster_absolute_time(ident="test1@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2001, month=1, day=1), timezone=1)
+    B = raster_absolute_time(ident="test2@PERMANENT", start_time=datetime(year=2000, month=3, day=1), \
+		                                        end_time=datetime(year=2000, month=9, day=1), timezone=1)
+
+    print "Contains: ", A.temporal_relation(B)
+    print "During:   ", B.temporal_relation(A)
+
+
+    A = raster_absolute_time(ident="test1@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2000, month=6, day=1), timezone=1)
+    B = raster_absolute_time(ident="test2@PERMANENT", start_time=datetime(year=2000, month=3, day=1), \
+		                                        end_time=datetime(year=2000, month=9, day=1), timezone=1)
+
+    print "Overlap:   ", A.temporal_relation(B)
+    print "Overlapped:", B.temporal_relation(A)
+
+    A = raster_absolute_time(ident="test1@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2000, month=1, day=1), timezone=1)
+    B = raster_absolute_time(ident="test2@PERMANENT", start_time=datetime(year=2000, month=1, day=1), \
+		                                        end_time=datetime(year=2000, month=1, day=1), timezone=1)
+
+    print "Equivalent:", A.temporal_relation(B)
+    print "Equivalent:", B.temporal_relation(A)
+
+
+def test_raster_dataset():
+    print "Create a raster object"
+
+    rds = raster_dataset("a@test")
+    
+    rds.load_from_file()
+    
+    print "Is in db: ", rds.base.is_in_db()
+    
+    rds.base.set_ttype("absolue")
+    rds.absolute_time.set_start_time(datetime(year=2000, month=1, day=1))
+    rds.absolute_time.set_end_time(datetime(year=2010, month=1, day=1))
+    
+    # Remove the entry if it is in the db
+    rds.base.delete()
+    
+    rds.insert()
+    rds.print_self()
+
+    print rds.temporal_relation(rds)
+
+#test_dict_sql_serializer()
+create_temporal_database()
+#test_dataset_identifer()
+#test_absolute_timestamp()
+#test_relative_timestamp()
+#test_spatial_extent()
+#test_map_metadata()
+#test_base_absolute_time_extent_metadata()
+#test_absolut_time_temporal_relations()
+test_raster_dataset()

+ 62 - 0
lib/temporal/vector_metadata_table.sql

@@ -0,0 +1,62 @@
+--#############################################################################
+-- This SQL script generates the vector table to store 
+-- metadata for SQL queries and temporal GIS support.
+--
+-- Author: Soeren Gebbert soerengebbert <at> googlemail <dot> com
+--#############################################################################
+
+PRAGMA foreign_keys = ON;
+
+-- The metadata table 
+
+CREATE TABLE  vector_metadata (
+  id VARCHAR NOT NULL,                  -- The id (PFK) is the unique identifier for all tables, it is based on name and mapset (name@mapset) and is used as primary foreign key
+  stvds_register VARCHAR, -- The name of the table storing all space-time vector datasets in which this map is registered
+  PRIMARY KEY (id),
+  FOREIGN KEY (id) REFERENCES  vector_base (id) ON DELETE CASCADE
+);
+
+-- Create the views to access all columns for the absolute and relative time
+
+CREATE VIEW vector_view_abs_time AS SELECT 
+            A1.id, A1.mapset,
+            A1.name, A1.temporal_type,
+            A1.creation_time, A1.modification_time,
+            A1.revision, A1.creator, 
+	    A2.start_time, A2.end_time, 
+            A3.north, A3.south, A3.east, A3.west,
+	    A4.stvds_register
+	    FROM vector_base A1, vector_absolute_time A2, 
+            vector_spatial_extent A3, vector_metadata A4 
+	    WHERE A1.id = A2.id AND A1.id = A3.id AND A1.id = A4.id;
+
+CREATE VIEW vector_view_rel_time AS SELECT 
+            A1.id, A1.mapset,
+            A1.name, A1.temporal_type,
+            A1.creation_time, A1.modification_time,
+            A1.revision, A1.creator, 
+	    A2.interval,
+            A3.north, A3.south, A3.east, A3.west,
+	    A4.stvds_register
+	    FROM vector_base A1, vector_relative_time A2, 
+            vector_spatial_extent A3, vector_metadata A4 
+	    WHERE A1.id = A2.id AND A1.id = A3.id AND A1.id = A4.id;
+
+-- Create a trigger to update the modification time and revision number in case the metadata or timestanps have been updated 
+
+CREATE TRIGGER update_vector_metadata AFTER UPDATE ON vector_metadata 
+  BEGIN
+    UPDATE vector_base SET modification_time = datetime("NOW") WHERE id = old.id;
+    UPDATE vector_base SET revision = (revision + 1) WHERE id = old.id;
+  END;
+
+-- Create trigger for automated deletion of dependent rows, this should normally be done using foreign keys 
+
+CREATE TRIGGER delete_vector_base AFTER DELETE ON vector_base
+  BEGIN
+    DELETE FROM vector_absolute_time WHERE id = old.id;
+    DELETE FROM vector_relative_time WHERE id = old.id;
+    DELETE FROM vector_spatial_extent WHERE id = old.id;
+    DELETE FROM vector_metadata WHERE id = old.id;
+  END;
+

+ 7 - 0
temporal/t.create/Makefile

@@ -0,0 +1,7 @@
+MODULE_TOPDIR = ../../
+
+PGM = t.create
+
+include $(MODULE_TOPDIR)/include/Make/Script.make
+
+default: script $(TEST_DST)

+ 0 - 0
temporal/t.create/t.create.html


+ 103 - 0
temporal/t.create/t.create.py

@@ -0,0 +1,103 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+############################################################################
+#
+# MODULE:	t.create
+# AUTHOR(S):	Soeren Gebbert
+#               
+# PURPOSE:	Create a space-time dataset
+# COPYRIGHT:	(C) 2011 by the GRASS Development Team
+#
+#		This program is free software under the GNU General Public
+#		License (version 2). Read the file COPYING that comes with GRASS
+#		for details.
+#
+#############################################################################
+
+#%module
+#% description: Create a space-time dataset
+#% keywords: spacetime dataset
+#% keywords: create
+#%end
+
+#%option
+#% key: name
+#% type: string
+#% description: Name of the new space-time dataset
+#% required: yes
+#% multiple: no
+#%end
+
+#%option
+#% key: granularity
+#% type: string
+#% description: The granularity of the new space-time dataset (NNN day, NNN week, NNN month)
+#% required: yes
+#% multiple: no
+#%end
+
+#%option
+#% key: semantictype
+#% type: string
+#% description: The semantic type of the space-time dataset
+#% required: yes
+#% multiple: no
+#% options: event, const, continuous
+#% answer: event
+#%end
+
+#%option
+#% key: type
+#% type: string
+#% description: Type of the space time dataset, default is strds
+#% required: no
+#% options: strds
+#% answer: strds
+#%end
+#%option
+#% key: temporaltype
+#% type: string
+#% description: The temporal type of the space time dataset, default is absolute
+#% required: no
+#% options: absolute,relative
+#% answer: absolute
+#%end
+
+#%option
+#% key: title
+#% type: string
+#% description: Title of the new space-time dataset
+#% required: yes
+#% multiple: no
+#%end
+
+#%option
+#% key: description
+#% type: string
+#% description: Description of the new space-time dataset
+#% required: yes
+#% multiple: no
+#%end
+
+import sys
+import os
+import getpass
+import subprocess
+import grass.script as grass
+############################################################################
+
+def main():
+
+    # Get the options
+    name = options["name"]
+    type = options["type"]
+    temporaltype = options["temporaltype"]
+    title = options["title"]
+    descr = options["description"]
+    semantic = options["semantictype"]
+    gran = options["granularity"]
+
+if __name__ == "__main__":
+    options, flags = grass.core.parser()
+    main()
+

+ 7 - 0
temporal/t.info/Makefile

@@ -0,0 +1,7 @@
+MODULE_TOPDIR = ../../
+
+PGM = t.info
+
+include $(MODULE_TOPDIR)/include/Make/Script.make
+
+default: script $(TEST_DST)

+ 0 - 0
temporal/t.info/t.info.html


+ 54 - 0
temporal/t.info/t.info.py

@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+############################################################################
+#
+# MODULE:	t.info
+# AUTHOR(S):	Soeren Gebbert
+#               
+# PURPOSE:	Print information about a space-time dataset
+# COPYRIGHT:	(C) 2011 by the GRASS Development Team
+#
+#		This program is free software under the GNU General Public
+#		License (version 2). Read the file COPYING that comes with GRASS
+#		for details.
+#
+#############################################################################
+
+#%module
+#% description: Remove a space-time dataset
+#% keywords: spacetime dataset
+#% keywords: remove
+#%end
+
+#%option
+#% key: name
+#% type: string
+#% description: Name of the new space-time dataset
+#% required: yes
+#% multiple: no
+#%end
+#%option
+#% key: type
+#% type: string
+#% description: Type of the space time dataset, default is strds
+#% required: no
+#% options: strds
+#% answer: strds
+#%end
+
+import sys
+import os
+import grass.script as grass
+
+############################################################################
+
+def main():
+
+    # Get the options
+    name = options["name"]
+    type = options["type"]
+
+if __name__ == "__main__":
+    options, flags = grass.core.parser()
+    main()
+

+ 7 - 0
temporal/t.remove/Makefile

@@ -0,0 +1,7 @@
+MODULE_TOPDIR = ../../
+
+PGM = t.remove
+
+include $(MODULE_TOPDIR)/include/Make/Script.make
+
+default: script $(TEST_DST)

+ 0 - 0
temporal/t.remove/t.remove.html


+ 54 - 0
temporal/t.remove/t.remove.py

@@ -0,0 +1,54 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+############################################################################
+#
+# MODULE:	t.remove
+# AUTHOR(S):	Soeren Gebbert
+#               
+# PURPOSE:	Remove a space-time raster dataset
+# COPYRIGHT:	(C) 2011 by the GRASS Development Team
+#
+#		This program is free software under the GNU General Public
+#		License (version 2). Read the file COPYING that comes with GRASS
+#		for details.
+#
+#############################################################################
+
+#%module
+#% description: Remove a space-time dataset
+#% keywords: spacetime dataset
+#% keywords: remove
+#%end
+
+#%option
+#% key: name
+#% type: string
+#% description: Name of the new space-time dataset
+#% required: yes
+#% multiple: no
+#%end
+#%option
+#% key: type
+#% type: string
+#% description: Type of the space time dataset, default is strds
+#% required: no
+#% options: strds
+#% answer: strds
+#%end
+
+import sys
+import os
+import grass.script as grass
+
+############################################################################
+
+def main():
+
+    # Get the options
+    name = options["name"]
+    type = options["type"]
+
+if __name__ == "__main__":
+    options, flags = grass.core.parser()
+    main()
+