GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71790
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
get_cellhd.c File Reference

Raster library - Read raster map header. More...

#include <string.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/raster.h>
#include <grass/glocale.h>
Include dependency graph for get_cellhd.c:

Go to the source code of this file.

Functions

void Rast_get_cellhd (const char *name, const char *mapset, struct Cell_head *cellhd)
 Read the raster header. More...
 

Detailed Description

Raster library - Read raster map header.

(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.

Author
Original author CERL

Definition in file get_cellhd.c.

Function Documentation

void Rast_get_cellhd ( const char *  name,
const char *  mapset,
struct Cell_head cellhd 
)

Read the raster header.

The raster header for the raster map name in the specified mapset is read into the cellhd structure. If there is an error reading the raster header file, a diagnostic message is printed and -1 is returned. Otherwise, 0 is returned.

Note:a warning message for errors encountered.

Cell header files may contain either grid cell header information or reclass information. If it is a reclass file, it will specify the map and mapset names of the actual grid cell file being reclassed. Rast_get_cellhd(), upon reading reclass information will go read the cell header information for the referenced file. Only one reference is allowed.

Parameters
namename of map
mapsetmapset that map belongs to
[out]cellhdstructure to hold cell header info
Returns
void

Definition at line 44 of file get_cellhd.c.

References _, fclose(), G__read_Cell_head(), G_fatal_error(), G_find_raster(), G_fopen_old(), GMAPSET_MAX, GNAME_MAX, and Rast_is_reclass().

Referenced by GS_load_att_map(), I_insert_patch_to_cat_rast(), Rast__check_for_auto_masking(), Rast__open_null_write(), and Rast__open_old().