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 (char *location_name, struct Cell_head *wind, struct Key_Value *proj_info, struct Key_Value *proj_units, FILE *report_file)
int G_make_location (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 (struct Key_Value *proj_info1, struct Key_Value *proj_units1, struct Key_Value *proj_info2, struct Key_Value *proj_units2)
 compare projections


Function Documentation

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

Definition at line 47 of file make_loc.c.

References G__file_name(), G__put_window(), G__setenv(), G_gisdbase(), G_write_key_value_file(), and NULL.

Referenced by G_make_location().

int G_compare_projections ( struct Key_Value *  proj_info1,
struct Key_Value *  proj_units1,
struct Key_Value *  proj_info2,
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 176 of file make_loc.c.

References G_find_key_value(), and NULL.

int G_make_location ( 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.
struct Cell_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()).
struct Key_Value *proj_info Projection definition suitable to write to the PROJ_INFO file, or NULL for PROJECTION_XY.
struct Key_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 131 of file make_loc.c.

References G__make_location(), and G_fatal_error().


Generated on Sun Apr 6 17:32:22 2008 for GRASS by  doxygen 1.5.5