GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 More...
 
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 More...
 

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, -6 if UTM hemisphere differs, -7 if false easting differs, -8 if false northing differs, else TRUE if projections match.

Definition at line 166 of file make_loc.c.

References G_find_key_value(), NULL, and TRUE.

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
location_nameThe name of the new location. Should not include the full path, the location will be created within the current database.
windContains 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()).
proj_infoProjection definition suitable to write to the PROJ_INFO file, or NULL for PROJECTION_XY.
proj_unitsProjection units suitable to write to the PROJ_UNITS file, or NULL.
report_fileFile 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 122 of file make_loc.c.

References err, G__make_location(), and G_fatal_error().