<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FMatmar</id>
	<title>GRASS-Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://grasswiki.osgeo.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=%E2%9A%A0%EF%B8%8FMatmar"/>
	<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/wiki/Special:Contributions/%E2%9A%A0%EF%B8%8FMatmar"/>
	<updated>2026-05-25T21:11:07Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=PostGIS&amp;diff=23870</id>
		<title>PostGIS</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=PostGIS&amp;diff=23870"/>
		<updated>2017-01-23T03:12:36Z</updated>

		<summary type="html">&lt;p&gt;⚠️Matmar: \*output=PG:dbname=pgis_nc*\&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When accessing [http://www.postgis.net PostGIS] data in GRASS you can &lt;br /&gt;
* [[#Import into GRASS|import]] PostGIS (simple features) data into GRASS topological format or,&lt;br /&gt;
* [[#Link to GRASS|link]] PostGIS data as GRASS vector maps&lt;br /&gt;
&lt;br /&gt;
See also [[Working with external data in GRASS 7|working with external data in GRASS 7]].&lt;br /&gt;
__TOC__&lt;br /&gt;
== Help pages ==&lt;br /&gt;
&lt;br /&gt;
* {{cmd|vectorintro|desc=Vector data processing in GRASS GIS}} help page&lt;br /&gt;
* {{cmd|databaseintro|desc=Database management in GRASS GIS}} help page&lt;br /&gt;
* {{cmd|sql|desc=SQL support in GRASS GIS}} help page&lt;br /&gt;
&lt;br /&gt;
* {{cmd|grass-pg|desc=PostgreSQL DB driver in GRASS}} help page&lt;br /&gt;
* {{cmd|grass-odbc|desc=ODBC DB driver in GRASS}} help page&lt;br /&gt;
&lt;br /&gt;
== Import into GRASS ==&lt;br /&gt;
&lt;br /&gt;
# {{cmd|v.in.ogr}} - imports geometry data from PostGIS into native GRASS vector format, attributes are stored using default DB settings (see {{cmd|db.connect}} for details)&lt;br /&gt;
# {{cmd|v.clean}} - clean up data after import&lt;br /&gt;
&lt;br /&gt;
''Note 1:'' There is a fundamental difference between the PostGIS format which is&lt;br /&gt;
non-topological (OGC simple feature-based) and the internal GRASS format which is topological and&lt;br /&gt;
which, thus, does not really allow for overlapping polygons. You can&lt;br /&gt;
digitize them, but they are not really useful...&lt;br /&gt;
&lt;br /&gt;
''Note 2:'' GRASS 7 allows also reading and writing topological PostGIS data (see [http://www.postgis.org/documentation/manual-2.0/Topology.html PostGIS Topology] for details).&lt;br /&gt;
&lt;br /&gt;
{{YouTube|JoqIkL2VRVc|desc=Importing PostGIS layers into GRASS}}&lt;br /&gt;
&lt;br /&gt;
== Link to GRASS ==&lt;br /&gt;
&lt;br /&gt;
* input maps: {{cmd|v.external}}&lt;br /&gt;
**GRASS 7 supports also write access to the map links, see [[Working with external data in GRASS 7#Vector data|working with external data in GRASS 7]] for details&lt;br /&gt;
* output maps: {{cmd|v.external.out}}&lt;br /&gt;
&lt;br /&gt;
You can register a PostGIS table in GRASS using {{cmd|v.external}}. The command below creates a link to the table 'lakes' located in database 'pgis_nc'.&lt;br /&gt;
&lt;br /&gt;
 # list available PG tables&lt;br /&gt;
 v.external input=&amp;quot;PG:host=myserver user= myuser dbname=pgis_nc&amp;quot; -l&lt;br /&gt;
 &lt;br /&gt;
 # link PG table into GRASS GIS as vector map&lt;br /&gt;
 v.external input=&amp;quot;PG:host=myserver user= myuser dbname=pgis_nc&amp;quot; layer=lakes&lt;br /&gt;
&lt;br /&gt;
The command creates in the current mapset new vector map 'lakes', the module also builds pseudo-topology for this map,&lt;br /&gt;
&lt;br /&gt;
To link a PostGIS table from non-public schema&lt;br /&gt;
&lt;br /&gt;
 v.external input=PG:&amp;lt;connection sting&amp;gt; layer=&amp;lt;schema&amp;gt;.&amp;lt;layer&amp;gt; output=&amp;lt;layer&amp;gt;&lt;br /&gt;
&lt;br /&gt;
''Important note:'' In GRASS 6 the created links area ''read-only''. GRASS 7 also allows to modify linked layers directly via OGR or PostGIS data provider, see [[Working with external data in GRASS 7#Vector data|working with external data in GRASS 7]] for details.&lt;br /&gt;
&lt;br /&gt;
{{YouTube|eB3_SmE3E9Q|desc=Link PostGIS layers as GRASS vector maps}}&lt;br /&gt;
&lt;br /&gt;
== Export to PostGIS ==&lt;br /&gt;
&lt;br /&gt;
To export GRASS vector map layer as PostGIS table use {{cmd|v.out.ogr}}, eg.&lt;br /&gt;
&lt;br /&gt;
 v.out.ogr in=lakes@PERMANENT output=PG:dbname=pgis_nc format=PostgreSQL type=area&lt;br /&gt;
&lt;br /&gt;
In GRASS 7 exists also specialized module {{cmd|v.out.postgis}} which allows to export GRASS vector data as simple features (similarly to {{cmd|v.out.ogr}}) or in topological format (see [[PostGIS Topology]] for defails).&lt;br /&gt;
&lt;br /&gt;
Note that exporting data can be quite time-consuming task, especially when input vector map attributes are stored in DBF format. It's recommended to store attribute data in {{cmd|grass-sqlite|desc=SQLite format}} rather then in old-fashioned {{cmd|grass-dbf|desc=DBF format}}. &lt;br /&gt;
&lt;br /&gt;
{{YouTube|DTMmmcVpJKk|desc=Creating model which exports all GRASS vector maps from given mapset to PostGIS database}}&lt;br /&gt;
{{YouTube|uStN3F6ZZoc|desc=Creating model which exports all GRASS vector maps from given mapset to PostGIS database (including schema)&lt;br /&gt;
&lt;br /&gt;
1) create schema with name of input mapset&lt;br /&gt;
&lt;br /&gt;
2) copy vector maps from selected mapset to the current and stores their attributes in SQLite database&lt;br /&gt;
&lt;br /&gt;
3) exports GRASS vector maps to the selected PostGIS database&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
See also [[wxGUI Graphical Modeler]].&lt;br /&gt;
&lt;br /&gt;
== Direct access to PostGIS data (GRASS 7 only) ==&lt;br /&gt;
&lt;br /&gt;
''Important note:'' Direct read/write access is available only in GRASS 7.&lt;br /&gt;
&lt;br /&gt;
=== Direct read access ===&lt;br /&gt;
&lt;br /&gt;
GRASS 7 allows to access PostGIS data directly via virtual mapset called 'OGR'. In this case parameter &amp;lt;tt&amp;gt;map&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;input&amp;lt;/tt&amp;gt; is used for OGR data source and &amp;lt;tt&amp;gt;layer&amp;lt;/tt&amp;gt; for table. In the command bellow is accessed PostGIS table 'lakes' from database 'pgis_nc'.&lt;br /&gt;
&lt;br /&gt;
 v.info map=PG:dbname=pgis_nc@OGR layer=lakes&lt;br /&gt;
&lt;br /&gt;
To access table from non-public schema (or schemas which are not in the search path), type&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
v.info map=PG:&amp;lt;OGR data source&amp;gt; layer=&amp;lt;schema&amp;gt;.&amp;lt;table&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When accessing external data directly you don't need to create a map link by {{cmd|v.external}}. The major drawback of direct read access is that the pseudo-topology is built each time when accessing the data. From this point of view the direct access is useful when accessing data once or few times, otherwise is better to link the data by {{cmd|v.external}}.&lt;br /&gt;
&lt;br /&gt;
=== Direct write access ===&lt;br /&gt;
&lt;br /&gt;
GRASS 7 allows to write output vector map directly via OGR library. For defining output vector data format is designed {{cmd|v.external.out}} module. For example&lt;br /&gt;
&lt;br /&gt;
 v.external.out input=PG:dbname=pgis_nc format=PostgreSQL&lt;br /&gt;
&lt;br /&gt;
causes that output vector data are written in PostGIS format in the database 'pgis_nc'. GRASS also creates automatically for every PostGIS table a new vector map in the current mapset as the link to the PostGIS table. &lt;br /&gt;
&lt;br /&gt;
PostGIS data can be accessed by the map link or directly as described in the section above. For example&lt;br /&gt;
&lt;br /&gt;
 v.extract input=lakes out=reservoir where=&amp;quot;FTYPE = 'RESERVOIR'&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 v.info map=reservoir&lt;br /&gt;
 # or&lt;br /&gt;
 v.info map=PG:dbname=pgis_nc@OGR layer=reservoir&lt;br /&gt;
&lt;br /&gt;
To switch back to GRASS native format enter&lt;br /&gt;
&lt;br /&gt;
 v.external.out -r&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Working with external data in GRASS 7]]&lt;br /&gt;
* [[PostGIS Topology]]&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.surfaces.co.il/?p=645 Tutorial by Micha Silver]&lt;br /&gt;
* [http://www.postgis.org PostGIS]&lt;br /&gt;
* [http://gdal.org/ogr OGR library]&lt;br /&gt;
* [http://www.dimensionaledge.com/main/postgis/viewshed-analysis-in-postgis-using-plr-and-grass/ Viewshed analysis in PostGIS using PL/R and GRASS] (blog post by Mark Wynter)&lt;br /&gt;
* [https://strk.kbt.io/projects/rttopo/ RT Topology Library]&lt;br /&gt;
&lt;br /&gt;
[[Category: FAQ]]&lt;br /&gt;
[[Category: Vector]]&lt;/div&gt;</summary>
		<author><name>⚠️Matmar</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=GRASS_GIS_Standardized_Sample_Datasets&amp;diff=22054</id>
		<title>GRASS GIS Standardized Sample Datasets</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=GRASS_GIS_Standardized_Sample_Datasets&amp;diff=22054"/>
		<updated>2015-10-13T08:48:35Z</updated>

		<summary type="html">&lt;p&gt;⚠️Matmar: ulr updated&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{ToModify}}&lt;br /&gt;
&lt;br /&gt;
See {{twiki|SampleDataset|Trac wiki page}} for the development of the dataset.&lt;br /&gt;
&lt;br /&gt;
== List of datasets ==&lt;br /&gt;
&lt;br /&gt;
'''Already published:'''&lt;br /&gt;
* [http://grass.osgeo.org/download/sample-data/ North Carolina GRASS Sample Location] (2007, map names partially standardized, content partially standardized, currently used dataset, to be deprecated)&lt;br /&gt;
* [http://geodati.fmach.it/gfoss_geodata/libro_gfoss/ Piemonte, Italy] (2012, map names not standardized, content not standardized, work in progress, see below)&lt;br /&gt;
* Spearfish, USA (to be phased out, 1986)&lt;br /&gt;
&lt;br /&gt;
'''Planning - Future standardized datasets'''&lt;br /&gt;
*  [http://trac.osgeo.org/grass/wiki/SampleDataset GRASS GIS North Carolina USA Sample Dataset] (reference for other datasets, under development)&lt;br /&gt;
*  [http://trac.osgeo.org/grass/wiki/SampleDataset/Italy/Piemont GRASS GIS Piemonte Italy Sample Dataset]&lt;br /&gt;
*  [http://trac.osgeo.org/grass/wiki/SampleDataset/World GRASS GIS World Sample Dataset]&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
=== Computing slope and aspect ===&lt;br /&gt;
&lt;br /&gt;
Compute slope, aspect and profile curvature of the terrain:&lt;br /&gt;
&lt;br /&gt;
 g.region raster=elevation&lt;br /&gt;
 r.slope.aspect elevation=elevation slope=slope aspect=aspect pcurvature=profile_curvature&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
not used now because this needs individual approach&lt;br /&gt;
&lt;br /&gt;
Piemonte display region:&lt;br /&gt;
north:      5136489.9425&lt;br /&gt;
south:      5035337.95613&lt;br /&gt;
west:       321279.974525&lt;br /&gt;
east:       448051.241282&lt;br /&gt;
rows=458&lt;br /&gt;
cols=574&lt;br /&gt;
&lt;br /&gt;
NC display region:&lt;br /&gt;
north:      228500&lt;br /&gt;
south:      215000&lt;br /&gt;
west:       630000&lt;br /&gt;
east:       645000&lt;br /&gt;
rows=458&lt;br /&gt;
cols=574&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:std_dataset_nc_stripe.png|thumb|North Carolina (USA) dataset|700px]]&lt;br /&gt;
[[File:std_dataset_it_stripe.png|thumb|Piemonte (Italy) dataset|700px]]&lt;br /&gt;
[[File:std_dataset_pr_stripe.png|thumb|Puerto Rico dataset|700px]]&lt;br /&gt;
[[File:std_dataset_cz_stripe.png|thumb|Czech Republic dataset|700px]]&lt;br /&gt;
&lt;br /&gt;
=== Visualizing shaded relief ===&lt;br /&gt;
&lt;br /&gt;
Visualize digital elevation model with shaded relief:&lt;br /&gt;
&lt;br /&gt;
 g.region raster=elevation&lt;br /&gt;
 r.relief input=elevation output=shade&lt;br /&gt;
 d.shade shade=shade color=elevation&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery mode=packed&amp;gt;&lt;br /&gt;
File:std_dataset_nc_shaded_elevation.png|North Carolina, USA&lt;br /&gt;
File:std_dataset_piemonte_shaded_elevation.png|Piemonte, Italy&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Where are the datasets used ==&lt;br /&gt;
&lt;br /&gt;
* [http://grass.osgeo.org/grass70/manuals/ GRASS GIS manual] (currently using original, not fully compliant North Carolina GRASS Sample Location)&lt;br /&gt;
* [http://courses.ncsu.edu/gis582/common/ NCSU Geospatial Modeling and Analysis course] and other [http://geospatial.ncsu.edu/osgeorel/courses.html NCSU OSGeoREL courses] (currently using original, not fully compliant North Carolina GRASS Sample Location)&lt;br /&gt;
&lt;br /&gt;
== Tools to help with managing a dataset ==&lt;br /&gt;
&lt;br /&gt;
* [http://grass.osgeo.org/grass70/manuals/g.rename.html g.rename] for changing names of individual raster and vector maps&lt;br /&gt;
* [http://grass.osgeo.org/grass70/manuals/addons/g.rename.many.html g.rename.many] for renaming large amount of maps (to standard names or to/from different language)&lt;br /&gt;
* [http://grass.osgeo.org/grass70/manuals/addons/r.in.proj.html r.in.proj] and [http://grass.osgeo.org/grass70/manuals/addons/v.in.proj.html v.in.proj] for importing data with different coordinate system&lt;br /&gt;
* Python script [https://trac.osgeo.org/grass/browser/grass-addons/tools/std_dataset_display.py std_dataset_display.py] for generating some maps and images&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Contact ==&lt;br /&gt;
&lt;br /&gt;
If you are interested in producing a dataset for your region, please contact [https://lists.osgeo.org/mailman/listinfo/grass-user grass-user] mailing list or  [[User:Wenzeslaus|Vaclav Petras]].&lt;/div&gt;</summary>
		<author><name>⚠️Matmar</name></author>
	</entry>
	<entry>
		<id>https://grasswiki.osgeo.org/w/index.php?title=Temporal_data_processing&amp;diff=21463</id>
		<title>Temporal data processing</title>
		<link rel="alternate" type="text/html" href="https://grasswiki.osgeo.org/w/index.php?title=Temporal_data_processing&amp;diff=21463"/>
		<updated>2015-04-15T19:17:11Z</updated>

		<summary type="html">&lt;p&gt;⚠️Matmar: cla==cla_test&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
TGRASS is the temporal enabled GRASS GIS. It is available from [http://grass.osgeo.org/grass7/ GRASS GIS 7] onwards.&lt;br /&gt;
TGRASS is completely metadata based, and managing temporal and spatial extent including temporal topology.&lt;br /&gt;
&lt;br /&gt;
== Terminology Overview ==&lt;br /&gt;
&lt;br /&gt;
* Space time raster datasets (strds) are designed to manage raster map time series. Modules that process strds have the naming prefix ''t.rast''.&lt;br /&gt;
* Space time 3D raster datasets (str3ds) are designed to manage 3D raster map time series. Modules that process str3ds have the naming prefix ''t.rast3d''.&lt;br /&gt;
* Space time vector datasets (stvds) are designed to manage vector map time series. Modules that process stvds have the naming prefix ''t.vect''. &lt;br /&gt;
&lt;br /&gt;
== Example workflow for a Chlorophyll-a MODIS time series ==&lt;br /&gt;
&lt;br /&gt;
The following examples are based on a series of MODIS L3 Chlorophyll-a product that is freely available at the [http://oceancolor.gsfc.nasa.gov/cgi/l3?sen=A&amp;amp;per=MO&amp;amp;prd=CHL_chlor_a ocean color] site. So, say we download the SMI 8-day composite product at 4.6 km resolution for the period 2003-2013. That is a 506 set of images, 46 per year. Data comes as compressed HDF4 files. Chlorophyll products filenames look like this: &lt;br /&gt;
&lt;br /&gt;
A20030012003008.L3m_8D_CHL_chlor_a_4km&lt;br /&gt;
&lt;br /&gt;
  A: MODIS/Aqua&lt;br /&gt;
  2003: Year at start&lt;br /&gt;
  001: Julian day at start&lt;br /&gt;
  2003: Year at end&lt;br /&gt;
  008: Julian day at end&lt;br /&gt;
  L3m: Level 3 data, mapped (Projection: Plate carrée)&lt;br /&gt;
  8D: 8 day composition&lt;br /&gt;
  CHL: Chlorophyll a concentration product&lt;br /&gt;
  chlor_a: algorithm used 10^(a0 + a1*X + a2*X^2 + a3*X^3 + a4*X^4) &lt;br /&gt;
  4km: 4.6km pixel size (8640x4320 image, 2.5 minute resolution)&lt;br /&gt;
&lt;br /&gt;
We now decompress files and check metadata &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Go to where the data is and decompress&lt;br /&gt;
  find -iname '*.bz2' -exec bzip2 -d {} \; &lt;br /&gt;
# Check file meta-data (GDAL utilities)&lt;br /&gt;
  gdalinfo A20030012003008.L3m_8D_CHL_chlor_a_4km&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Next step is to import all 506 images into GRASS. You can use r.in.gdal or r.external for that.&lt;br /&gt;
Note that global Cl-a images as downloaded from [http://oceancolor.gsfc.nasa.gov/cgi/l3?sen=A&amp;amp;per=MO&amp;amp;prd=CHL_chlor_a ocean color] site are ~150 mb each (disk space issues!). Here, 3 different options:&lt;br /&gt;
&lt;br /&gt;
* import global images (506 images, 150 Mb each) with r.in.gdal, resize to study area and remove global files&lt;br /&gt;
* set projection and extension, and resize to study area with gdal_translate, and import already resized images with r.in.gdal&lt;br /&gt;
* import global images (506 images, 150 Mb each) with r.external, resize to study area and remove global files, as showed next:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# define region extension&lt;br /&gt;
g.region -p n=-38 s=-55 w=-70 e=-56&lt;br /&gt;
&lt;br /&gt;
suffix=_tmp&lt;br /&gt;
for map in *chlor*; do&lt;br /&gt;
  r.external input=$map output=${map}${suffix} -o ;&lt;br /&gt;
  r.mapcalc expression=&amp;quot;$map=${map}${suffix}&amp;quot; ;&lt;br /&gt;
  g.remove rast=${map}${suffix} ;&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Time series processing ===&lt;br /&gt;
&lt;br /&gt;
Once we have maps inside GRASS we can start the temporal processing. If this is the first time you'll use temporal modules, &lt;br /&gt;
you need to run &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  t.connect -d &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to set the default temporal GIS database connection for the current mapset. The default TGIS database of type sqlite3 &lt;br /&gt;
is located in the PERMANENT mapset directory. Temporal GIS content from all created mapsets will be stored there. &lt;br /&gt;
&lt;br /&gt;
=== 1. Creating a STRDS and registering maps ===&lt;br /&gt;
&lt;br /&gt;
First step is to create a space time dataset by means of [http://grass.osgeo.org/grass71/manuals/t.create.html t.create]. Let us create a strds for the Chlorophyll-a (Cl-a) time series. We need to define the type (raster, 3D raster or vector), if the time is absolute or relative and, the name of the space time dataset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.create type=strds temporaltype=absolute output=cla_test title=&amp;quot;Chlorophyll-a concentration&amp;quot; \&lt;br /&gt;
  description=&amp;quot;MODIS L3 Chlorophyll-a concentration for Argentinian sea&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, we register our 506 raster maps in the strds using [http://grass.osgeo.org/grass71/manuals/t.register.html t.register]. This module assigns time stamps to raster, 3D raster and vector maps and register them into space time datasets. Existing timestamps can be read and used by t.register.&lt;br /&gt;
&lt;br /&gt;
This module supports absolute and relative time. Maps can be registered by command line argument (a list of comma separated map names) or using an input file. The start time, end time and a temporal increment can be provided by command line or in the input file. End time and increment are mutual exclusive. Maps can be registered in several space time datasets using the same timestamp.&lt;br /&gt;
&lt;br /&gt;
Start time and end time with absolute time must be provided using the format yyyy-mm-dd HH:MM:SS +HHMM. It is also supported to specify the date yyyy-mm-dd only. In case of relative time the temporal unit (years, months, days, hours, minutes or seconds) must be provided. The relative start time, end time and the increment are integers.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.register -i type=rast input=cla_test maps=`g.list rast pat=*_chlor_* sep=,`\&lt;br /&gt;
  start=&amp;quot;2003-01-01&amp;quot; increment=&amp;quot;8 days&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would have been the simplest solution, but 8-day products have a problem, the last image of each year is not a product of an 8-day composition, but 4 or 5-day. Then, when using the increment parameter, dates are not set properly.&lt;br /&gt;
The solution was to create a list of maps, with their respective start and end date. As the filenames contain information regarding year and DOY (day of year), we can use the following Python script to read filenames and transform DOY to calendar dates (Thanks Soeren!). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
# in python&lt;br /&gt;
from os import walk&lt;br /&gt;
f = []&lt;br /&gt;
for (dirpath, dirnames, filenames) in walk(&amp;quot;/path/to/the/maps&amp;quot;):&lt;br /&gt;
    f.extend(filenames)&lt;br /&gt;
    break&lt;br /&gt;
# to order the list    &lt;br /&gt;
f.sort() &lt;br /&gt;
&lt;br /&gt;
input_list=[]&lt;br /&gt;
&lt;br /&gt;
import datetime&lt;br /&gt;
for map_name in f:&lt;br /&gt;
  start_year = int(map_name[1:5])&lt;br /&gt;
  start_day  = int(map_name[5:8])&lt;br /&gt;
  end_year   = int(map_name[8:12])&lt;br /&gt;
  end_day    = int(map_name[12:15])&lt;br /&gt;
  start = datetime.datetime(start_year, 1, 1) + datetime.timedelta(start_day - 1)&lt;br /&gt;
  end = datetime.datetime(int(end_year), 1, 1) + datetime.timedelta(end_day)&lt;br /&gt;
  map_list = map_name + '|' + str(start) + '|' + str(end)&lt;br /&gt;
  print map_list&lt;br /&gt;
  input_list.append(map_list)&lt;br /&gt;
&lt;br /&gt;
print input_list&lt;br /&gt;
&lt;br /&gt;
txt = '\n' .join(input_list)&lt;br /&gt;
f = open(&amp;quot;input_list_cla.txt&amp;quot;,&amp;quot;w&amp;quot;)&lt;br /&gt;
f.write(txt)&lt;br /&gt;
f.close()&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using the number of characters in the filenames and datetime library in Python, you can convert DOY in the filenames into start_time and end_time as in the list you need to pass to t.register. The resulting list looks like this:&lt;br /&gt;
&lt;br /&gt;
  A20030012003008.L3m_8D_CHL_chlor_a_4km_arg|2003-01-01 00:00:00|2003-01-09 00:00:00&lt;br /&gt;
  A20030092003016.L3m_8D_CHL_chlor_a_4km_arg|2003-01-09 00:00:00|2003-01-17 00:00:00&lt;br /&gt;
  A20030172003024.L3m_8D_CHL_chlor_a_4km_arg|2003-01-17 00:00:00|2003-01-25 00:00:00&lt;br /&gt;
  ...&lt;br /&gt;
  A20133452013352.L3m_8D_CHL_chlor_a_4km_arg|2013-12-11 00:00:00|2013-12-19 00:00:00&lt;br /&gt;
  A20133532013360.L3m_8D_CHL_chlor_a_4km_arg|2013-12-19 00:00:00|2013-12-27 00:00:00&lt;br /&gt;
  A20133612013365.L3m_8D_CHL_chlor_a_4km_arg|2013-12-27 00:00:00|2014-01-01 00:00:00&lt;br /&gt;
&lt;br /&gt;
and then, the command would be:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.register --o type=rast input=cla file=input_list_cla.txt&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We can also set a color palette for all maps in the strds with: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.colors input=cla color=name_of_color_table&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 2. Getting some basic info and statistics ===&lt;br /&gt;
&lt;br /&gt;
We now check the space time data sets we have in our mapset with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.list type=strds&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and list information about our recently created strds. See [http://grass.osgeo.org/grass71/manuals/t.info.html t.info] for additional uses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.info type=strds input=cla &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  +-------------------- Space Time Raster Dataset -----------------------------+&lt;br /&gt;
  |                                                                            |&lt;br /&gt;
  +-------------------- Basic information -------------------------------------+&lt;br /&gt;
  | Id: ........................ cla@clorofila&lt;br /&gt;
  | Name: ...................... cla&lt;br /&gt;
  | Mapset: .................... clorofila&lt;br /&gt;
  | Creator: ................... veroandreo&lt;br /&gt;
  | Temporal type: ............. absolute&lt;br /&gt;
  | Creation time: ............. 2014-04-29 14:23:00.579342&lt;br /&gt;
  | Modification time:.......... 2014-05-12 09:15:08.917309&lt;br /&gt;
  | Semantic type:.............. mean&lt;br /&gt;
  +-------------------- Absolute time -----------------------------------------+&lt;br /&gt;
  | Start time:................. 2003-01-01 00:00:00&lt;br /&gt;
  | End time:................... 2014-01-01 00:00:00&lt;br /&gt;
  | Granularity:................ 1 day&lt;br /&gt;
  | Temporal type of maps:...... interval&lt;br /&gt;
  +-------------------- Spatial extent ----------------------------------------+&lt;br /&gt;
  | North:...................... -38.0&lt;br /&gt;
  | South:...................... -55.0&lt;br /&gt;
  | East:.. .................... -55.0&lt;br /&gt;
  | West:....................... -70.0&lt;br /&gt;
  | Top:........................ 0.0&lt;br /&gt;
  | Bottom:..................... 0.0&lt;br /&gt;
  +-------------------- Metadata information ----------------------------------+&lt;br /&gt;
  | Raster register table:...... raster_map_register_91ba57d5f0924f4fa0bd7176a1b39b2f&lt;br /&gt;
  | North-South resolution min:. 0.041667&lt;br /&gt;
  | North-South resolution max:. 0.041667&lt;br /&gt;
  | East-west resolution min:... 0.041667&lt;br /&gt;
  | East-west resolution max:... 0.041667&lt;br /&gt;
  | Minimum value min:.......... 0.02925&lt;br /&gt;
  | Minimum value max:.......... 0.26472&lt;br /&gt;
  | Maximum value min:.......... 5.2104&lt;br /&gt;
  | Maximum value max:.......... 99.953934&lt;br /&gt;
  | Aggregation type:........... None&lt;br /&gt;
  | Number of registered maps:.. 506&lt;br /&gt;
  |&lt;br /&gt;
  | Title:&lt;br /&gt;
  | Chlorophyll-a&lt;br /&gt;
  | Description:&lt;br /&gt;
  | Concentracion de Clorofila a&lt;br /&gt;
  | Command history:&lt;br /&gt;
  | # 2014-04-29 14:23:00 &lt;br /&gt;
  | t.create type=&amp;quot;strds&amp;quot; temporaltype=&amp;quot;absolute&amp;quot;&lt;br /&gt;
  |     output=&amp;quot;cla&amp;quot; title=&amp;quot;Chlorophyll-a&amp;quot;&lt;br /&gt;
  |     description=&amp;quot;Concentracion de Clorofila a&amp;quot; --o&lt;br /&gt;
  | # 2014-04-29 14:23:23 &lt;br /&gt;
  | t.register --o type=&amp;quot;rast&amp;quot; input=&amp;quot;cla&amp;quot;&lt;br /&gt;
  |     file=&amp;quot;map_list&amp;quot;&lt;br /&gt;
  | &lt;br /&gt;
  +----------------------------------------------------------------------------+&lt;br /&gt;
&lt;br /&gt;
Now, we get univariate statistics from the non-null cells for each registered raster map of the strds. For that matter we use [http://grass.osgeo.org/grass71/manuals/t.rast.univar.html t.rast.univar] which, by default, returns the name of the map, the start and end date of dataset and the following values: mean, minimum and maximum vale, mean_of_abs, standard deviation, variance, coeff_var, number of null cells, total number of cell.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.univar input=cla&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In Linux-based systems you can send the output to a text file using &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.univar input=cla &amp;gt; stats_cla&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 3. Listing maps and selections ===&lt;br /&gt;
&lt;br /&gt;
The module [http://grass.osgeo.org/grass71/manuals/t.rast.list.html t.rast.list] allows you to list registered maps of a strds and provides several options to achieve what you want. For example, you can select different granules and also perform different queries by means of the where parameter. Some examples are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.list input=cla method=gran granule=&amp;quot;1 month&amp;quot;&lt;br /&gt;
# this will give one image every one month, 3 months, 1 year, or whatever granule you choose&lt;br /&gt;
&lt;br /&gt;
t.rast.list input=cla order=min columns=id,name,start_time,min where=&amp;quot;min &amp;lt;= '0.05'&amp;quot; &lt;br /&gt;
# this will order by minimum value all the maps in the strds that have a minimum value lower than or equal to 0.05&lt;br /&gt;
&lt;br /&gt;
t.rast.list input=cla order=max columns=name,start_time,max where=&amp;quot;max &amp;gt; '10.0'&amp;quot;&lt;br /&gt;
# maps ordered by maximum value in which maximum value is higher than 10.&lt;br /&gt;
&lt;br /&gt;
t.rast.list input=cla where=&amp;quot;start_time &amp;gt;= '2003-01' and start_time &amp;lt;= '2003-06'&amp;quot; &lt;br /&gt;
# all the maps in the first 6 month of the time series&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the where parameter you can use sql datetime functions. Then, to get for example, all maps which start date is in January, we can do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.list input=cla where=&amp;quot;strftime('%m', start_time)='01'&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# or &lt;br /&gt;
&lt;br /&gt;
t.rast.list input=cla \&lt;br /&gt;
  where='start_time &amp;gt;= datetime(start_time, &amp;quot;start of year&amp;quot;) and start_time &amp;lt;= datetime(start_time, &amp;quot;start of year&amp;quot;, &amp;quot;1 month&amp;quot;)'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have monthly (instead of 8-day products) data and you want to list all January maps, then you can do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.list input=cla_orig where=&amp;quot;start_time=datetime(start_time, 'start of year', ' 0 month')&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 4. Visualization ===&lt;br /&gt;
&lt;br /&gt;
There are different visualization options for strds.&lt;br /&gt;
&lt;br /&gt;
* [http://grass.osgeo.org/grass71/manuals/g.gui.timeline.html g.gui.timeline] allows to compare temporal datasets by displaying their temporal extents in a plot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# only temporal extent&lt;br /&gt;
g.gui.timeline inputs=cla&lt;br /&gt;
# temporal and spatio-temporal extent&lt;br /&gt;
g.gui.timeline -3 inputs=cla&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:Cla strds.png|center|thumb|560px|Temporal and spatio-temporal extent of cla strds.]]&lt;br /&gt;
&lt;br /&gt;
* [http://grass.osgeo.org/grass71/manuals/g.gui.tplot.html g.gui.tplot] allows to see the values of one or more temporal datasets for a queried point defined by a coordinate pair.&lt;br /&gt;
&lt;br /&gt;
Steps to use this module are:&lt;br /&gt;
&lt;br /&gt;
# Select strds&lt;br /&gt;
# Select pair of coordinates (east,north) or point in the map&lt;br /&gt;
# Hit Run&lt;br /&gt;
# Customize as desired&lt;br /&gt;
# Save&lt;br /&gt;
&lt;br /&gt;
[[Image:Output gguitplot.png|center|thumb|800px|Time series plot (Chlorophyll vs Time) for a certain coordinate pair in the study area]]&lt;br /&gt;
&lt;br /&gt;
* [http://grass.osgeo.org/grass71/manuals/g.gui.animation.html g.gui.animation] is the tool for animating a series of raster and vector maps or a space time raster or vector dataset.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.gui.animation strds=cla&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 5. Aggregation ===&lt;br /&gt;
&lt;br /&gt;
For aggregations of data with different methods and different granularities, there are two very useful commands: &lt;br /&gt;
&lt;br /&gt;
* [http://grass.osgeo.org/grass71/manuals/t.rast.series.html t.rast.series] that performs different aggregation algorithms from r.series on all or a subset of raster maps in a strds, and &lt;br /&gt;
&lt;br /&gt;
* [http://grass.osgeo.org/grass71/manuals/t.rast.series.html t.rast.aggregate] that temporally aggregates the maps in a strds by a user defined granularity.&lt;br /&gt;
&lt;br /&gt;
With these modules it is very simple to get maps of basic statistical parameters for different temporal granules, and this permits the analysis of the spatio-temporal variability of the variable of interest.&lt;br /&gt;
&lt;br /&gt;
Some examples:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# yearly aggregation&lt;br /&gt;
t.rast.aggregate input=cla output=cla_yearly_average \&lt;br /&gt;
  base=cla_yearly_average granularity=&amp;quot;1 years&amp;quot; \&lt;br /&gt;
  method=average sampling=start&lt;br /&gt;
&lt;br /&gt;
# yearly aggregation with corresponding methods (output: 7 strds with 11 maps each)&lt;br /&gt;
for method in average median mode minimum maximum stddev range ; &lt;br /&gt;
do&lt;br /&gt;
t.rast.aggregate input=cla output=cla_yearly_${method} \&lt;br /&gt;
                 base=cla_yearly_${method} granularity=&amp;quot;1 years&amp;quot; \&lt;br /&gt;
                 method=${method} sampling=start&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
With the where parameter, we can select all 8-day products which start_time is 01 (January) over the years. Like this we can get the so-known climatologies. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.series input=cla method=average where=&amp;quot;strftime('%m', start_time)='01'&amp;quot; output=january_average&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Generalizing a bit, we can: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# climatologies for every month &lt;br /&gt;
for i in 01 02 03 04 05 06 07 08 09 10 11 12 ; do &lt;br /&gt;
  for m in average median mode stddev range minimum maximum ; do &lt;br /&gt;
    t.rast.series input=cla method=${m} where=&amp;quot;strftime('%m', start_time)='${i}'&amp;quot; output=${m}_${i}&lt;br /&gt;
  done&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using climatologies previously obtained, we'll now estimate monthly anomalies in the mean, max and min Cl-a concentration. First, we need to monthly aggregate data, and then do the difference between the monthly climatology and each respective monthly aggregate. We'll do the aggregation for the average, minimum and maximum of Cl-a concentration (from 506 input maps in&lt;br /&gt;
cla strds, we'll get 132 maps in each monthly aggregated new strds).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# monthly aggregates (132 maps)&lt;br /&gt;
&lt;br /&gt;
for method in average minimum maximum ; do&lt;br /&gt;
t.rast.aggregate input=cla output=cla_monthly_${method} base=cla_monthly_${method} \&lt;br /&gt;
  granularity=&amp;quot;1 months&amp;quot; method=${method} sampling=contains&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
# January anomalies in mean, min and max Cl-a&lt;br /&gt;
&lt;br /&gt;
t.rast.list -s input=cla_monthly_average where=&amp;quot;start_time=datetime(start_time, 'start of year', '0 month')&amp;quot; columns=name&lt;br /&gt;
&lt;br /&gt;
for m in average minimum maximum ; do &lt;br /&gt;
  for i in 1 13 25 37 49 61 73 85 97 109 121 ; do # these numbers correspond to all january monthly aggregates&lt;br /&gt;
    r.mapcalc expression=&amp;quot;Jan_${m}_anomaly_${i}=cla_monthly_${m}_${i}-01_${m}&amp;quot; &lt;br /&gt;
  done&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can also use t.rast.list for looping, the same way you use [http://grass.osgeo.org/grass71/manuals/g.list.html g.list]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
for map in `t.rast.list -s input=cla_monthly_average where=&amp;quot;start_time=datetime(start_time, 'start of year', '0 month')&amp;quot; columns=name`; &lt;br /&gt;
do&lt;br /&gt;
r.mapcalc expression=&amp;quot;anomaly_${map}=${map}-01_average&amp;quot; &lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Say we now need to know the date of the maximum value of Cl-a concentration over all the study period and/or on a yearly basis:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# map index for the overall maximum Cl-a value &lt;br /&gt;
t.rast.series input=cla method=max_raster output=cla_max_index&lt;br /&gt;
&lt;br /&gt;
# map index for the yearly maximum Cl-a value &lt;br /&gt;
t.rast.aggregate input=cla granularity=&amp;quot;1 year&amp;quot; method=max_raster output=yearly_max_index basename=yearly_max_index&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The outputs show (pixelwise) the map index in which the maximum value of Cl-a occurs (from 1 to 506 and from 1 to 46, for the whole time series and on a yearly basis, respectively). For relative time this is maybe enough, but you may then want to reclassify data to get DOY, for example. In that case, you may use [http://grass.osgeo.org/grass71/manuals/r.reclass.html r.reclass].&lt;br /&gt;
&lt;br /&gt;
If you already have monthly data, you can get climatologies quite simply as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# January averages&lt;br /&gt;
t.rast.series input=cla_monthly method=average where=start_time=datetime(start_time, 'start of year', '0 month') output=jan_average&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 6. Spatio-temporal algebra with STRDS ===&lt;br /&gt;
&lt;br /&gt;
The module [http://grass.osgeo.org/grass71/manuals/t.rast.mapcalc.html t.rast.mapcalc] allows us to perform spatio-temporal mapcalc expressions on temporally sampled maps of strds. There are spatial and temporal operators available for the &amp;quot;expression&amp;quot; string. Spatial operators, functions and internal variables are those used in [http://grass.osgeo.org/grass71/manuals/r.mapcalc.html r.mapcalc]. Temporal internal variables supported for both relative and absolute time include: td(), start_time() and end_time(). There are also several very useful internal variables supported especially for absolute time of the current sample interval or instance, e.g.: start_doy(), start_year(), start_month() and so on (see [http://grass.osgeo.org/grass71/manuals/t.rast.mapcalc.html t.rast.mapcalc] manual site for further details and examples).&lt;br /&gt;
&lt;br /&gt;
Some examples now. Say we did some analysis and decided that we will only consider values higher than 0.05. Then, we need to set all values below that threshold to null.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.mapcalc input=cla expression=&amp;quot;if(cla &amp;lt; 0.05, null(), cla)&amp;quot; output=cla_corrected  basename=cla_corrected&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or we may also want to take negative erroneous values to the knowm minimum of the strds, so:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.series input=cla method=minimum output=min_cla&lt;br /&gt;
t.rast.mapcalc input=cla expression=&amp;quot;if(cla &amp;lt; 0.0, min_cla, cla)&amp;quot; output=cla_corrected  basename=cla_corrected&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We may also need to reclassify all maps in the strds according to a certain threshold, e.g.: a certain level of Cl-a that indicates bloom conditions, in order to get bloom frequency afterwards:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# reclassify&lt;br /&gt;
t.rast.mapcalc -n input=cla output=cla_bloom basename=cla_bloom expression=&amp;quot;if(cla &amp;gt; 0.75, 1, null())&amp;quot;&lt;br /&gt;
# bloom frequency&lt;br /&gt;
t.rast.series input=cla_bloom output=bloom_freq method=count&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Do you remember we wanted to get the DOY of maximum Cl-a value before? Well, here's another way of doing it... &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# overall maximum value&lt;br /&gt;
t.rast.series input=cla method=maximum output=max_cla&lt;br /&gt;
# new strds with DOY of overall maximum &lt;br /&gt;
t.rast.mapcalc -n inputs=cla output=date_max_cla expression=&amp;quot;if(cla == max_cla,start_doy(),null())&amp;quot; basename=date_max_cla &lt;br /&gt;
# map with DOY of overall maximum&lt;br /&gt;
t.rast.series input=date_max_cla method=maximum output=max_cla_date&lt;br /&gt;
# remove date_max_cla strds (we were only interested in the resulting aggregated map)&lt;br /&gt;
t.remove -rf inputs=date_max_cla &lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the development version of GRASS GIS, there's also a [http://grass.osgeo.org/grass71/manuals/t.rast.mapcalc2.html t.rast.mapcalc2] module that allows for temporal and spatial operations on strds by means of temporal raster algebra. The module expects an expression as input parameter in the following form: &lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;result = expression&amp;quot;'''&lt;br /&gt;
&lt;br /&gt;
The statement structure is similar to r.mapcalc, the result is the name of a new strds that will contain the result of the calculation given as expression. Expressions can be any valid or nested combination of temporal operations and spatial overlay or buffer functions that are provided by the temporal algebra. See the manual for further details and explanations.&lt;br /&gt;
&lt;br /&gt;
We'll use this module to estimate the rate of change (slope) between every pair of maps in the &amp;quot;cla&amp;quot; strds. The result will be a new strds consisting of maps with the slope value between every consecutive pair of maps in the original strds&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.mapcalc2 expression=&amp;quot;slope_cla = (cla[1]-cla[0])/8.0&amp;quot; basename=slope_cla&lt;br /&gt;
# we set 8 as fixed denominator, because products are 8-day compositions&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
we can then use any of the aggregation modules that we saw before to get the maximum or minimumm rate of change for different granularities.&lt;br /&gt;
&lt;br /&gt;
=== 7. Subseting and something else ===&lt;br /&gt;
&lt;br /&gt;
[http://grass.osgeo.org/grass71/manuals/t.rast.extract.html t.rast.extract] is another really useful module in temporal GRASS. It allows to extract a subset of a strds and store it in a different strds. You use the &amp;quot;where&amp;quot; condition to do the subset, but you can also specify a r.mapcalc sub-expression that performs operations on all maps of the selected subset. If no r.mapcalc expression is defined, the selected maps are simply registered in the new output strds.&lt;br /&gt;
&lt;br /&gt;
Say we need to need to know in how many maps of the strds min values are below a threshold, and not only that, but you also want to know how many pixels per map meet that condition. Then, we can do&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.extract input=cla where=&amp;quot;min &amp;lt;= '0.05'&amp;quot; output=cla_less_05 basename=cla_less_05 expression=&amp;quot;if(cla&amp;lt;0.05,1,null())&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to extract those maps with a minimum value lower than 0.05, and in the same step put 1 in every cell meeting the criterium and null everywhere else. To get a count of maps and pixels meeting the condition we may use:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# univariate stistics to get the count per map  &lt;br /&gt;
t.rast.univar input=cla_less_05 &lt;br /&gt;
# count map of cells with min value &amp;lt; 0.05&lt;br /&gt;
t.rast.series input=cla_less_05 output=count_cla_less_05 method=count&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 8. Importing / Exporting strds ===&lt;br /&gt;
&lt;br /&gt;
Say we now need to do some processing in R (e.g.: run [http://menugget.blogspot.com.ar/2012/10/dineof-data-interpolating-empirical.html DINEOF] to fill gaps in data), so we need to export our strds, hence we use [http://grass.osgeo.org/grass71/manuals/t.rast.export.html t.rast.export]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.export input=cla output=cla4R compression=gzip&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After we have done our analysis we can import the whole strds back to GRASS again, exporting it from R with read/write.tgrass from [http://cran.r-project.org/web/packages/spacetime/index.html spacetime] R package and using [http://grass.osgeo.org/grass71/manuals/t.rast.import.html t.rast.import] in GRASS. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.import input=cla_from_R.tar.gz output=cla_from_R base=new_map extrdir=/tmp&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 9. Neighborhood analysis ===&lt;br /&gt;
&lt;br /&gt;
[http://grass.osgeo.org/grass71/manuals/t.rast.neighbors.html t.rast.neighbors] performs a neighborhood analysis for each map in a space time raster dataset. This module supports a subset of the options already available in r.neighbors. Both, size of the neighborhood and aggregation method can be chosen. As an example, we'll estimate mean Cl-a concentration in a 3x3 neighborhood for every map in the strds.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.neighbors input=cla output=cla_smoth base=cla_smooth method=average size=3&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 10. Filling and reconstructing gappy data - HANTS ===&lt;br /&gt;
&lt;br /&gt;
[http://grass.osgeo.org/grass70/manuals/addons/r.hants.html r.hants] is an add-on not strictly within the temporal modules, but really useful when working with this kind of data, particularly with gappy data. Here's a simple example for generating a list of temporally oredered maps to use as input in r.hants, running HANTS and getting a map of dominant frequencies, afterwards. See the manual for further information on paramenter setting and explanations. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# use t.rast.list to create a list of temporally ordered maps  &lt;br /&gt;
t.rast.list input=cla order=start_time columns=name -s &amp;gt; map_list&lt;br /&gt;
&lt;br /&gt;
# a hants run&lt;br /&gt;
r.hants file=map_list nf=5 fet=0.1 dod=11 base_period=46 suffix=_hants amplitude=amp_hants phase=pha_hants&lt;br /&gt;
&lt;br /&gt;
# dominant frequency map (0 means the dominant freq is 1, 1 that dominant freq is 2, and so on...)&lt;br /&gt;
r.series input=`g.list rast pat=amp_hants* sep=,` output=dominant_freq_hants method=max_raster&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 11. TODO ===&lt;br /&gt;
&lt;br /&gt;
(add some more)&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
=== Aggregation with defined granularity ===&lt;br /&gt;
&lt;br /&gt;
''Q: I need to aggregate a strds with a granularity of 1 year, but shifting the start day one month in each run, i.e.: changing the start_time to 2003-02-01, 2003-03-01, 2003-04-01 and so on... My question is: if i recursively change start_time with the 'where' parameter, will the module t.rast.aggregate &amp;quot;aggregate&amp;quot; to the next february, march, april (what i'd wish) or just till the end of 2003?''&lt;br /&gt;
&lt;br /&gt;
A: If you specify a granularity of a year, then the start time to perform the aggregation will always be shifted to the 1st January of the current year and the end time the 1st January of the next year (eg. 2002-01-01 - 2003-01-01).  If you wish to aggregate a full year but shifting one month forward then simply use a granularity of 12 months.&lt;br /&gt;
&lt;br /&gt;
=== Listing maps with specific start month ===&lt;br /&gt;
&lt;br /&gt;
''Q: I have a strds with 506 maps that correspond to 8-day composite products. I need to sequentially list all maps which &amp;quot;start_month&amp;quot; is January, February and so on... to use them as input in {{cmd|r.series|version=70}} (or {{cmd|t.rast.series|version=70}}). How can I achieve that?''&lt;br /&gt;
&lt;br /&gt;
A: You can use the [https://www.sqlite.org/lang_datefunc.html datetime functionality of SQLite] to perform this task, this should work for January:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
t.rast.list input=cla_null_mayor65 \&lt;br /&gt;
  where='start_time &amp;gt;= datetime(start_time, &amp;quot;start of year&amp;quot;) and&lt;br /&gt;
  start_time &amp;lt;= datetime(start_time, &amp;quot;start of year&amp;quot;, &amp;quot;1 month&amp;quot;)'&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Expert tricks ==&lt;br /&gt;
&lt;br /&gt;
BE CAREFUL. THIS IS NOT RECOMMENDED TO NEW USERS.&lt;br /&gt;
&lt;br /&gt;
=== Creating a TGRASS DB with data from a different mapset ===&lt;br /&gt;
&lt;br /&gt;
TGRASS is designed to only work with data present in the current mapset.&lt;br /&gt;
An '''expert user''' may override this in order to register data from another mapset in his/her TGRASS database.&lt;br /&gt;
&lt;br /&gt;
To achieve this, the following two internal variables must be set:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
g.gisenv set=&amp;quot;TGIS_DISABLE_MAPSET_CHECK=True&amp;quot;&lt;br /&gt;
g.gisenv set=&amp;quot;TGIS_DISABLE_TIMESTAMP_WRITE=True&amp;quot;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
in order to disable the mapset check and the writing of the timestamps of each map to the map metadata in the spatial database as text files. These variables can be set mapset specific.&lt;br /&gt;
&lt;br /&gt;
Settings these variables &amp;quot;True&amp;quot; should (hopefully, because yet partially untested) allow the registration of maps outside the current mapset, even if you do not have the permission to modify the maps.&lt;br /&gt;
&lt;br /&gt;
A warning will be printed if these variables are set True.&lt;br /&gt;
&lt;br /&gt;
BUT, be aware that this feature '''can lead to the corruption of the temporal database''' and unwanted side effects. You can mess up the temporal database if you are not 100% sure what you are doing. It is no longer possible to access the timestamp information of these maps using the C-libraries, because the timestamp information is not available in the map metadata text files.&lt;br /&gt;
&lt;br /&gt;
=== More expert tricks ===&lt;br /&gt;
&lt;br /&gt;
Perhaps to be added...&lt;br /&gt;
&lt;br /&gt;
== Online tutorials and courses ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.geostat-course.org/Topic_Gebbert The temporal GRASS GIS framework: Introduction and application] by Soeren Gebbert (2012)&lt;br /&gt;
* [http://fatra.cnr.ncsu.edu/temporal-grass-workshop/ Spatio-temporal data handling and visualization in GRASS GIS] - FOSS4G 2014 workshop by Vaclav Petras, Anna Petrasova, Helena Mitasova, Markus Neteler&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
* Gebbert, S., Pebesma, E., 2014. ''TGRASS: A temporal GIS for field based environmental modeling''. Environmental Modelling &amp;amp; Software 53, 1-12 (http://dx.doi.org/10.1016/j.envsoft.2013.11.001 DOI])&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* Introduction: [http://www.slideshare.net/Luis_de_Sousa/presentation-soeren GRASS as a Temporal GIS] by Sören Gebbert (slides)&lt;br /&gt;
* [http://grass.osgeo.org/grass70/manuals/temporalintro.html Introduction to temporal modules] (GRASS GIS manual)&lt;br /&gt;
* [http://grass.osgeo.org/grass70/manuals/temporal.html Available temporal modules] (GRASS GIS manual)&lt;br /&gt;
* [http://trac.osgeo.org/grass/wiki/Grass7/TemporalExtension Temporal Extension] (background info in trac)&lt;br /&gt;
* [[GRASS GSoC 2013 Temporal GIS Algebra for raster and vector data in GRASS]]&lt;br /&gt;
&lt;br /&gt;
[[Category: Documentation]]&lt;br /&gt;
[[Category:Temporal]]&lt;/div&gt;</summary>
		<author><name>⚠️Matmar</name></author>
	</entry>
</feed>