[GRASS-SVN] r61922 - in grass/branches/releasebranch_7_0: . temporal/t.vect.import

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Sep 13 14:59:55 PDT 2014


Author: annakrat
Date: 2014-09-13 14:59:55 -0700 (Sat, 13 Sep 2014)
New Revision: 61922

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/temporal/t.vect.import/t.vect.import.html
   grass/branches/releasebranch_7_0/temporal/t.vect.import/t.vect.import.py
Log:
t.vect.import: added basename option and updated manual by Eric Goddard (merge from trunk, r61921)


Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:60289,60696,61269,61380,61420,61422,61480,61500,61764,61808,61831,61891,61905,61907,61913-61914,61916,61918
   + /grass/trunk:60289,60696,61269,61380,61420,61422,61480,61500,61764,61808,61831,61891,61905,61907,61913-61914,61916,61918,61921

Modified: grass/branches/releasebranch_7_0/temporal/t.vect.import/t.vect.import.html
===================================================================
--- grass/branches/releasebranch_7_0/temporal/t.vect.import/t.vect.import.html	2014-09-13 21:58:57 UTC (rev 61921)
+++ grass/branches/releasebranch_7_0/temporal/t.vect.import/t.vect.import.html	2014-09-13 21:59:55 UTC (rev 61922)
@@ -1,10 +1,55 @@
 <h2>DESCRIPTION</h2>
 
-TBD.
+<em>t.vect.import</em> imports a space time vector dataset archive that was 
+created with <a href="t.vect.export.html">t.vect.export</a>.
+Optionally a base map name can be provided to avoid overwriting vector maps  
+used in the space-time vector dataset archive.
 
+
+<h2>EXAMPLE</h2>
+In this example 5 vector maps are created and registered in a single space time 
+vector dataset named <em>random_locations</em>. Each vector map represents 
+random locations within the boundary of the state taken at 1 month intervals. 
+The space time dataset is then exported and re-imported.
+
+<div class="code"><pre>
+db.connect -d
+
+for i in `seq 1 5` ; do
+    v.random output=map_$i n=500 input=boundary_state at PERMANENT
+    echo map_$i >> map_list.txt
+done
+
+t.create type=stvds temporaltype=absolute \
+         output=random_locations \
+         title="Random locations" \
+         description="Vector test dataset with random locations"
+
+t.register -i type=vect input=random_locations \
+           file=map_list.txt start="2012-01-01" increment="1 months"
+
+t.vect.list random_locations
+
+t.vect.export input=random_locations output=random_locations.tar.gz \
+              compression=gzip
+
+t.vect.import input=random_locations.tar.gz output=new_random_locations \
+              base=new_map extrdir=/tmp
+
+t.vect.list new_random_locations
+id|name|layer|mapset|start_time|end_time
+new_map_1 at user1|new_map_1|None|user1|2012-01-01 00:00:00|2012-02-01 00:00:00
+new_map_2 at user1|new_map_2|None|user1|2012-02-01 00:00:00|2012-03-01 00:00:00
+new_map_3 at user1|new_map_3|None|user1|2012-03-01 00:00:00|2012-04-01 00:00:00
+new_map_4 at user1|new_map_4|None|user1|2012-04-01 00:00:00|2012-05-01 00:00:00
+new_map_5 at user1|new_map_5|None|user1|2012-05-01 00:00:00|2012-06-01 00:00:00
+</pre>
+</div>
+
 <h2>SEE ALSO</h2>
 
 <em>
+<a href="t.vect.export.html">t.vect.export</a>,
 <a href="t.create.html">t.create</a>,
 <a href="t.info.html">t.info</a>
 </em>

Modified: grass/branches/releasebranch_7_0/temporal/t.vect.import/t.vect.import.py
===================================================================
--- grass/branches/releasebranch_7_0/temporal/t.vect.import/t.vect.import.py	2014-09-13 21:58:57 UTC (rev 61921)
+++ grass/branches/releasebranch_7_0/temporal/t.vect.import/t.vect.import.py	2014-09-13 21:59:55 UTC (rev 61922)
@@ -26,6 +26,15 @@
 #%option G_OPT_STVDS_OUTPUT
 #%end
 
+#%option
+#% key: basename
+#% type: string
+#% label: Basename of the new generated output maps
+#% description: A numerical suffix separated by an underscore will be attached to create a unique identifier
+#% required: no
+#% multiple: no
+#%end
+
 #%option G_OPT_M_DIR
 #% key: extrdir
 #% description: Path to the extraction directory
@@ -83,14 +92,15 @@
     title = options["title"]
     descr = options["description"]
     location = options["location"]
+    base = options["basename"]
     exp = flags["e"]
     overr = flags["o"]
     create = flags["c"]
-    
+
     tgis.init()
 
     tgis.import_stds(input, output, extrdir, title, descr, location,
-                     None, exp, overr, create, "stvds")
+                     None, exp, overr, create, "stvds", base)
 
 if __name__ == "__main__":
     options, flags = grass.parser()



More information about the grass-commit mailing list