t.rast.aggregate(1)

๐Ÿ’– t.rast.aggregate ๐Ÿ’–

GRASS GIS User's Manual โ€” yes bestie, it's a t.rast.aggregate(1) situation and we're gonna get through it together ๐Ÿซถ

โœจ NAME โœจ

t.rast.aggregate โ€” it temporally aggregates the maps of a space time raster dataset, and it does it by a granularity you define. You're the main character here, you pick the vibe. ๐Ÿ‘‘


๐ŸŒธ KEYWORDS ๐ŸŒธ

temporal, aggregation, raster, time


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

t.rast.aggregate
t.rast.aggregate --help
t.rast.aggregate [-n] input=name output=name basename=string
[suffix=string]  granularity=string method=string  [offset=integer]
[nprocs=integer]   [file_limit=integer]   [sampling=name[,name,...]]
[where=sql_query]   [--overwrite]  [--help]  [--verbose]  [--quiet]
[--ui]

Flags ๐ŸŽ€

  • -n โ€” Register Null maps. like, register them, even the empty ones. no gatekeeping ๐Ÿ’…
  • --overwrite โ€” Allow output files to overwrite existing files. chaotic but she said yes ๐Ÿ”ฅ
  • --help โ€” Print usage summary. the classic "what do I do" button, we've all been there ๐Ÿ˜ญ
  • --verbose โ€” Verbose module output. she's TALKING now ๐Ÿ’ฌ
  • --quiet โ€” Quiet module output. she's giving nothing and honestly? valid ๐Ÿคซ
  • --ui โ€” Force launching GUI dialog. for when clicking > typing โœจ

Parameters ๐Ÿ“

  • input=name [required] โ€” Name of the input space time raster dataset. your source material, your origin story ๐ŸŒˆ
  • output=name [required] โ€” Name of the output space time raster dataset. the glow-up destination ๐Ÿ’–
  • basename=string [required] โ€” Basename of the new generated output maps. Either a numerical suffix or the start time (s-flag) separated by an underscore will be attached to create a unique identifier. so like, basename + _ + something = unique name, iykyk ๐Ÿท๏ธ
  • suffix=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: gran. it's giving personalization โœจ
  • granularity=string [required] โ€” Aggregation granularity, format absolute time "x years, x months, x weeks, x days, x hours, x minutes, x seconds" or an integer value for relative time. how big is your chunk bestie โณ
  • method=string [required] โ€” Aggregate operation to be performed on the raster maps. Options: average, count, median, mode, minimum, min_raster, maximum, max_raster, stddev, range, sum, variance, diversity, slope, offset, detcoeff, quart1, quart3, perc90, quantile, skewness, kurtosis. Default: average. literally 22 ways to serve cunt, choose one ๐Ÿงฎ
  • offset=integer โ€” Offset that is used to create the output map ids, output map id is generated as: basename_ (count + offset). Default: 0. the little head start ๐Ÿš€
  • nprocs=integer โ€” Number of r.series processes to run in parallel. Default: 1. multitasking queen ๐Ÿ‘‘
  • file_limit=integer โ€” The maximum number of open files allowed for each r.series process. Default: 1000. that's a LOT of files open at once, no cap ๐Ÿ“‚
  • sampling=name[,name,...] โ€” The method to be used for sampling the input dataset. Options: equal, overlaps, overlapped, starts, started, finishes, finished, during, contains. Default: contains. it's giving relationship status between your intervals and your maps ๐Ÿ’ž
  • 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'. filtering the timeline, periodt ๐Ÿ•ฐ๏ธ

๐Ÿ’œ DESCRIPTION ๐Ÿ’œ

t.rast.aggregate temporally aggregates space time raster datasets by a specific temporal granularity. She supports absolute and relative time, because why limit yourself.

For absolute time, the temporal granularity can be seconds, minutes, hours, days, weeks, months or years. Mixing granularities, eg. "1 year, 3 months 5 days", is not supported โ€” pick one lane bestie, we don't do mashups here ๐Ÿšซ

In case of relative time, the temporal unit of the input space time raster dataset is used. The granularity must be specified with an integer value.

This module is sensitive to the current region and mask settings, hence spatial extent and spatial resolution. In case the registered raster maps of the input space time raster dataset have different spatial resolutions, the default nearest neighbor resampling method is used for runtime spatial aggregation. (she's picking the nearest neighbor because she's loyal ๐Ÿฅฐ)


๐ŸŒˆ NOTES ๐ŸŒˆ

The raster module r.series is used internally. Hence all aggregate methods of r.series are supported. See the r.series manual page for details. (go read it, she's iconic too ๐Ÿ’…)

This module will shift the start date for each aggregation process depending on the provided temporal granularity. The following shifts will be performed:

  • granularity years: will start at the first of January, hence 14-08-2012 00:01:30 will be shifted to 01-01-2012 00:00:00
  • granularity months: will start at the first day of a month, hence 14-08-2012 will be shifted to 01-08-2012 00:00:00
  • granularity weeks: will start at the first day of a week (Monday), hence 14-08-2012 01:30:30 will be shifted to 13-08-2012 01:00:00
  • granularity days: will start at the first hour of a day, hence 14-08-2012 00:01:30 will be shifted to 14-08-2012 00:00:00
  • granularity hours: will start at the first minute of a hour, hence 14-08-2012 01:30:30 will be shifted to 14-08-2012 01:00:00
  • granularity minutes: will start at the first second of a minute, hence 14-08-2012 01:30:30 will be shifted to 14-08-2012 01:30:00

The specification of the temporal relation between the aggregation intervals and the raster map layers is always formulated from the aggregation interval viewpoint. Hence, the relation contains has to be specified to aggregate map layer that are temporally located in an aggregation interval. it's about perspective bestie, always has been ๐Ÿ™ˆ

Parallel processing is supported in case that more than one interval is available for aggregation computation. Internally several r.series modules will be started, depending on the number of specified parallel processes (nprocs) and the number of intervals to aggregate. she's running the whole group chat at once ๐Ÿ”ฅ


๐Ÿ’– EXAMPLES ๐Ÿ’–


๐ŸŒธ Aggregation of monthly data into yearly data ๐ŸŒธ

okay bestie so picture this: you got monthly data and you want yearly data. iconic. here's the glow-up:

t.rast.aggregate input=tempmean_monthly output=tempmean_yearly \
                 basename=tempmean_year \
                 granularity="1 years" method=average

then you gotta give it a lil title and description, because unlabeled datasets are giving chaos:

t.support input=tempmean_yearly \
          title="Yearly precipitation" \
          description="Aggregated precipitation dataset with yearly resolution"

and then t.info tempmean_yearly to see what you cooked:

 +-------------------- Space Time Raster Dataset -----------------------------+
 |                                                                            |
 +-------------------- Basic information -------------------------------------+
 | Id: ........................ tempmean_yearly@climate_2000_2012
 | Name: ...................... tempmean_yearly
 | Mapset: .................... climate_2000_2012
 | Creator: ................... lucadelu
 | Temporal type: ............. absolute
 | Creation time: ............. 2014-11-27 10:25:21.243319
 | Modification time:.......... 2014-11-27 10:25:21.862136
 | Semantic type:.............. mean
 +-------------------- Absolute time -----------------------------------------+
 | Start time:................. 2009-01-01 00:00:00
 | End time:................... 2013-01-01 00:00:00
 | Granularity:................ 1 year
 | Temporal type of maps:...... interval
 +-------------------- Spatial extent ----------------------------------------+
 | North:...................... 320000.0
 | South:...................... 10000.0
 | East:.. .................... 935000.0
 | West:....................... 120000.0
 | Top:........................ 0.0
 | Bottom:..................... 0.0
 +-------------------- Metadata information ----------------------------------+
 | Raster register table:...... raster_map_register_514082e62e864522a13c8123d1949dea
 | North-South resolution min:. 500.0
 | North-South resolution max:. 500.0
 | East-west resolution min:... 500.0
 | East-west resolution max:... 500.0
 | Minimum value min:.......... 7.370747
 | Minimum value max:.......... 8.81603
 | Maximum value min:.......... 17.111387
 | Maximum value max:.......... 17.915511
 | Aggregation type:........... average
 | Number of registered maps:.. 4
 |
 | Title: Yearly precipitation
 | Monthly precipitation
 | Description: Aggregated precipitation dataset with yearly resolution
 | Dataset with monthly precipitation
 | Command history:
 | # 2014-11-27 10:25:21
 | t.rast.aggregate input="tempmean_monthly"
 |     output="tempmean_yearly" basename="tempmean_year" granularity="1 years"
 |     method="average"
 |
 | # 2014-11-27 10:26:21
 | t.support input=tempmean_yearly \
 |        title="Yearly precipitation" \
 |        description="Aggregated precipitation dataset with yearly resolution"
 +----------------------------------------------------------------------------+

look at that. chef's kiss. ๐Ÿ’…


๐Ÿฆ‹ Different aggregations and map name suffix variants ๐Ÿฆ‹

here's the tea on naming: when you use the suffix option, your output map names get a lil extra something depending on the aggregation. examples below, no cap.


โœจ Weekly aggregation โœจ

t.rast.aggregate input=daily_temp output=weekly_avg_temp \
  basename=weekly_avg_temp method=average granularity="1 weeks"
t.rast.list weekly_avg_temp
name|mapset|start_time|end_time
weekly_avg_temp_2003_01|climate|2003-01-03 00:00:00|2003-01-10 00:00:00
weekly_avg_temp_2003_02|climate|2003-01-10 00:00:00|2003-01-17 00:00:00
weekly_avg_temp_2003_03|climate|2003-01-17 00:00:00|2003-01-24 00:00:00
weekly_avg_temp_2003_04|climate|2003-01-24 00:00:00|2003-01-31 00:00:00
weekly_avg_temp_2003_05|climate|2003-01-31 00:00:00|2003-02-07 00:00:00
weekly_avg_temp_2003_06|climate|2003-02-07 00:00:00|2003-02-14 00:00:00
weekly_avg_temp_2003_07|climate|2003-02-14 00:00:00|2003-02-21 00:00:00

Variant with suffix set to gran:

t.rast.aggregate input=daily_temp output=weekly_avg_temp \
  basename=weekly_avg_temp suffix=gran method=average \
  granularity="1 weeks"
t.rast.list weekly_avg_temp
name|mapset|start_time|end_time
weekly_avg_temp_2003_01_03|climate|2003-01-03 00:00:00|2003-01-10 00:00:00
weekly_avg_temp_2003_01_10|climate|2003-01-10 00:00:00|2003-01-17 00:00:00
weekly_avg_temp_2003_01_17|climate|2003-01-17 00:00:00|2003-01-24 00:00:00
weekly_avg_temp_2003_01_24|climate|2003-01-24 00:00:00|2003-01-31 00:00:00
weekly_avg_temp_2003_01_31|climate|2003-01-31 00:00:00|2003-02-07 00:00:00
weekly_avg_temp_2003_02_07|climate|2003-02-07 00:00:00|2003-02-14 00:00:00
weekly_avg_temp_2003_02_14|climate|2003-02-14 00:00:00|2003-02-21 00:00:00

see how the suffix swaps the week-counter for the actual start date? the way that it just knows ๐Ÿ˜ญ


๐ŸŒˆ Monthly aggregation ๐ŸŒˆ

t.rast.aggregate input=daily_temp output=monthly_avg_temp \
  basename=monthly_avg_temp suffix=gran method=average \
  granularity="1 months"
t.rast.list monthly_avg_temp
name|mapset|start_time|end_time
monthly_avg_temp_2003_01|climate|2003-01-01 00:00:00|2003-02-01 00:00:00
monthly_avg_temp_2003_02|climate|2003-02-01 00:00:00|2003-03-01 00:00:00
monthly_avg_temp_2003_03|climate|2003-03-01 00:00:00|2003-04-01 00:00:00
monthly_avg_temp_2003_04|climate|2003-04-01 00:00:00|2003-05-01 00:00:00
monthly_avg_temp_2003_05|climate|2003-05-01 00:00:00|2003-06-01 00:00:00
monthly_avg_temp_2003_06|climate|2003-06-01 00:00:00|2003-07-01 00:00:00

โญ Yearly aggregation โญ

t.rast.aggregate input=daily_temp output=yearly_avg_temp \
  basename=yearly_avg_temp suffix=gran method=average \
  granularity="1 years"
t.rast.list yearly_avg_temp
name|mapset|start_time|end_time
yearly_avg_temp_2003|climate|2003-01-01 00:00:00|2004-01-01 00:00:00
yearly_avg_temp_2004|climate|2004-01-01 00:00:00|2005-01-01 00:00:00

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

go read these next bestie, they're all part of the same friend group:

  • t.rast.aggregate.ds
  • t.rast.extract
  • t.info
  • r.series
  • g.region
  • r.mask

also the Temporal data processing Wiki โ€” iykyk ๐Ÿ’–


๐Ÿซถ AUTHOR ๐Ÿซถ

Sรถren Gebbert, Thรผnen Institute of Climate-Smart Agriculture

give them their flowers, fr fr ๐ŸŒธ


๐ŸŽ€ SOURCE CODE ๐ŸŽ€

available at: t.rast.aggregate 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


and that's the whole page, bestie!! โœจ this lil masterpiece lives in GRASS 8.4.2 and was pulled from the reference manual, accessed on Saturday Jan 17 05:41:53 2026. go forth and aggregate, you absolute icon ๐Ÿ‘‘๐Ÿ’œ

๐Ÿ“ฆ where this page comes from