t.rast.neighbors(1)
β¨ t.rast.neighbors β¨ (that's the t.rast.neighbors(1) page from the GRASS GIS User's Manual, bestie π)
okay so welcome to the glow-up zone πΈ this page lives in the GRASS GIS User's Manual and it's all about doing neighborhood analysis on every map inside a space time raster dataset. yes queen, temporal raster drama, we love to see it π
π« NAME π«
t.rast.neighbors β runs a neighborhood analysis on each map in a space time raster dataset. every single one. no map left behind π«Ά
π·οΈ KEYWORDS π·οΈ
temporal, aggregation, raster, time
π SYNOPSIS π
t.rast.neighbors
t.rast.neighbors --help
t.rast.neighbors [-nr] input=name output=name [where=sql_query]
[size=integer] method=string basename=string [suffix=string]
[semantic_labels=string] [nprocs=integer] [--overwrite] [--help]
[--verbose] [--quiet] [--ui]
π© Flags π©
-nβ Register Null maps. like, register them. that's the vibe.-rβ Ignore the current region settings and use the raster map regions instead. going rogue with the regions, iconic tbh--overwriteβ Allow output files to overwrite existing files. careful bestie, this one does what it says π--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 datasetoutput=name[required] β Name of the output space time raster datasetwhere=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'size=integerβ Neighborhood size. Default:3method=string[required] β Aggregate operation to be performed on the raster maps. Options:average,median,mode,minimum,maximum,range,stddev,sum,count,variance,diversity,interspersion,quart1,quart3,perc90,quantile. Default:averagebasename=string[required] β 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:gransemantic_labels=stringβ Set semantic labels. Options:input,method. Default:inputinput: copy semantic labels from input to outputmethod: append method name to input label if existing, otherwise use method name
nprocs=integerβ Number ofr.neighborprocesses to run in parallel. Default:1
π DESCRIPTION π
so t.rast.neighbors performs r.neighbors computations on the maps of a space time raster dataset (STRDS). it's giving "r.neighbors but make it temporal" β¨ this module supports a subset of options that are available in r.neighbors. the size of the neighborhood and the aggregation method can be chosen. lowkey flexible, highkey useful.
the user must provide an input and an output space time raster dataset and the basename of the resulting raster maps. the resulting STRDS will have the same temporal resolution as the input dataset. all maps will be processed using the current region settings. periodt.
the user can select a subset of the input space time raster dataset for processing using a SQL WHERE statement. the number of CPU's to be used for parallel processing can be specified with the nprocs option to speedup the computation on multi-core system. parallel processing? we love a multitasking queen π
semantic labels are needed to relate output raster maps to input raster maps. E.g. with method=stddev, the user needs to know the spatial extent, the time stamp and the semantic label to determine which stddev map corresponds to which input map. it's the receipts, bestie, you gotta keep them π§Ύ
π¦ EXAMPLE π¦
to smooth the maps contained in a space time dataset run:
t.rast.neighbors input=tempmean_monthly output=smooth_tempmean_monthly \
basename=tmean_smooth size=5 method=average nprocs=4
# show some info about the new space time dataset
t.info smooth_tempmean_monthly
+-------------------- Space Time Raster Dataset -----------------------------+
| |
+-------------------- Basic information -------------------------------------+
| Id: ........................ smooth_tempmean_monthly@climate_2000_2012
| Name: ...................... smooth_tempmean_monthly
| Mapset: .................... climate_2000_2012
| Creator: ................... lucadelu
| Temporal type: ............. absolute
| Creation time: ............. 2014-11-27 11:41:36.444579
| Modification time:.......... 2014-11-27 11:41:39.978232
| Semantic type:.............. mean
+-------------------- Absolute time -----------------------------------------+
| Start time:................. 2009-01-01 00:00:00
| End time:................... 2013-01-01 00:00:00
| Granularity:................ 1 month
| 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_ea1c9a83524e41a784d72744b08c6107
| 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:.......... -6.428905
| Minimum value max:.......... 18.867296
| Maximum value min:.......... 4.247691
| Maximum value max:.......... 28.767953
| Aggregation type:........... None
| Number of registered maps:.. 48
|
| Title:
| Monthly precipitation
| Description:
| Dataset with monthly precipitation
| Command history:
| # 2014-11-27 11:41:36
| t.rast.neighbors input="tempmean_monthly"
| output="smooth_tempmean_monthly" basename="tmean_smooth" size="5"
| method="average" nprocs="4"
|
+----------------------------------------------------------------------------+
# now compare the values between the original and the smoothed dataset
t.rast.list input=smooth_tempmean_monthly columns=name,start_time,min,max
name|start_time|min|max
tmean_smooth_1|2009-01-01 00:00:00|-3.361714|7.409861
tmean_smooth_2|2009-02-01 00:00:00|-1.820261|7.986794
tmean_smooth_3|2009-03-01 00:00:00|2.912971|11.799684
...
tmean_smooth_46|2012-10-01 00:00:00|9.38767|18.709297
tmean_smooth_47|2012-11-01 00:00:00|1.785653|10.911189
tmean_smooth_48|2012-12-01 00:00:00|1.784212|11.983857
t.rast.list input=tempmean_monthly columns=name,start_time,min,max
name|start_time|min|max
2009_01_tempmean|2009-01-01 00:00:00|-3.380823|7.426054
2009_02_tempmean|2009-02-01 00:00:00|-1.820261|8.006386
2009_03_tempmean|2009-03-01 00:00:00|2.656992|11.819274
...
2012_10_tempmean|2012-10-01 00:00:00|9.070884|18.709297
2012_11_tempmean|2012-11-01 00:00:00|1.785653|10.911189
2012_12_tempmean|2012-12-01 00:00:00|1.761019|11.983857
π SEE ALSO π
r.neighbors, t.rast.aggregate.ds, t.rast.extract, t.info, g.region, r.mask
π AUTHOR π
SΓΆren Gebbert, ThΓΌnen Institute of Climate-Smart Agriculture
π» SOURCE CODE π»
Available at: t.rast.neighbors source code (history)
okay that's the whole page, no skips, no cuts π«Ά before you go β the source code lives at the t.rast.neighbors source code (history), and the index situation is: Main index | Temporal index | Topics index | Keywords index | Graphical index | Full index. Accessed: Saturday Jan 17 05:41:53 2026. Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual. and the version stamp at the bottom is literally GRASS 8.4.2 β¨ bye bestie, go smooth some rasters ππΈπ¦
π¦ 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