GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
get_cellhd.c File Reference

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

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

Go to the source code of this file.

Functions

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

Detailed Description

GIS library - Read raster map header.

(C) 2001-2008 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

int G_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. G_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
cellhdstructure to hold cell header info
Returns
0 on success
-1 on error

Definition at line 45 of file get_cellhd.c.

References buf, err, fclose(), fd, G__read_Cell_head(), G_find_cell(), G_fopen_old(), G_free(), G_is_reclass(), G_warning(), NULL, and sprintf().

Referenced by G__check_for_auto_masking(), G__open_cell_old(), and GS_load_att_map().