Another use case is to estimate the width of small landscape elements (SLE), e.g., to complement statistics computed by r.object.geometry
Object thickness is evaluated by creating transects along the median lines of the raster objects, clipping them with objects themselves, and evaluating their lengths. This is done using the v.transects addon, which must therefore be installed to run this module.
Optionally, r.object.thickness can save a CSV file containing the complete list of the lengths of the parts of all created transects inside the objects. It is possible to save a vector map containing the transects, a vector map containing the clipped transects and maps containing the median lines of the objects, in both raster and vector format. The attribute table of the latter contains the average, minimum, and maximum widths of the transects within the objects.
The expected maximum length of the transects is used to create the transects before clipping them with the raster objects. It must be chosen large enough to contain the longer cross section of the biggest object. The module issues a warning if the maximum evaluated thickness is less than or equal to the expected maximum: in that case, at least one transect has not been clipped because it does not intersect the object boundary. Therefore, the expected maximum size parameter must be raised.
Transect spacing controls the distance between transects along the median line. It must be chosen so that at least one transect is created on each median line. Smaller values can provide slightly more accurate results but require more processing time. As a rule of thumb, a good starting point is setting transects spacing around 1/50 of the expected maximum size, but the minimum value can change. If the transects spacing value is too low, no transect is created and no thickness can be evaluated: in that case, the module issues an error and stops.
It is possible to choose the direction (N-S or E-W) of the region resolution used to convert the estimated lengths in pixels. The choice is irrelevant for regions with square cells.
The way the transect spacing is measured and whether the transects are generated , perpendicular to the input line or the line connecting the transect points, can be set by respectively the metric and transect_perpendicular parameters. See the manual page of [v.transects](v.transects.html) for details.
Optional maps containing the median lines of the objects, in both raster and vector format, the vector map containing the transects, and the vector map containing the clipped transects are created only if a name is provided for them. In the same way, a CSV file containing the complete list of the lengths of the parts of all created transects inside the objects is also created only if a file name is given.
# set the region on the landuse map g.region rast=landuse@PERMANENT # evaluate the thickness of water bodies (categoy 6) in the landuse map # create a vector map containing the median lines called median # create a vector map containing the transects inside the water bodies called transects_in r.object.thickness input=landuse@PERMANENT category=6 tsize=4000 tspace=100 vmedian=median itransects=transects_in
Thickness in map units: min = 1.525433 max = 2962.446155 mean = 301.059197 Thickness in pixels: min = 0.053524 max = 103.945479 mean = 10.563481
Available at: r.object.thickness source code (history)
Latest change: Friday Jun 06 23:38:55 2025 in commit: 1ff8ddee6a01630b69dba1cbc92c31c588b10b86
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2dev Reference Manual