GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71769
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
proj3.c File Reference

GIS Library - Projection support (database) More...

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

Go to the source code of this file.

Functions

const char * G_database_unit_name (int plural)
 Get units (localized) name for the current location. More...
 
int G_database_unit ()
 Get units id for the current location. More...
 
const char * G_database_projection_name (void)
 Query cartographic projection for the current location. More...
 
double G_database_units_to_meters_factor (void)
 Conversion to meters. More...
 
const char * G_database_datum_name (void)
 Get datum name for the current location. More...
 
const char * G_database_ellipse_name (void)
 Get ellipsoid name for the current location. More...
 
const char * G_database_epsg_code (void)
 Get EPGS code for the current location. More...
 

Detailed Description

GIS Library - Projection support (database)

(C) 2001-2014 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 proj3.c.

Function Documentation

const char* G_database_datum_name ( void  )

Get datum name for the current location.

Returns a pointer to the name of the map datum of the current database. If there is no map datum explicitely associated with the actual database, the standard map datum WGS84 is returned, on error a NULL pointer is returned.

Returns
datum name

Definition at line 181 of file proj3.c.

References G_get_datumparams_from_projinfo(), G_store(), name, and NULL.

const char* G_database_ellipse_name ( void  )

Get ellipsoid name for the current location.

Returns
pointer to valid name if ok
NULL on error

Definition at line 207 of file proj3.c.

References G_get_ellipsoid_parameters(), G_store(), and name.

const char* G_database_epsg_code ( void  )

Get EPGS code for the current location.

Returns
pointer to valid EPSG code on success
NULL on error

Definition at line 231 of file proj3.c.

const char* G_database_projection_name ( void  )

Query cartographic projection for the current location.

Returns a pointer to a string which is a printable name for projection code proj (as returned by G_projection). Returns NULL if proj is not a valid projection.

Returns
projection name

Definition at line 107 of file proj3.c.

References _, G_projection(), G_projection_name(), name, PROJECTION_LL, PROJECTION_UTM, and PROJECTION_XY.

Referenced by Vect_get_proj_name().

int G_database_unit ( )

Get units id for the current location.

Returns
units id

Definition at line 62 of file proj3.c.

References G_projection(), G_projection_units(), name, U_ACRES, U_DEGREES, U_FEET, U_HECTARES, U_KILOMETERS, U_METERS, U_MILES, U_UNDEFINED, U_UNKNOWN, and U_USFEET.

Referenced by G_database_unit_name().

const char* G_database_unit_name ( int  plural)

Get units (localized) name for the current location.

Returns a string describing the database grid units. It returns a plural form (eg. 'feet') if plural is non-zero. Otherwise it returns a singular form (eg. 'foot').

Parameters
pluralplural form if non-zero
Returns
localized units name

Definition at line 50 of file proj3.c.

References FALSE, G_database_unit(), and G_get_units_name().

Referenced by G_database_units_to_meters_factor(), G_get_units_name(), G_units(), and gsd_scalebar().

double G_database_units_to_meters_factor ( void  )

Conversion to meters.

Returns a factor which converts the grid unit to meters (by multiplication). If the database is not metric (eg. imagery) then 0.0 is returned.

Returns
value

Definition at line 135 of file proj3.c.

References G_database_unit_name(), and NULL.

Referenced by G_begin_cell_area_calculations(), G_begin_distance_calculations(), G_begin_polygon_area_calculations(), N_init_geom_data_2d(), and N_init_geom_data_3d().