GRASS GIS 8 Programmer's Manual
8.2.2dev(2023)-3d2c704037
|
Raster Library - Check if raster map is reclassified. More...
Go to the source code of this file.
Functions | |
int | Rast_is_reclass (const char *name, const char *mapset, char *rname, char *rmapset) |
Check if raster map is reclassified. More... | |
int | Rast_is_reclassed_to (const char *name, const char *mapset, int *nrmaps, char ***rmaps) |
Get child reclass maps list. More... | |
int | Rast_get_reclass (const char *name, const char *mapset, struct Reclass *reclass) |
Get reclass. More... | |
void | Rast_free_reclass (struct Reclass *reclass) |
Free Reclass structure. More... | |
int | Rast_put_reclass (const char *name, const struct Reclass *reclass) |
Put reclass. More... | |
Raster Library - Check if raster map is reclassified.
(C) 2001-2009 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file reclass.c.
void Rast_free_reclass | ( | struct Reclass * | reclass | ) |
Free Reclass structure.
reclass | pointer to Reclass structure |
Definition at line 183 of file reclass.c.
References G_free(), Reclass::mapset, Reclass::name, NULL, Reclass::num, RECLASS_TABLE, Reclass::table, and Reclass::type.
int Rast_get_reclass | ( | const char * | name, |
const char * | mapset, | ||
struct Reclass * | reclass | ||
) |
Get reclass.
name | map name | |
mapset | mapset name | |
[out] | reclass | pointer to Reclass structure |
Definition at line 140 of file reclass.c.
Referenced by Rast__open_old().
int Rast_is_reclass | ( | const char * | name, |
const char * | mapset, | ||
char * | rname, | ||
char * | rmapset | ||
) |
Check if raster map is reclassified.
This function determines if the raster map name in mapset is a reclass file. If it is, then the name and mapset of the referenced raster map are copied into the rname and rmapset buffers.
name | map name | |
mapset | mapset name | |
[out] | rname | name of reference map |
[out] | rmapset | mapset where reference map lives |
Definition at line 43 of file reclass.c.
Referenced by Rast__mask_info(), and Rast_get_cellhd().
int Rast_is_reclassed_to | ( | const char * | name, |
const char * | mapset, | ||
int * | nrmaps, | ||
char *** | rmaps | ||
) |
Get child reclass maps list.
This function generates a child reclass maps list from the cell_misc/reclassed_to file which stores this list. The cell_misc/reclassed_to file is written by Rast_put_reclass(). Rast_is_reclassed_to() is used by g.rename
, g.remove
and r.reclass
to prevent accidentally deleting the parent map of a reclassed raster map.
name | map name | |
mapset | mapset name | |
[out] | nrmaps | number of reference maps |
[out] | rmaps | array of names of reference maps |
Definition at line 79 of file reclass.c.
References G_fopen_old_misc(), G_malloc, G_realloc, l, and NULL.
int Rast_put_reclass | ( | const char * | name, |
const struct Reclass * | reclass | ||
) |
Put reclass.
name | map name |
reclass | pointer to Reclass structure |
Definition at line 262 of file reclass.c.
References _, G_fatal_error(), GNAME_MAX, GPATH_MAX, max, Reclass::max, min, Reclass::min, Reclass::num, RECLASS_TABLE, and Reclass::type.