GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
raster_metadata.c File Reference
#include <stdio.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Include dependency graph for raster_metadata.c:

Go to the source code of this file.

Functions

int G_read_raster_units (const char *name, const char *mapset, char *str)
 Get a raster map's units metadata string. More...
 
int G_write_raster_units (const char *name, const char *str)
 Write a string to a raster map's units metadata file. More...
 
int G_read_raster_vdatum (const char *name, const char *mapset, char *str)
 Get a raster map's vertical datum metadata string. More...
 
int G_write_raster_vdatum (const char *name, const char *str)
 Write a string into a raster's vertical datum metadata file. More...
 
int G__raster_misc_read_line (const char *elem, const char *name, const char *mapset, char *str)
 Read the first line of a file in cell_misc/. More...
 
int G__raster_misc_write_line (const char *elem, const char *name, const char *str)
 Write a line to a raster map metadata file. More...
 

Function Documentation

int G__raster_misc_read_line ( const char *  elem,
const char *  name,
const char *  mapset,
char *  str 
)

Read the first line of a file in cell_misc/.

Read the first line of data from a cell_misc/ meta-data file.

Parameters
elementmetadata component filename
name
mapset
*strstring to be populated with data
Returns
0 on success
-1, EOF (fclose() result) on error

Definition at line 98 of file raster_metadata.c.

References buff, fclose(), fd, G_find_file2_misc(), G_fopen_old_misc(), G_getl2(), G_warning(), and NULL.

Referenced by G_read_raster_units(), and G_read_raster_vdatum().

int G__raster_misc_write_line ( const char *  elem,
const char *  name,
const char *  str 
)

Write a line to a raster map metadata file.

Write (including overwrite) a string into a raster map's metadata file found in in cell_misc/ in the current mapset.

Parameters
elementmetadata component filename
name
*strstring containing data to be written
Returns
0 on success
-1, EOF (fclose() result) on error

Definition at line 138 of file raster_metadata.c.

References fclose(), fd, G_fopen_new_misc(), G_mapset(), G_warning(), and NULL.

Referenced by G_write_raster_units(), and G_write_raster_vdatum().

int G_read_raster_units ( const char *  name,
const char *  mapset,
char *  str 
)

Get a raster map's units metadata string.

Read the raster's units metadata file and put string in str

Parameters
name
mapset
*strstring to be populated with data
Returns
0 on success
-1, EOF (fclose() result) on error

Definition at line 30 of file raster_metadata.c.

References G__raster_misc_read_line().

int G_read_raster_vdatum ( const char *  name,
const char *  mapset,
char *  str 
)

Get a raster map's vertical datum metadata string.

Read the raster's vertical datum metadata file and put string in str

Parameters
name
mapset
*strstring to be populated with data
Returns
0 on success
-1, EOF (fclose() result) on error

Definition at line 63 of file raster_metadata.c.

References G__raster_misc_read_line().

int G_write_raster_units ( const char *  name,
const char *  str 
)

Write a string to a raster map's units metadata file.

Map must exist in the current mapset.

Parameters
name
*strstring containing data to be written
Returns
0 on success
-1, EOF (fclose() result) on error

Definition at line 46 of file raster_metadata.c.

References G__raster_misc_write_line().

int G_write_raster_vdatum ( const char *  name,
const char *  str 
)

Write a string into a raster's vertical datum metadata file.

Map must exist in the current mapset.

Parameters
name
*strstring containing data to be written
Returns
0 on success
-1, EOF (fclose() result) on error

Definition at line 79 of file raster_metadata.c.

References G__raster_misc_write_line().