Functions

make_loc.c File Reference

#include <grass/gis.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/stat.h>
#include <math.h>
Include dependency graph for make_loc.c:

Go to the source code of this file.

Functions

int G__make_location (const char *location_name, struct Cell_head *wind, struct Key_Value *proj_info, struct Key_Value *proj_units, FILE *report_file)
int G_make_location (const char *location_name, struct Cell_head *wind, struct Key_Value *proj_info, struct Key_Value *proj_units, FILE *report_file)
 create a new location
int G_compare_projections (const struct Key_Value *proj_info1, const struct Key_Value *proj_units1, const struct Key_Value *proj_info2, const struct Key_Value *proj_units2)
 compare projections

Function Documentation

int G__make_location ( const char *  location_name,
struct Cell_head *  wind,
struct Key_Value *  proj_info,
struct Key_Value *  proj_units,
FILE *  report_file 
)
int G_compare_projections ( const struct Key_Value *  proj_info1,
const struct Key_Value *  proj_units1,
const struct Key_Value *  proj_info2,
const struct Key_Value *  proj_units2 
)

compare projections

Parameters:
proj_info1
proj_units1
proj_info2
proj_units2
Returns:
-1 if not the same projection, -2 if linear unit translation to meters fails, -4 if not the same ellipsoid, -5 if UTM zone differs else TRUE if projections match.

Definition at line 165 of file make_loc.c.

References G_find_key_value(), and NULL.

int G_make_location ( const char *  location_name,
struct Cell_head *  wind,
struct Key_Value *  proj_info,
struct Key_Value *  proj_units,
FILE *  report_file 
)

create a new location

This function creates a new location in the current database, initializes the projection, default window and current window.

Parameters:
char* location_name The name of the new location. Should not include the full path, the location will be created within the current database.
structCell_head *wind Contains the default window setting for the new location. All fields should be set in this structure, and care should be taken to ensure that the proj/zone fields match the definition in the proj_info parameter (see G_set_cellhd_from_projinfo()).
structKey_Value *proj_info Projection definition suitable to write to the PROJ_INFO file, or NULL for PROJECTION_XY.
structKey_Value *proj_units Projection units suitable to write to the PROJ_UNITS file, or NULL.
FILE*report_file File to which creation information should be written (can be stdout). Currently not used.
Returns:
Returns 0 on success, or generates a fatal error on failure. The G__make_location() function operates the same, but returns a non-zero error code on failure, instead of terminating.

Definition at line 123 of file make_loc.c.

References G__make_location(), and G_fatal_error().