Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.
r.sample.category generates points at random locations. Each category (class) in a raster map will contain specified number of random points.
Different number of points can be specified for different categories. For example, if there are categories 1, 4, 7 in the input raster map, and npoints=100,200,300, 100 points will be generated in category 1, 200 points in category 4 and 300 points in category 7. If only one number is specified, it will be used for every category.
Categories are identified based on current computational region.
g.region raster=landclass96 r.sample.category input=landclass96 output=landclass_points npoints=3
d.rast map=landclass96 d.vect map=landclass_points icon=basic/circle fill_color=aqua color=blue size=10
r.sample.category input=landclass96 output=landclass_points sampled=elevation,geology_30m npoints=2
v.db.select landclass_points sep=comma
cat,landclass96,elevation,geology_30m 1,1,102.7855,270 2,1,105.78,270 3,2,114.5954,217 4,2,137.4816,921 5,3,71.19167,270 6,3,93.33904,270 7,4,76.41077,262 8,4,97.54424,217 9,5,138.455,405 10,5,88.8075,270 11,6,126.5298,217 12,6,86.73177,217 13,7,134.5381,217 14,7,99.6844,270
Available at: r.sample.category source code (history)
Latest change: Mon Jun 28 07:54:09 2021 in commit: 1cfc0af029a35a5d6c7dae5ca7204d0eb85dbc55
Note: This addon document is for an older version of GRASS GIS that will be discontinued soon. You should upgrade your GRASS GIS installation, and read the current addon manual page.
Main index | Raster index | Topics index | Keywords index | Graphical index | Full index
© 2003-2023 GRASS Development Team, GRASS GIS 7.8.8dev Reference Manual