t.rast.extract(1)
π t.rast.extract β GRASS GIS User's Manual π
okay bestie, buckle up, because this is t.rast.extract from the GRASS GIS 8.4.2 manual and it is so much more chill than it sounds. it's giving "I just want a lil slice of my giant time-series" energy and honestly? relatable. π
β¨ NAME β¨
t.rast.extract β Extracts a subset of a space time raster datasets.
(no, the grammar isn't perfect, but the vibes are immaculate and the facts are the facts, so we're keeping it exactly as the manual says it π )
π KEYWORDS π
temporal, extract, raster, time
πΈ SYNOPSIS πΈ
t.rast.extract
t.rast.extract --help
t.rast.extract [-n] input=name [where=sql_query] [expression=string]
output=name [basename=string] [suffix=string] [nprocs=integer]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π¦ Flags π¦
-nβ Register Null maps. like, actually put the null ones in there, bestie.--overwriteβ Allow output files to overwrite existing files--helpβ Print usage summary--verboseβ Verbose module output--quietβ Quiet module output--uiβ Force launching GUI dialog
π Parameters π
input=name[required] β Name of the input space time raster dataset. this is the STRDS you're slicing up, no cap.where=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. your shiny new baby STRDS goes here β¨basename=stringβ Basename of the new generated output maps A numerical suffix separated by an underscore will be attached to create a unique identifiersuffix=stringβ 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 π
So the whole purpose of t.rast.extract, bestie, is to extract a subset of a space time raster dataset and to store that subset in a different space time raster dataset. That's it. That's the gig. π
The where condition is what picks your subset β that's your filter, your vibe check, your "only the maps I want please."
On top of that, 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? sure, go off. π
In case a r.mapcalc sub-expression is defined, the base name of the resulting raster maps must be specified. (mandatory. non-negotiable. the girlies need names.) 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. The number of parallel GRASS GIS processes can be specified to speed up the processing β that's your nprocs, and parallel processing is lowkey iconic for big jobs. π₯
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. efficient queen behaviour, 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)"
so real talk: left side = π«, right side only = β . don't come for me, that's literally what the manual says. π
π 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 those twelve little monthly tempmeans living their best lives in a fresh STRDS. ate and left no crumbs. π§π
πΈ SEE ALSO πΈ
t.createt.info
(go read those too, bestie, iykyk π«Ά)
π AUTHOR π
SΓΆren Gebbert, ThΓΌnen Institute of Climate-Smart Agriculture
π SOURCE CODE π
Available at: t.rast.extract source code (history)
Accessed: Saturday Jan 17 05:41:53 2026
Main index | Temporal index | Topics index | Keywords index | Graphical index | Full index
Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual
okay that's the whole page!! π big thank you to the GRASS Development Team for the 2003β2025 copyright and this GRASS GIS 8.4.2 Reference Manual, accessed Saturday Jan 17 05:41:53 2026 β and yes, t.rast.extract(1) is the manual page we just devoured, mwah π go extract something cute, you've got this. β¨π¦π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· 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