瀏覽代碼

Removed obsolete modules.

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@50793 15284696-431f-4ddb-bdfa-cd5b030d7da7
Soeren Gebbert 13 年之前
父節點
當前提交
00a69975b9
共有 35 個文件被更改,包括 1 次插入1901 次删除
  1. 1 194
      temporal/t.register/t.register.py
  2. 0 7
      temporal/t.time.abs/Makefile
  3. 0 0
      temporal/t.time.abs/t.time.abs.html
  4. 0 124
      temporal/t.time.abs/t.time.abs.py
  5. 0 67
      temporal/t.time.abs/test.t.time.abs.file.layer.sh
  6. 0 80
      temporal/t.time.abs/test.t.time.abs.file.sh
  7. 0 43
      temporal/t.time.abs/test.t.time.abs.sh
  8. 0 7
      temporal/t.time.rel/Makefile
  9. 0 0
      temporal/t.time.rel/t.time.rel.html
  10. 0 135
      temporal/t.time.rel/t.time.rel.py
  11. 0 85
      temporal/t.time.rel/test.t.time.rel.file.sh
  12. 0 70
      temporal/t.time.rel/test.t.time.rel.sh
  13. 0 153
      temporal/tr.register/ECAD_climate_analysis_1995_2010.py
  14. 0 7
      temporal/tr.register/Makefile
  15. 0 81
      temporal/tr.register/test.tr.register.file.sh
  16. 0 97
      temporal/tr.register/test.tr.register.sh
  17. 0 0
      temporal/tr.register/tr.register.html
  18. 0 121
      temporal/tr.register/tr.register.py
  19. 0 7
      temporal/tr.unregister/Makefile
  20. 0 0
      temporal/tr.unregister/tr.unregister.html
  21. 0 67
      temporal/tr.unregister/tr.unregister.py
  22. 0 7
      temporal/tr3.register/Makefile
  23. 0 70
      temporal/tr3.register/test.tr3.register.sh
  24. 0 0
      temporal/tr3.register/tr3.register.html
  25. 0 121
      temporal/tr3.register/tr3.register.py
  26. 0 7
      temporal/tr3.unregister/Makefile
  27. 0 0
      temporal/tr3.unregister/tr3.unregister.html
  28. 0 67
      temporal/tr3.unregister/tr3.unregister.py
  29. 0 7
      temporal/tv.register/Makefile
  30. 0 64
      temporal/tv.register/test.tv.register.sh
  31. 0 0
      temporal/tv.register/tv.register.html
  32. 0 130
      temporal/tv.register/tv.register.py
  33. 0 7
      temporal/tv.unregister/Makefile
  34. 0 0
      temporal/tv.unregister/tv.unregister.html
  35. 0 76
      temporal/tv.unregister/tv.unregister.py

+ 1 - 194
temporal/t.register/t.register.py

@@ -123,202 +123,9 @@ def main():
     # Make sure the temporal database exists
     tgis.create_temporal_database()
     # Register maps
-    register_maps_in_space_time_dataset(type=type, name=name, maps=maps, file=file, start=start, end=end, \
+    tgis.register_maps_in_space_time_dataset(type=type, name=name, maps=maps, file=file, start=start, end=end, \
                                              unit=unit, increment=increment, dbif=None, interval=interval, fs=fs)
-    
-###############################################################################
-
-def register_maps_in_space_time_dataset(type, name, maps=None, file=None, start=None, \
-                                        end=None, unit=None, increment=None, dbif = None, \
-                                        interval=False, fs="|"):
-    """Use this method to register maps in space time datasets. This function is generic and
-
-       Additionally a start time string and an increment string can be specified
-       to assign a time interval automatically to the maps.
-
-       It takes care of the correct update of the space time datasets from all
-       registered maps.
-
-       @param type: The type of the maps rast, rast3d or vect
-       @param name: The name of the space time dataset
-       @param maps: A comma separated list of map names
-       @param file: Input file one map with start and optional end time, one per line
-       @param start: The start date and time of the first raster map (format absolute: "yyyy-mm-dd HH:MM:SS" or "yyyy-mm-dd", format relative is integer 5)
-       @param end: The end date and time of the first raster map (format absolute: "yyyy-mm-dd HH:MM:SS" or "yyyy-mm-dd", format relative is integer 5)
-       @param unit: The unit of the relative time: years, months, days, hours, minutes, seconds
-       @param increment: Time increment between maps for time stamp creation (format absolute: NNN seconds, minutes, hours, days, weeks, months, years; format relative: 1.0)
-       @param dbif: The database interface to be used
-       @param interval: If True, time intervals are created in case the start time and an increment is provided
-       @param fs: Field separator used in input file
-    """
-
-    start_time_in_file = False
-    end_time_in_file = False
-    if maps and file:
-        grass.fatal(_("%s= and %s= are mutually exclusive") % ("input","file"))
-
-    if end and increment:
-        grass.fatal(_("%s= and %s= are mutually exclusive") % ("end","increment"))
-
-    if end and not start:
-        grass.fatal(_("Please specify %s= and %s=") % ("start_time","end_time"))
-
-    if not maps and not file:
-        grass.fatal(_("Please specify %s= or %s=") % ("input","file"))
-
-    # We may need the mapset
-    mapset =  grass.gisenv()["MAPSET"]
-
-    # Check if the dataset name contains the mapset as well
-    if name.find("@") < 0:
-        id = name + "@" + mapset
-    else:
-        id = name
-
-    if type == "rast":
-        sp = tgis.dataset_factory("strds", id)
-    if type == "rast3d":
-        sp = tgis.dataset_factory("str3ds", id)
-    if type == "vect":
-        sp = tgis.dataset_factory("stvds", id)
-
-    connect = False
-
-    if dbif == None:
-        dbif = tgis.sql_database_interface()
-        dbif.connect()
-        connect = True
-
-    # Read content from temporal database
-    sp.select(dbif)
-
-    if sp.is_in_db(dbif) == False:
-        dbif.close()
-        grass.fatal(_("Space time %s dataset <%s> no found") % (sp.get_new_map_instance(None).get_type(), name))
-
-    if sp.is_time_relative() and not unit:
-        dbif.close()
-        grass.fatal(_("Space time %s dataset <%s> with relative time found, but no relative unit set for %s maps") % (sp.get_new_map_instance(None).get_type(), name, sp.get_new_map_instance(None).get_type()))
-
-    dummy = sp.get_new_map_instance(None)
-        
-    maplist = []
-    
-    # Map names as comma separated string
-    if maps:
-        if maps.find(",") < 0:
-            maplist = [maps,]
-        else:
-            maplist = maps.split(",")
-
-	# Build the maplist again with the ids
-	for count in range(len(maplist)):
-	    row = {}
-	    mapid = dummy.build_id(maplist[count], mapset, None)
-		
-	    row["id"] = mapid
-            maplist[count] = row
-            
-    # Read the map list from file
-    if file:
-        fd = open(file, "r")
-
-        line = True
-        while True:
-            line = fd.readline()
-            if not line:
-                break
-
-            line_list = line.split(fs)
-
-            # Detect start and end time
-            if len(line_list) == 2:
-                start_time_in_file = True
-                end_time_in_file = False
-            elif len(line_list) == 3:
-                start_time_in_file = True
-                end_time_in_file = True
-            else:
-                start_time_in_file = False
-                end_time_in_file = False
-
-            mapname = line_list[0].strip()
-            row = {}
-            
-	    if start_time_in_file and  end_time_in_file:
-	        row["start"] = line_list[1].strip()
-	        row["end"] = line_list[2].strip()
-
-	    if start_time_in_file and  not end_time_in_file:
-	        row["start"] = line_list[1].strip()
-	    
-	    row["id"] = dummy.build_id(mapname, mapset)
-
-            maplist.append(row)
-    
-    num_maps = len(maplist)
-    for count in range(len(maplist)):
-	grass.percent(count, num_maps, 1)
-
-        # Get a new instance of the space time dataset map type
-        map = sp.get_new_map_instance(maplist[count]["id"])
-
-        # Use the time data from file
-        if maplist[count].has_key("start"):
-            start = maplist[count]["start"]
-        if maplist[count].has_key("end"):
-            end = maplist[count]["end"]
-
-        # Put the map into the database
-        if map.is_in_db(dbif) == False:
-            # Break in case no valid time is provided
-            if start == "" or start == None:
-                dbif.close()
-                if map.get_layer():
-		    grass.fatal(_("Unable to register %s map <%s> with layer %s. The map has no valid time and the start time is not set.") % \
-				(map.get_type(), map.get_map_id(), map.get_layer() ))
-		else:
-		    grass.fatal(_("Unable to register %s map <%s>. The map has no valid time and the start time is not set.") % \
-				(map.get_type(), map.get_map_id() ))
-            # Load the data from the grass file database
-            map.load()
-	    
-            if sp.get_temporal_type() == "absolute":
-                map.set_time_to_absolute()
-            else:
-                map.set_time_to_relative()
-                
-            #  Put it into the temporal database
-            map.insert(dbif)
-        else:
-            map.select(dbif)
-            if map.get_temporal_type() != sp.get_temporal_type():
-                dbif.close()
-                if map.get_layer():
-		    grass.fatal(_("Unable to register %s map <%s> with layer. The temporal types are different.") %  \
-		                 (map.get_type(), map.get_map_id(), map.get_layer()))
-		    grass.fatal(_("Unable to register %s map <%s>. The temporal types are different.") %  \
-		                 (map.get_type(), map.get_map_id()))
-
-        # In case the time is in the input file we ignore the increment counter
-        if start_time_in_file:
-            count = 1
-
-        # Set the valid time
-        if start:
-            tgis.assign_valid_time_to_map(ttype=sp.get_temporal_type(), map=map, start=start, end=end, unit=unit, increment=increment, mult=count, dbif=dbif, interval=interval)
-
-        # Finally Register map in the space time dataset
-        sp.register_map(map, dbif)
-
-    # Update the space time tables
-    sp.update_from_registered_maps(dbif)
-
-    if connect == True:
-        dbif.close()
 
-    grass.percent(num_maps, num_maps, 1)
-        
 ###############################################################################
 
 if __name__ == "__main__":

+ 0 - 7
temporal/t.time.abs/Makefile

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

+ 0 - 0
temporal/t.time.abs/t.time.abs.html


+ 0 - 124
temporal/t.time.abs/t.time.abs.py

@@ -1,124 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	t.time.abs
-# AUTHOR(S):	Soeren Gebbert
-#
-# PURPOSE:	Set the absolute valid time interval for raster maps
-# 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: Set the absolute valid time interval for maps of type raster, vector and raster3d
-#% keywords: time
-#% keywords: absolute
-#% keywords: raster
-#% keywords: vector
-#% keywords: raster3d
-#%end
-
-#%option
-#% key: input
-#% type: string
-#% description: Name(s) of existing raster, raster3d or vector map(s)
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: layer
-#% type: string
-#% description: Id(s)/Name(s) of existing vector map layer or the identifier "file" in case the layer definition is in the input file
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: file
-#% type: string
-#% description: Input file with vector map names, one per line. Additionally the layer, the start time and the end time can be specified per line
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: start
-#% type: string
-#% description: The valid start date and time of the first raster map. Time format is "yyyy-mm-dd HH:MM:SS" or only "yyyy-mm-dd", or "file" in case the start time is located in the input file
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: end
-#% type: string
-#% description: The valid end date and time of the first raster map. Time format is "yyyy-mm-dd HH:MM:SS" or only "yyyy-mm-dd", or "file" in case the start time is located in the input file 
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: increment
-#% type: string
-#% description: Time increment between maps for valid time interval creation. Interval format: NNN seconds, minutes, hours, days, weeks, months, years
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: type
-#% type: string
-#% description: Input map type
-#% required: no
-#% options: rast, rast3d, vect
-#% answer: rast
-#%end
-
-#%option
-#% key: fs
-#% type: string
-#% description: The field separator character of the input file
-#% required: no
-#% answer: |
-#%end
-
-#%flag
-#% key: i
-#% description: Create an interval (start and end time) in case an increment is provided
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    maps = options["input"]
-    layer = options["layer"]
-    file = options["file"]
-    start = options["start"]
-    end = options["end"]
-    increment = options["increment"]
-    fs = options["fs"]
-    type = options["type"]
-    interval = flags["i"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-    # Set valid absolute time to maps
-    tgis.assign_valid_time_to_maps(type=type, maps=maps, layer=layer, ttype="absolute", \
-                                   start=start, end=end, file=file, increment=increment, \
-                                   dbif=None, interval=interval, fs=fs)
-    
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()
-

+ 0 - 67
temporal/t.time.abs/test.t.time.abs.file.layer.sh

@@ -1,67 +0,0 @@
-# This is a test to absolute time for vector maps with layer support
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# vector with v.random.
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-v.random --o -z output=lidar_abs_1 n=5 zmin=0 zmax=100 
-
-n1=`g.tempfile pid=4 -d` # Only map names and layer
-n2=`g.tempfile pid=5 -d` # Map names, layer and start time 
-n3=`g.tempfile pid=6 -d` # Map names, layer, start time and increment
-# The vector map
-v.random --o -z seed=1 output=lidar_abs_orig n=100 zmin=0 zmax=100 column=sand
-# Adding new layer with categories
-v.category input=lidar_abs_orig out=lidar_abs_1 option=transfer layer=1,2,3,4,5,6 --o
-
-cat > "${n1}" << EOF
-lidar_abs_1|1
-lidar_abs_1|2
-lidar_abs_1|3
-lidar_abs_1|4
-lidar_abs_1|5
-lidar_abs_1|6
-EOF
-cat "${n1}"
-
-cat > "${n2}" << EOF
-lidar_abs_1|1|2001-01-01
-lidar_abs_1|2|2001-02-01
-lidar_abs_1|3|2001-03-01
-lidar_abs_1|4|2001-04-01
-lidar_abs_1|5|2001-05-01
-lidar_abs_1|6|2001-06-01
-EOF
-cat "${n2}"
-
-cat > "${n3}" << EOF
-lidar_abs_1|1|2001-01-01|2001-04-01
-lidar_abs_1|2|2001-04-01|2001-07-01
-lidar_abs_1|3|2001-07-01|2001-10-01
-lidar_abs_1|4|2001-10-01|2002-01-01
-lidar_abs_1|5|2002-01-01|2002-04-01
-lidar_abs_1|6|2002-04-01|2002-07-01
-EOF
-cat "${n3}"
-
-# The first @test
-# Test with input files
-# File 1
-t.time.abs --v type=vect file="${n1}" start="2001-01-01" increment="1 months" layer=file
-t.list type=vect columns=id,name,start_time,end_time where='name = "lidar_abs_1"'
-# File 1
-t.time.abs --v type=vect file="${n1}" start="2001-01-01"  layer=file
-t.list type=vect columns=id,name,start_time,end_time where='name = "lidar_abs_1"'
-# File 2
-t.time.abs --v type=vect file="${n2}" start=file  layer=file
-t.list type=vect columns=id,name,start_time,end_time where='name = "lidar_abs_1"'
-# File 2
-t.time.abs --v type=vect -i file="${n2}" start=file increment="1 months"  layer=file
-t.list type=vect columns=id,name,start_time,end_time where='name = "lidar_abs_1"'
-# File 3
-t.time.abs --v type=vect file="${n3}" start=file end=file  layer=file
-t.list type=vect columns=id,name,start_time,end_time where='name = "lidar_abs_1"'
-
-t.remove --v type=vect input=lidar_abs_1:1,lidar_abs_1:2,lidar_abs_1:3,lidar_abs_1:4,lidar_abs_1:5,lidar_abs_1:6
-g.remove vect=lidar_abs_1,lidar_abs_orig

+ 0 - 80
temporal/t.time.abs/test.t.time.abs.file.sh

@@ -1,80 +0,0 @@
-# This is a test to absolute time for raster maps
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# raster with r.mapcalc and create two space time raster inputs
-# with relative and absolute time
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-r.mapcalc --o expr="prec_1 = rand(0, 550)"
-r.mapcalc --o expr="prec_2 = rand(0, 450)"
-r.mapcalc --o expr="prec_3 = rand(0, 320)"
-r.mapcalc --o expr="prec_4 = rand(0, 510)"
-r.mapcalc --o expr="prec_5 = rand(0, 300)"
-r.mapcalc --o expr="prec_6 = rand(0, 650)"
-
-n1=`g.tempfile pid=1 -d` # Only map names
-n2=`g.tempfile pid=2 -d` # Map names and start time
-n3=`g.tempfile pid=3 -d` # Map names start time and increment
-
-cat > "${n1}" << EOF
-prec_1
-prec_2
-prec_3
-prec_4
-prec_5
-prec_6
-EOF
-cat "${n1}"
-
-cat > "${n2}" << EOF
-prec_1|2001-01-01
-prec_2|2001-02-01
-prec_3|2001-03-01
-prec_4|2001-04-01
-prec_5|2001-05-01
-prec_6|2001-06-01
-EOF
-cat "${n2}"
-
-cat > "${n3}" << EOF
-prec_1|2001-01-01|2001-04-01
-prec_2|2001-04-01|2001-07-01
-prec_3|2001-07-01|2001-10-01
-prec_4|2001-10-01|2002-01-01
-prec_5|2002-01-01|2002-04-01
-prec_6|2002-04-01|2002-07-01
-EOF
-cat "${n3}"
-
-# The first @test
-# We create the space time raster inputs and register the raster maps with absolute time interval
-t.create --o type=strds temporaltype=absolute output=precip_abs8 title="A test with input files" descr="A test with input files"
-
-# Test with input files
-# File 1
-t.time.abs file="${n1}" start="2001-01-01" increment="1 months"
-
-tr.register input=precip_abs8 file="${n1}"
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-
-# File 1
-t.time.abs file="${n1}" start="2001-01-01" 
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-# File 2
-t.time.abs file="${n2}" start=file
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-# File 2
-t.time.abs -i file="${n2}" start=file increment="1 months"
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-# File 3
-t.time.abs file="${n3}" start=file end=file
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-
-t.remove --v type=strds input=precip_abs8
-t.remove --v type=rast file="${n1}"

+ 0 - 43
temporal/t.time.abs/test.t.time.abs.sh

@@ -1,43 +0,0 @@
-# We test the absolute valid time interval creation with t.time.abs
-
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# raster with r.mapcalc
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-r.mapcalc --o expr="prec_1 = rand(0, 550)"
-r.mapcalc --o expr="prec_2 = rand(0, 450)"
-r.mapcalc --o expr="prec_3 = rand(0, 320)"
-r.mapcalc --o expr="prec_4 = rand(0, 510)"
-r.mapcalc --o expr="prec_5 = rand(0, 300)"
-r.mapcalc --o expr="prec_6 = rand(0, 650)"
-
-t.create --v --o type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
-t.create --v --o type=strds temporaltype=absolute output=precip_abs2 title="A test" descr="A test"
-t.create --v --o type=strds temporaltype=absolute output=precip_abs3 title="A test" descr="A test"
-
-t.time.abs --v input=prec_1,prec_2,prec_3 start="2001-01-01" increment="1 months"
-t.info type=rast input=prec_1
-t.info type=rast input=prec_2
-t.info type=rast input=prec_3
-
-tr.register --v input=precip_abs1 maps=prec_1,prec_2,prec_3
-tr.register --v input=precip_abs2 maps=prec_1,prec_2,prec_3
-tr.register --v input=precip_abs3 maps=prec_1,prec_2,prec_3
-# Check if the space time inputs are updated correctly
-t.time.abs --v input=prec_1,prec_2,prec_3 start="2011-01-01" increment="1 months"
-t.info type=strds input=precip_abs1
-
-# Check if the space time inputs are updated correctly
-t.time.abs --v -i input=prec_1,prec_2,prec_3 start="2011-01-01" increment="1 months"
-t.info type=strds input=precip_abs1
-
-t.time.abs --v input=prec_4,prec_5 start="2001-01-01" end="2002-01-01"
-t.info type=rast input=prec_4
-t.info type=rast input=prec_5
-t.time.abs --v input=prec_6 start="2001-01-01 00:00:00" end="2001-01-01 12:00:00"
-t.info type=rast input=prec_6
-
-t.remove --v type=rast input=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
-t.remove --v type=strds input=precip_abs1,precip_abs2,precip_abs3

+ 0 - 7
temporal/t.time.rel/Makefile

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

+ 0 - 0
temporal/t.time.rel/t.time.rel.html


+ 0 - 135
temporal/t.time.rel/t.time.rel.py

@@ -1,135 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	t.time.rel
-# AUTHOR(S):	Soeren Gebbert
-#
-# PURPOSE:	Set the relative valid time point or interval for maps of type raster, vector and raster3d
-# 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: Set the relative valid time point or interval for maps of type raster, vector and raster3d
-#% keywords: time
-#% keywords: absolute
-#% keywords: raster
-#% keywords: vector
-#% keywords: raster3d
-#%end
-
-#%option
-#% key: input
-#% type: string
-#% description: Name(s) of existing raster, raster3d or vector map(s)
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: layer
-#% type: string
-#% description: Id(s)/Name(s) of existing vector map layer or the identifier "file" in case the layer definition is in the input file
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: file
-#% type: string
-#% description: Input file with vector map names, one per line. Additionally the layer, the start time and the end time can be specified per line
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: start
-#% type: string
-#% description: The valid integer start value for all maps, or the identifier "file" in case the start time is located in the input file 
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: end
-#% type: string
-#% description: The valid integer end value for all maps, or the identifier "file" in case the start time is located in the input file 
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: unit
-#% type: string
-#% description: The unit of the relative time
-#% required: no
-#% multiple: no
-#% options: years,months,days,hours,minutes,seconds
-#% answer: days
-#%end
-
-#%option
-#% key: increment
-#% type: integer
-#% description: Increment between maps for valid time interval creation 
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: type
-#% type: string
-#% description: Input map type
-#% required: no
-#% options: rast,rast3d,vect
-#% answer: rast
-#%end
-
-#%option
-#% key: fs
-#% type: string
-#% description: The field separator character of the input file
-#% required: no
-#% answer: |
-#%end
-
-#%flag
-#% key: i
-#% description: Create an interval (start and end time) in case an increment is provided
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    maps = options["input"]
-    layer = options["layer"]
-    file = options["file"]
-    start = options["start"]
-    end = options["end"]
-    increment = options["increment"]
-    fs = options["fs"]
-    type = options["type"]
-    unit = options["unit"]
-    interval = flags["i"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-    # Set valid absolute time to maps
-    tgis.assign_valid_time_to_maps(type=type, maps=maps, layer=layer, ttype="relative", \
-                                   start=start, end=end, unit=unit, file=file, increment=increment, \
-                                   dbif=None, interval=interval, fs=fs)
-    
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()
-

+ 0 - 85
temporal/t.time.rel/test.t.time.rel.file.sh

@@ -1,85 +0,0 @@
-# This is a test to absolute time for raster maps
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# raster with r.mapcalc and create two space time raster inputs
-# with relative and absolute time
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-r.mapcalc --o expr="prec_1 = rand(0, 550)"
-r.mapcalc --o expr="prec_2 = rand(0, 450)"
-r.mapcalc --o expr="prec_3 = rand(0, 320)"
-r.mapcalc --o expr="prec_4 = rand(0, 510)"
-r.mapcalc --o expr="prec_5 = rand(0, 300)"
-r.mapcalc --o expr="prec_6 = rand(0, 650)"
-
-n1=`g.tempfile pid=1 -d` # Only map names
-n2=`g.tempfile pid=2 -d` # Map names and start time
-n3=`g.tempfile pid=3 -d` # Map names start time and increment
-
-cat > "${n1}" << EOF
-prec_1
-prec_2
-prec_3
-prec_4
-prec_5
-prec_6
-EOF
-cat "${n1}"
-
-cat > "${n2}" << EOF
-prec_1|1
-prec_2|2
-prec_3|3
-prec_4|4
-prec_5|5
-prec_6|6
-EOF
-cat "${n2}"
-
-cat > "${n3}" << EOF
-prec_1|1|4
-prec_2|4|7
-prec_3|7|10
-prec_4|10|11
-prec_5|11|14
-prec_6|14|17
-EOF
-cat "${n3}"
-
-# The first @test
-# We create the space time raster inputs and register the raster maps with absolute time interval
-t.create --o type=strds temporaltype=relative output=precip_rel title="A test with input files" descr="A test with input files"
-
-# Test with input files
-# File 1
-echo "Test 1"
-t.time.rel -i file="${n1}" start=20 increment=5 unit=months
-
-tr.register input=precip_rel file="${n1}"
-t.info type=strds input=precip_rel
-tr.list input=precip_rel
-
-echo "Test 2"
-# File 1
-t.time.rel file="${n1}" start=20 unit=months
-t.info type=strds input=precip_rel
-tr.list input=precip_rel
-echo "Test 3"
-# File 2
-t.time.rel file="${n2}" start=file unit=months
-t.info type=strds input=precip_rel
-tr.list input=precip_rel
-echo "Test 4"
-# File 2
-t.time.rel -i file="${n2}" start=file increment=5 unit=months
-t.info type=strds input=precip_rel
-tr.list input=precip_rel
-echo "Test 5"
-# File 3
-t.time.rel file="${n3}" start=file end=file unit=months
-t.info type=strds input=precip_rel
-tr.list input=precip_rel
-
-t.remove --v type=strds input=precip_rel
-t.remove --v type=rast file="${n1}"

+ 0 - 70
temporal/t.time.rel/test.t.time.rel.sh

@@ -1,70 +0,0 @@
-# We test the relative valid time interval creation with t.time.rel
-
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# raster input with r.mapcalc
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-r.mapcalc --o expr="prec_1 = rand(0, 550)"
-r.mapcalc --o expr="prec_2 = rand(0, 450)"
-r.mapcalc --o expr="prec_3 = rand(0, 320)"
-r.mapcalc --o expr="prec_4 = rand(0, 510)"
-r.mapcalc --o expr="prec_5 = rand(0, 300)"
-r.mapcalc --o expr="prec_6 = rand(0, 650)"
-
-t.create --v --o type=strds temporaltype=relative output=precip_rel1 title="A test" descr="A test" 
-t.create --v --o type=strds temporaltype=relative output=precip_rel2 title="A test" descr="A test"
-t.create --v --o type=strds temporaltype=relative output=precip_rel3 title="A test" descr="A test"
-
-t.time.rel --v input=prec_1,prec_2,prec_3 start=5 increment=2 unit=days
-t.info type=rast input=prec_1
-r.info map=prec_1
-t.info type=rast input=prec_2
-r.info map=prec_2
-t.info type=rast input=prec_3
-r.info map=prec_3
-
-tr.register --v input=precip_rel1 maps=prec_1,prec_2,prec_3 unit=days
-tr.register --v input=precip_rel2 maps=prec_1,prec_2,prec_3 unit=days
-tr.register --v input=precip_rel3 maps=prec_1,prec_2,prec_3 unit=days
-# Check if the space time inputs are updated correctly
-t.time.rel --v input=prec_1,prec_2,prec_3 start=0 increment=1000 unit=days
-t.info type=strds input=precip_rel1
-t.topology type=strds input=precip_rel1
-t.topology -m type=strds input=precip_rel1
-
-t.time.rel --v -i input=prec_1,prec_2,prec_3 start=0 increment=1000 unit=days
-t.info type=strds input=precip_rel1
-t.topology type=strds input=precip_rel1
-t.topology -m type=strds input=precip_rel1
-
-t.time.rel --v input=prec_4,prec_5 start=5000 end=6000 unit=days
-t.info type=rast input=prec_4
-t.info type=rast input=prec_5
-t.time.rel --v input=prec_6 start=6000 unit=days
-t.info type=rast input=prec_6
-
-t.remove --v type=rast input=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
-t.remove --v type=strds input=precip_rel1,precip_rel2,precip_rel3
-
-t.time.rel --v -i input=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start=-4000 increment=1000 unit=years
-t.info type=rast input=prec_1
-t.info type=rast input=prec_2
-t.info type=rast input=prec_3
-t.info type=rast input=prec_4
-t.info type=rast input=prec_5
-t.info type=rast input=prec_6
-
-t.create --v --o type=strds temporaltype=relative output=precip_rel1 title="A test" descr="A test" 
-tr.register --v input=precip_rel1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
-t.info type=strds input=precip_rel1
-r.timestamp prec_1
-r.timestamp prec_2
-r.timestamp prec_3
-r.timestamp prec_4
-r.timestamp prec_5
-r.timestamp prec_6
-
-t.remove --v type=rast input=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6
-t.remove --v type=strds input=precip_rel1

+ 0 - 153
temporal/tr.register/ECAD_climate_analysis_1995_2010.py

@@ -1,153 +0,0 @@
-# This is an example script how to register imported ECA&D data for Europe
-# in the temporal database of grass setting valid time interval 
-
-import grass.script as grass
-
-# You need to download the european climate date from the ECA&D server http://eca.knmi.nl/ as netCDF time series
-# We only use the data from 1995 - 2010
-# First import the ECA&D data into GRASS GIS 
-input = "tg_0.25deg_reg_1995-2011_v5.0.nc"
-output = "temp_mean"
-grass.run_command("r.in.gdal", flags="e", input=input, output=output, overwrite=True)
-input = "tn_0.25deg_reg_1995-2011_v5.0.nc"
-output = "temp_min"
-grass.run_command("r.in.gdal", flags="e", input=input, output=output, overwrite=True)
-input = "tx_0.25deg_reg_1995-2011_v5.0.nc"
-output = "temp_max"
-grass.run_command("r.in.gdal", flags="e", input=input, output=output, overwrite=True)
-input = "rr_0.25deg_reg_1995-2011_v5.0.nc"
-output = "precip"
-grass.run_command("r.in.gdal", flags="e", input=input, output=output, overwrite=True)
-
-
-# This should be the number of maps to register
-num_maps = 5844
-
-# Daily mean temperatue
-
-dataset = "temp_mean_1995_2011_daily"
-
-grass.run_command("t.create", type="strds", output=dataset,\
-                  semantic="continuous", temporal="absolute", \
-		  title="European mean temperature 1995-2011", \
-		  description="The european daily mean temperature 1995 - 2011 from ECA&D ", \
-		  overwrite=True)
-
-name = "temp_mean."
-filename = grass.tempfile()
-file = open(filename, "w")
-for i in range(num_maps):
-    inc = i + 1
-    map_name = name + str(inc)
-    string = map_name + "\n"
-    file.write(string)
-
-file.close()
-
-grass.run_command("tr.register", flags="i", input=dataset, file=filename, start="1995-01-01", increment="1 days", overwrite=True)
-
-# Daily min temperatue
-
-dataset = "temp_min_1995_2010_daily"
-
-grass.run_command("t.create", type="strds", output=dataset,\
-                  semantic="continuous", temporal="absolute", \
-		  title="European min temperature 1995-2010", \
-		  description="The european daily min temperature 1995 - 2010 from ECA&D ", \
-		  overwrite=True)
-
-name = "temp_min."
-filename = grass.tempfile()
-file = open(filename, "w")
-for i in range(num_maps):
-    inc = i + 1
-    map_name = name + str(inc)
-    string = map_name + "\n"
-    file.write(string)
-
-file.close()
-
-grass.run_command("tr.register", flags="i", input=dataset, file=filename, start="1995-01-01", increment="1 days", overwrite=True)
-
-# Daily max temperatue
-
-dataset = "temp_max_1995_2010_daily"
-
-grass.run_command("t.create", type="strds", output=dataset,\
-                  semantic="continuous", temporal="absolute", \
-		  title="European max temperature 1995-2010", \
-		  description="The european daily max temperature 1995 - 2010 from ECA&D ", \
-		  overwrite=True)
-
-name = "temp_max."
-filename = grass.tempfile()
-file = open(filename, "w")
-for i in range(num_maps):
-    inc = i + 1
-    map_name = name + str(inc)
-    string = map_name + "\n"
-    file.write(string)
-
-file.close()
-
-grass.run_command("tr.register", flags="i", input=dataset, file=filename, start="1995-01-01", increment="1 days", overwrite=True)
-
-# Daily precipitation
-
-dataset = "precipitation_1995_2010_daily"
-
-grass.run_command("t.create", type="strds", output=dataset,\
-                  semantic="event", temporal="absolute", \
-		  title="European precipitation 1995-2010", \
-		  description="The european daily precipitation 1995 - 2010 from ECA&D ", \
-		  overwrite=True)
-
-name = "precip."
-filename = grass.tempfile()
-file = open(filename, "w")
-for i in range(num_maps):
-    inc = i + 1
-    map_name = name + str(inc)
-    string = map_name + "\n"
-    file.write(string)
-
-file.close()
-
-grass.run_command("tr.register", flags="i", input=dataset, file=filename, start="1995-01-01", increment="1 days", overwrite=True)
-
-# Now aggregate the data
-
-grass.run_command("g.region", rast="precip.1", flags="p")
-
-input = "temp_mean_1995_2010_daily"
-output = "temp_mean_1995_2010_monthly"
-basename = "temp_mean_month"
-grass.run_command("tr.aggregate", input=input, method="average", output=output, base=basename, granularity="1 months", overwrite=True)
-output = "temp_mean_1995_2010_three_monthly"
-basename = "temp_mean_three_month"
-grass.run_command("tr.aggregate", input=input, method="average", output=output, base=basename, granularity="3 months", overwrite=True)
-
-input = "temp_min_1995_2010_daily"
-output = "temp_min_1995_2010_monthly"
-basename = "temp_min_month"
-grass.run_command("tr.aggregate", input=input, method="minimum", output=output, base=basename, granularity="1 months", overwrite=True)
-output = "temp_min_1995_2010_three_monthly"
-basename = "temp_min_three_month"
-grass.run_command("tr.aggregate", input=input, method="minimum", output=output, base=basename, granularity="3 months", overwrite=True)
-
-input = "temp_max_1995_2010_daily"
-output = "temp_max_1995_2010_monthly"
-basename = "temp_max_month"
-grass.run_command("tr.aggregate", input=input, method="maximum", output=output, base=basename, granularity="1 months", overwrite=True)
-output = "temp_max_1995_2010_three_monthly"
-basename = "temp_max_three_month"
-grass.run_command("tr.aggregate", input=input, method="maximum", output=output, base=basename, granularity="3 months", overwrite=True)
-
-input = "precipitation_1995_2010_daily"
-output = "precipitation_1995_2010_monthly"
-basename = "precip_month"
-grass.run_command("tr.aggregate", input=input, method="sum", output=output, base=basename, granularity="1 months", overwrite=True)
-output = "precipitation_1995_2010_three_monthly"
-basename = "precip_three_month"
-grass.run_command("tr.aggregate", input=input, method="sum", output=output, base=basename, granularity="3 months", overwrite=True)
-

+ 0 - 7
temporal/tr.register/Makefile

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

+ 0 - 81
temporal/tr.register/test.tr.register.file.sh

@@ -1,81 +0,0 @@
-# This is a test to register and unregister raster maps in
-# space time raster input.
-# The raster maps will be registered in different space time raster
-# inputs
-
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# raster with r.mapcalc and create two space time raster inputs
-# with relative and absolute time
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-r.mapcalc --o expr="prec_1 = rand(0, 550)"
-r.mapcalc --o expr="prec_2 = rand(0, 450)"
-r.mapcalc --o expr="prec_3 = rand(0, 320)"
-r.mapcalc --o expr="prec_4 = rand(0, 510)"
-r.mapcalc --o expr="prec_5 = rand(0, 300)"
-r.mapcalc --o expr="prec_6 = rand(0, 650)"
-
-n1=`g.tempfile pid=1 -d` # Only map names
-n2=`g.tempfile pid=2 -d` # Map names and start time
-n3=`g.tempfile pid=3 -d` # Map names start time and increment
-
-cat > "${n1}" << EOF
-prec_1
-prec_2
-prec_3
-prec_4
-prec_5
-prec_6
-EOF
-cat "${n1}"
-
-cat > "${n2}" << EOF
-prec_1|2001-01-01
-prec_2|2001-02-01
-prec_3|2001-03-01
-prec_4|2001-04-01
-prec_5|2001-05-01
-prec_6|2001-06-01
-EOF
-cat "${n2}"
-
-cat > "${n3}" << EOF
-prec_1|2001-01-01|2001-04-01
-prec_2|2001-04-01|2001-07-01
-prec_3|2001-07-01|2001-10-01
-prec_4|2001-10-01|2002-01-01
-prec_5|2002-01-01|2002-04-01
-prec_6|2002-04-01|2002-07-01
-EOF
-cat "${n3}"
-
-# The first @test
-# We create the space time raster inputs and register the raster maps with absolute time interval
-t.create --o type=strds temporaltype=absolute output=precip_abs8 title="A test with input files" descr="A test with input files"
-
-# Test with input files
-# File 1
-tr.register -i input=precip_abs8 file="${n1}" start="2001-01-01" increment="1 months"
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-# File 1
-tr.register input=precip_abs8 file="${n1}" start="2001-01-01" 
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-# File 2
-tr.register input=precip_abs8 file="${n2}" start=file
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-# File 2
-tr.register input=precip_abs8 file="${n2}" start=file increment="1 months"
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-# File 3
-tr.register -i input=precip_abs8 file="${n3}" start=file end=file
-t.info type=strds input=precip_abs8
-tr.list input=precip_abs8
-
-t.remove --v type=strds input=precip_abs8
-t.remove --v type=rast file="${n1}"

+ 0 - 97
temporal/tr.register/test.tr.register.sh

@@ -1,97 +0,0 @@
-# This is a test to register and unregister raster maps in
-# space time raster input.
-# The raster maps will be registered in different space time raster
-# inputs
-
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# raster with r.mapcalc and create two space time raster inputs
-# with relative and absolute time
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-r.mapcalc --o expr="prec_1 = rand(0, 550)"
-r.mapcalc --o expr="prec_2 = rand(0, 450)"
-r.mapcalc --o expr="prec_3 = rand(0, 320)"
-r.mapcalc --o expr="prec_4 = rand(0, 510)"
-r.mapcalc --o expr="prec_5 = rand(0, 300)"
-r.mapcalc --o expr="prec_6 = rand(0, 650)"
-
-# The first @test
-# We create the space time raster inputs and register the raster maps with absolute time interval
-
-t.create --o type=strds temporaltype=absolute output=precip_abs1 title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs2 title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs3 title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs4 title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs5 title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs6 title="A test" descr="A test"
-t.create --o type=strds temporaltype=absolute output=precip_abs7 title="A test" descr="A test"
-
-tr.register -i input=precip_abs1 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="1 seconds"
-t.info type=strds input=precip_abs1
-t.info -g type=strds input=precip_abs1
-r.info map=prec_1
-tr.list input=precip_abs1
-t.topology input=precip_abs1
-
-tr.register -i input=precip_abs2 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="20 seconds, 5 minutes"
-t.info type=strds input=precip_abs2
-t.info -g type=strds input=precip_abs2
-r.info map=prec_1
-tr.list input=precip_abs2
-t.topology input=precip_abs2
-
-tr.register -i input=precip_abs3 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="8 hours"
-t.info -g type=strds input=precip_abs3
-r.info map=prec_1
-tr.list input=precip_abs3
-t.topology input=precip_abs3
-
-tr.register input=precip_abs4 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="3 days"
-t.info -g type=strds input=precip_abs4
-r.info map=prec_1
-tr.list input=precip_abs4
-t.topology input=precip_abs4
-
-tr.register input=precip_abs5 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="4 weeks"
-t.info -g type=strds input=precip_abs5
-r.info map=prec_1
-tr.list input=precip_abs5
-t.topology input=precip_abs5
-
-tr.register input=precip_abs6 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-08-01" increment="2 months"
-t.info -g type=strds input=precip_abs6
-r.info map=prec_1
-tr.list input=precip_abs6
-t.topology input=precip_abs6
-
-tr.register input=precip_abs7 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="20 years, 3 months, 1 days, 4 hours"
-t.info -g type=strds input=precip_abs7
-r.info map=prec_1
-tr.list input=precip_abs7
-t.topology input=precip_abs7
-# Register with different valid time again
-tr.register input=precip_abs7 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="99 years, 9 months, 9 days, 9 hours"
-t.info -g type=strds input=precip_abs7
-r.info map=prec_1
-tr.list input=precip_abs7
-t.topology input=precip_abs7
-# Register with different valid time again creating an interval
-tr.register -i input=precip_abs7 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" increment="99 years, 9 months, 9 days, 9 hours"
-t.info -g type=strds input=precip_abs7
-r.info map=prec_1
-tr.list input=precip_abs7
-t.topology input=precip_abs7
-
-
-tr.register input=precip_abs7 maps=prec_1,prec_2,prec_3,prec_4,prec_5,prec_6 start="2001-01-01" end="2002-01-01"
-t.info -g type=strds input=precip_abs7
-r.info map=prec_1
-tr.list input=precip_abs7
-t.topology input=precip_abs7
-
-t.remove type=rast input=prec_1,prec_2,prec_3
-t.remove type=strds input=precip_abs1,precip_abs2,precip_abs3,precip_abs4,precip_abs5,precip_abs6,precip_abs7
-t.remove type=rast input=prec_4,prec_5,prec_6
-r.info map=prec_1

+ 0 - 0
temporal/tr.register/tr.register.html


+ 0 - 121
temporal/tr.register/tr.register.py

@@ -1,121 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	tr.register
-# AUTHOR(S):	Soeren Gebbert
-#
-# PURPOSE:	Register raster maps in 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: Register raster maps in a space time raster dataset
-#% keywords: spacetime raster dataset
-#% keywords: raster
-#%end
-
-#%option
-#% key: input
-#% type: string
-#% description: Name of an existing space time raster dataset
-#% required: yes
-#% multiple: no
-#%end
-
-#%option
-#% key: maps
-#% type: string
-#% description: Name(s) of existing raster map(s)
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: file
-#% type: string
-#% description: Input file with raster map names, one per line. Additionally the start time and the end time can be specified per line
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: start
-#% type: string
-#% description: The valid start date and time of the first raster map, in case the map has no valid time (format absolute: "yyyy-mm-dd HH:MM:SS", format relative 5.0). Use "file" as identifier in case the start time is located in an input file
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: end
-#% type: string
-#% description: The valid end date and time of the first raster map. Absolute time format is "yyyy-mm-dd HH:MM:SS" and "yyyy-mm-dd", relative time format id double. Use "file" as identifier in case the end time is located in the input file 
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: unit
-#% type: string
-#% description: The unit of the relative time
-#% required: no
-#% multiple: no
-#% options: years,months,days,hours,minutes,seconds
-#% answer: days
-#%end
-
-#%option
-#% key: increment
-#% type: string
-#% description: Time increment between maps for valid time interval creation (format absolute: NNN seconds, minutes, hours, days, weeks, months, years; format relative is integer: 5), or "file" in case the increment is located in an input file
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: fs
-#% type: string
-#% description: The field separator character of the input file
-#% required: no
-#% answer: |
-#%end
-
-#%flag
-#% key: i
-#% description: Create an interval (start and end time) in case an increment is provided
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    name = options["input"]
-    maps = options["maps"]
-    file = options["file"]
-    fs = options["fs"]
-    start = options["start"]
-    end = options["end"]
-    unit = options["unit"]
-    increment = options["increment"]
-    interval = flags["i"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-    # Register maps
-    tgis.register_maps_in_space_time_dataset(type="strds", name=name, maps=maps, layer=None, file=file, start=start, end=end, \
-                                             unit=unit, increment=increment, dbif=None, interval=interval, fs=fs)
-    
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()
-

+ 0 - 7
temporal/tr.unregister/Makefile

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

+ 0 - 0
temporal/tr.unregister/tr.unregister.html


+ 0 - 67
temporal/tr.unregister/tr.unregister.py

@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	tr.unregister
-# AUTHOR(S):	Soeren Gebbert
-#               
-# PURPOSE:	Unregister raster maps from space time raster datasets
-# 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: Unregister raster map(s) from a specific or from all space time raster dataset in which it is registered
-#% keywords: spacetime raster dataset
-#% keywords: raster
-#%end
-
-#%option
-#% key: input
-#% type: string
-#% description: Name of an existing space time raster dataset. If no name is provided the raster map(s) are unregistered from all space time datasets in which they are registered.
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: file
-#% type: string
-#% description: Input file with raster map names, one per line
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: maps
-#% type: string
-#% description: Name(s) of existing raster map(s) to unregister
-#% required: yes
-#% multiple: yes
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    file = options["file"]
-    name = options["input"]
-    maps = options["maps"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-    # Unregister maps
-    tgis.unregister_maps_from_space_time_datasets(type="rast", name=name, maps=maps, file=file, dbif=None)
-
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()
-

+ 0 - 7
temporal/tr3.register/Makefile

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

+ 0 - 70
temporal/tr3.register/test.tr3.register.sh

@@ -1,70 +0,0 @@
-# This is a test to register and unregister raster3d maps in
-# space time raster3d datasets
-# The raster3d maps will be registered in different space time raster3d
-# datasets
-
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# 3d raster with r3.mapcalc and create two space time raster3d datasets
-# with relative and absolute time
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-r3.mapcalc --o expr="volume_1 = rand(0, 550)"
-r3.mapcalc --o expr="volume_2 = rand(0, 450)"
-r3.mapcalc --o expr="volume_3 = rand(0, 320)"
-r3.mapcalc --o expr="volume_4 = rand(0, 510)"
-r3.mapcalc --o expr="volume_5 = rand(0, 300)"
-r3.mapcalc --o expr="volume_6 = rand(0, 650)"
-
-# The first @test
-# We create the space time raster3d dataset and register the raster3d maps with absolute time interval
-
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs1 title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs2 title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs3 title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs4 title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs5 title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs6 title="A test" descr="A test"
-t.create --v --o type=str3ds temporaltype=absolute output=volume_abs7 title="A test" descr="A test"
-
-tr3.register --v -i input=volume_abs1 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="1 seconds"
-t.info type=str3ds input=volume_abs1
-tr3.unregister --v input=volume_abs1 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6
-t.info type=str3ds input=volume_abs1
-
-tr3.register --v -i input=volume_abs2 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="20 seconds, 5 minutes"
-t.info type=str3ds input=volume_abs2
-r3.info volume_1
-r3.info volume_2
-r3.info volume_3
-r3.info volume_4
-r3.info volume_5
-r3.info volume_6
-
-tr3.register --v -i input=volume_abs3 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="8 hours"
-t.info type=str3ds input=volume_abs3
-tr3.unregister --v maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6
-t.info type=str3ds input=volume_abs3
-
-tr3.register input=volume_abs4 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="3 days"
-t.info type=str3ds input=volume_abs4
-
-tr3.register input=volume_abs5 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="4 weeks"
-t.info type=str3ds input=volume_abs5
-
-tr3.register input=volume_abs6 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-08-01" increment="2 months"
-t.info type=str3ds input=volume_abs6
-
-tr3.register input=volume_abs7 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="20 years, 3 months, 1 days, 4 hours"
-t.info type=str3ds input=volume_abs7
-# Register with different valid time again
-tr3.register input=volume_abs7 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="99 years, 9 months, 9 days, 9 hours"
-t.info type=str3ds input=volume_abs7
-# Register with different valid time again creating intervals
-tr3.register -i input=volume_abs7 maps=volume_1,volume_2,volume_3,volume_4,volume_5,volume_6 start="2001-01-01" increment="99 years, 9 months, 9 days, 9 hours"
-t.info type=str3ds input=volume_abs7
-
-t.remove --v type=rast3d input=volume_1,volume_2,volume_3
-t.remove --v type=str3ds input=volume_abs1,volume_abs2,volume_abs3,volume_abs4,volume_abs5,volume_abs6,volume_abs7
-t.remove --v type=rast3d input=volume_4,volume_5,volume_6

+ 0 - 0
temporal/tr3.register/tr3.register.html


+ 0 - 121
temporal/tr3.register/tr3.register.py

@@ -1,121 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	tr3.register
-# AUTHOR(S):	Soeren Gebbert
-#
-# PURPOSE:	Register raster3d maps in a space time raster3d 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: Register raster3d maps in a space time raster3d dataset
-#% keywords: spacetime raster3d dataset
-#% keywords: raster3d
-#%end
-
-#%option
-#% key: input
-#% type: string
-#% description: Name of an existing space time raster3d dataset
-#% required: yes
-#% multiple: no
-#%end
-
-#%option
-#% key: maps
-#% type: string
-#% description: Name(s) of existing raster3d map(s)
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: file
-#% type: string
-#% description: Input file with raster3d map names, one per line. Additionally the start time and the end time can be specified per line
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: start
-#% type: string
-#% description: The valid start date and time of the first raster3d map, in case the map has no valid time (format absolute: "yyyy-mm-dd HH:MM:SS", format relative 5.0). Use "file" as identifier in case the start time is located in an input file
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: end
-#% type: string
-#% description: The valid end date and time of the first raster3d map. Absolute time format is "yyyy-mm-dd HH:MM:SS" and "yyyy-mm-dd", relative time format id double. Use "file" as identifier in case the end time is located in the input file 
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: unit
-#% type: string
-#% description: The unit of the relative time
-#% required: no
-#% multiple: no
-#% options: years,months,days,hours,minutes,seconds
-#% answer: days
-#%end
-
-#%option
-#% key: increment
-#% type: string
-#% description: Time increment between maps for valid time interval creation (format absolute: NNN seconds, minutes, hours, days, weeks, months, years; format relative is integer: 5), or "file" in case the increment is located in an input file
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: fs
-#% type: string
-#% description: The field separator character of the input file
-#% required: no
-#% answer: |
-#%end
-
-#%flag
-#% key: i
-#% description: Create an interval (start and end time) in case an increment is provided
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    name = options["input"]
-    maps = options["maps"]
-    file = options["file"]
-    fs = options["fs"]
-    start = options["start"]
-    end = options["end"]
-    unit = options["unit"]
-    increment = options["increment"]
-    interval = flags["i"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-    # Register maps
-    tgis.register_maps_in_space_time_dataset(type="str3ds", name=name, maps=maps, file=file, start=start, end=end, \
-                                             unit=unit, increment=increment, dbif=None, interval=interval, fs=fs)
-    
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()
-

+ 0 - 7
temporal/tr3.unregister/Makefile

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

+ 0 - 0
temporal/tr3.unregister/tr3.unregister.html


+ 0 - 67
temporal/tr3.unregister/tr3.unregister.py

@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	tr3.unregister
-# AUTHOR(S):	Soeren Gebbert
-#               
-# PURPOSE:	Unregister raster3d maps from space time raster3d datasets
-# 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: Unregister raster3d map(s) from a specific or from all space time raster3d dataset in which it is registered
-#% keywords: spacetime raster3d dataset
-#% keywords: raster3d
-#%end
-
-#%option
-#% key: input
-#% type: string
-#% description: Name of an existing space time raster3d dataset. If no name is provided the raster3d map(s) are unregistered from all space time datasets in which they are registered.
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: file
-#% type: string
-#% description: Input file with raster3d map names, one per line
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: maps
-#% type: string
-#% description: Name(s) of existing raster3d map(s) to unregister
-#% required: yes
-#% multiple: yes
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    file = options["file"]
-    name = options["input"]
-    maps = options["maps"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-    # Unregister maps
-    tgis.unregister_maps_from_space_time_datasets(type="rast3d", name=name, maps=maps, file=file, dbif=None)
-
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()
-

+ 0 - 7
temporal/tv.register/Makefile

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

+ 0 - 64
temporal/tv.register/test.tv.register.sh

@@ -1,64 +0,0 @@
-# This is a test to register and unregister vector maps in
-# space time vector input.
-# The vector maps will be registered in different space time vector
-# inputs
-
-# We need to set a specific region in the
-# @preprocess step of this test. We generate
-# vector with v.random and create several space time vector inputs
-# with absolute time
-# The region setting should work for UTM and LL test locations
-g.region s=0 n=80 w=0 e=120 b=0 t=50 res=10 res3=10 -p3
-
-v.random --o -z output=lidar_abs_1 n=20 zmin=0 zmax=100 column=height
-v.random --o -z output=lidar_abs_2 n=20 zmin=0 zmax=100 column=height
-v.random --o -z output=lidar_abs_3 n=20 zmin=0 zmax=100 column=height
-v.random --o -z output=lidar_abs_4 n=20 zmin=0 zmax=100 column=height
-v.random --o -z output=lidar_abs_5 n=20 zmin=0 zmax=100 column=height
-v.random --o -z output=lidar_abs_6 n=20 zmin=0 zmax=100 column=height
-
-# The first @test
-# We create the space time vector inputs and register the vector maps with absolute time interval
-
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds1 title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds2 title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds3 title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds4 title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds5 title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds6 title="A test" descr="A test"
-t.create --v --o type=stvds temporaltype=absolute output=lidar_abs_ds7 title="A test" descr="A test"
-
-tv.register --v -i input=lidar_abs_ds1 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="1 seconds"
-t.info type=stvds input=lidar_abs_ds1
-tv.unregister --v input=lidar_abs_ds1 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6
-t.info type=stvds input=lidar_abs_ds1
-
-tv.register --v -i input=lidar_abs_ds2 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="20 seconds, 5 minutes"
-t.info type=stvds input=lidar_abs_ds2
-
-tv.register --v -i input=lidar_abs_ds3 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="8 hours"
-t.info type=stvds input=lidar_abs_ds3
-tv.unregister --v maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6
-t.info type=stvds input=lidar_abs_ds3
-
-tv.register input=lidar_abs_ds4 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="3 days"
-t.info type=stvds input=lidar_abs_ds4
-
-tv.register input=lidar_abs_ds5 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="4 weeks"
-t.info type=stvds input=lidar_abs_ds5
-
-tv.register input=lidar_abs_ds6 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-08-01" increment="2 months"
-t.info type=stvds input=lidar_abs_ds6
-
-tv.register input=lidar_abs_ds7 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="20 years, 3 months, 1 days, 4 hours"
-t.info type=stvds input=lidar_abs_ds7
-# Register with different valid time again
-tv.register input=lidar_abs_ds7 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="99 years, 9 months, 9 days, 9 hours"
-t.info type=stvds input=lidar_abs_ds7
-# Register with different valid time again creating an interval
-tv.register -i input=lidar_abs_ds7 maps=lidar_abs_1,lidar_abs_2,lidar_abs_3,lidar_abs_4,lidar_abs_5,lidar_abs_6 start="2001-01-01" increment="99 years, 9 months, 9 days, 9 hours"
-t.info type=stvds input=lidar_abs_ds7
-
-t.remove --v type=vect input=lidar_abs_1,lidar_abs_2,lidar_abs_3
-t.remove --v type=stvds input=lidar_abs_ds1,lidar_abs_ds2,lidar_abs_ds3,lidar_abs_ds4,lidar_abs_ds5,lidar_abs_ds6,lidar_abs_ds7
-t.remove --v type=vect input=lidar_abs_4,lidar_abs_5,lidar_abs_6

+ 0 - 0
temporal/tv.register/tv.register.html


+ 0 - 130
temporal/tv.register/tv.register.py

@@ -1,130 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	tv.register
-# AUTHOR(S):	Soeren Gebbert
-#
-# PURPOSE:	Register vector maps in a space time vector 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: Register vector maps in a space time vector dataset
-#% keywords: spacetime vector dataset
-#% keywords: vector
-#%end
-
-#%option
-#% key: input
-#% type: string
-#% description: Name of an existing space time vector dataset
-#% required: yes
-#% multiple: no
-#%end
-
-#%option
-#% key: maps
-#% type: string
-#% description: Name(s) of existing vector map(s)
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: layer
-#% type: string
-#% description: Id(s)/Name(s) of existing vector map layer or the identifier "file" in case the layer definition is in the input file
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: file
-#% type: string
-#% description: Input file with vector map names, one per line. Additionally the layer, the start time and the end time can be specified per line
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: start
-#% type: string
-#% description: The valid start date and time of the first vector map, in case the map has no valid time (format absolute: "yyyy-mm-dd HH:MM:SS", format relative 5.0). Use "file" as identifier in case the start time is located in an input file
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: end
-#% type: string
-#% description: The valid end date and time of the first vector map. Absolute time format is "yyyy-mm-dd HH:MM:SS" and "yyyy-mm-dd", relative time format id double. Use "file" as identifier in case the end time is located in the input file 
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: unit
-#% type: string
-#% description: The unit of the relative time
-#% required: no
-#% multiple: no
-#% options: years,months,days,hours,minutes,seconds
-#% answer: days
-#%end
-
-#%option
-#% key: increment
-#% type: string
-#% description: Time increment between maps for valid time interval creation (format absolute: NNN seconds, minutes, hours, days, weeks, months, years; format relative is integer: 5), or "file" in case the increment is located in an input file
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: fs
-#% type: string
-#% description: The field separator character of the input file
-#% required: no
-#% answer: |
-#%end
-
-#%flag
-#% key: i
-#% description: Create an interval (start and end time) in case an increment is provided
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    name = options["input"]
-    maps = options["maps"]
-    layer = options["layer"]
-    file = options["file"]
-    fs = options["fs"]
-    start = options["start"]
-    end = options["end"]
-    unit = options["unit"]
-    increment = options["increment"]
-    interval = flags["i"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-    # Register maps
-    tgis.register_maps_in_space_time_dataset(type="stvds", name=name, maps=maps, layer=layer, file=file, start=start, end=end, \
-                                             unit=unit, increment=increment, dbif=None, interval=interval, fs=fs)
-    
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()
-

+ 0 - 7
temporal/tv.unregister/Makefile

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

+ 0 - 0
temporal/tv.unregister/tv.unregister.html


+ 0 - 76
temporal/tv.unregister/tv.unregister.py

@@ -1,76 +0,0 @@
-#!/usr/bin/env python
-# -*- coding: utf-8 -*-
-############################################################################
-#
-# MODULE:	tv.unregister
-# AUTHOR(S):	Soeren Gebbert
-#               
-# PURPOSE:	Unregister vector maps from space time vector datasets
-# 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: Unregister vector map(s) from a specific or from all space time vector dataset in which it is registered
-#% keywords: spacetime vector dataset
-#% keywords: vector
-#%end
-
-#%option
-#% key: input
-#% type: string
-#% description: Name of an existing space time vector dataset. If no name is provided the vector map(s) are unregistered from all space time datasets in which they are registered.
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: layer
-#% type: string
-#% description: Id(s)/Name(s) of existing vector map layer or the identifier "file" in case the layer definition is in the input file
-#% required: no
-#% multiple: yes
-#%end
-
-#%option
-#% key: file
-#% type: string
-#% description: Input file with vector map names, one per line
-#% required: no
-#% multiple: no
-#%end
-
-#%option
-#% key: maps
-#% type: string
-#% description: Name(s) of existing vector map(s) to unregister
-#% required: yes
-#% multiple: yes
-#%end
-
-import grass.script as grass
-import grass.temporal as tgis
-
-############################################################################
-
-def main():
-
-    # Get the options
-    file = options["file"]
-    name = options["input"]
-    maps = options["maps"]
-    layer = options["layer"]
-
-    # Make sure the temporal database exists
-    tgis.create_temporal_database()
-    # Unregister maps
-    tgis.unregister_maps_from_space_time_datasets(type="vect", name=name, maps=maps, layer=layer, file=file, dbif=None)
-
-if __name__ == "__main__":
-    options, flags = grass.parser()
-    main()
-