t.rast.extract(1grass)
β¨ t.rast.extract β¨
okay bestie, welcome to the t.rast.extract manual page from the GRASS User's Manual π this is the little tool that pulls a subset out of a space time raster dataset and drops it into a whole new one. temporal, extract, raster, time β that's the whole vibe. let's get into it π¦
πΈ SYNOPSIS πΈ
t.rast.extract
t.rast.extract --help
t.rast.extract [-n] input=name [where=sql_query] [expression=string]
output=name [basename=string] [suffix=name] [nprocs=integer]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π Flags π
so these are the switches, the toggles, the little slays π
-nβ Register Null maps π like yes, let the null maps in too, they're part of the story--overwriteβ Allow output files to overwrite existing files (chaotic? maybe. useful? absolutely π)--helpβ Print usage summary--verboseβ Verbose module output (she's chatty, we love that)--quietβ Quiet module output (she's mysterious, we also love that)--uiβ Force launching GUI dialog
π Parameters π
input=name[required] β Name of the input space time raster dataset. this is the STRDS you're extracting from, no capwhere=sql_queryβ WHERE conditions of SQL statement without 'where' keyword used in the temporal GIS framework. Example:start_time > β2001-01-01 12:30:00βexpression=stringβr.mapcalcexpression assigned to all extracted raster mapsoutput=name[required] β Name of the output space time raster dataset. the new baby STRDS β¨basename=stringβ Basename of the new generated output maps. A numerical suffix separated by an underscore will be attached to create a unique identifiersuffix=nameβ Suffix to add at basename: setβgranβfor granularity,βtimeβfor the full time format,βnumβfor numerical suffix with a specific number of digits (default%%05). Default:grannprocs=integerβ Number ofr.mapcalcprocesses to run in parallel. Default:1
π DESCRIPTION π
The purpose of t.rast.extract is to extract a subset of a space time raster dataset and to store that subset in a different space time raster dataset. π«Ά
The where condition is used to select the subset. In addition a r.mapcalc sub-expression can be specified that performs operations on all maps of the selected subset.
In this expression the name of the input space time raster dataset can be used as simple map name. Other STRDS than the input STRDS can not be specified, but any raster map. π¨ important, bestie
In case a r.mapcalc sub-expression is defined, the base name of the resulting raster maps must be specified.
The r.mapcalc expression can be used to select maps as well, since by default resulting empty maps are not registered in the output space time raster dataset and removed after processing. π empty maps get ghosted, literally
The number of parallel GRASS processes can be specified to speed up the processing. β‘
If no r.mapcalc expression is defined, the selected maps are simply registered in the new created output space time raster dataset to avoid data duplication. iconic behavior honestly π
β NOTES β
The r.mapcalc sub-expression should not contain the left side "map =" of a full r.mapcalc expression, only the right side, eg.:
t.rast.extract input=tempmean_monthly where="start_time > β2010-01-05β" output=selected_tempmean_monthly basename=new_tmean_month expression="if(tempmean_monthly < 0, null(), tempmean_monthly)"
like pls don't hand her the whole equation, she only wants the right half. she's got the map = part handled herself π
π¦ EXAMPLE π¦
t.rast.extract input=tempmean_monthly output=tempmean_monthly_later_2012 where="start_time >= β2012-01-01β"
t.rast.list tempmean_monthly_later_2012
name|mapset|start_time|end_time
2012_01_tempmean|climate_2000_2012|2012-01-01 00:00:00|2012-02-01 00:00:00
2012_02_tempmean|climate_2000_2012|2012-02-01 00:00:00|2012-03-01 00:00:00
2012_03_tempmean|climate_2000_2012|2012-03-01 00:00:00|2012-04-01 00:00:00
2012_04_tempmean|climate_2000_2012|2012-04-01 00:00:00|2012-05-01 00:00:00
2012_05_tempmean|climate_2000_2012|2012-05-01 00:00:00|2012-06-01 00:00:00
2012_06_tempmean|climate_2000_2012|2012-06-01 00:00:00|2012-07-01 00:00:00
2012_07_tempmean|climate_2000_2012|2012-07-01 00:00:00|2012-08-01 00:00:00
2012_08_tempmean|climate_2000_2012|2012-08-01 00:00:00|2012-09-01 00:00:00
2012_09_tempmean|climate_2000_2012|2012-09-01 00:00:00|2012-10-01 00:00:00
2012_10_tempmean|climate_2000_2012|2012-10-01 00:00:00|2012-11-01 00:00:00
2012_11_tempmean|climate_2000_2012|2012-11-01 00:00:00|2012-12-01 00:00:00
2012_12_tempmean|climate_2000_2012|2012-12-01 00:00:00|2013-01-01 00:00:00
look at that gorgeous clean table π she extracted exactly the 2012 maps and registered every single one. periodt.
π SEE ALSO π
t.create,t.info
π AUTHOR π
SΓΆren Gebbert, ThΓΌnen Institute of Climate-Smart Agriculture
π SOURCE CODE π
Available at: t.rast.extract source code (history)
Latest change: Tuesday Jan 27 12:40:13 2026 in commit: 5e8b13d47dd4fc81efa5abefe90c34f7a8291fb9
Main index | Temporal index | Topics index | Keywords index | Graphical index | Full index
okay that's the whole page bestie, you're officially educated πππ SOURCE CODE check, commit check, GRASS 8.5.0 Reference Manual, Β© 2003-2026 GRASS Development Team, and this whole thing is running on GRASS 8.5.0 β go forth and extract, you absolute icon πβ¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms