GRASS GIS 7 Programmer's Manual  7.0.3(2016)-r00000
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...
 
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 acutal database, the standard map datum WGS84 is returned, on error a NULL pointer is returned.

Returns
datum name

Definition at line 170 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 196 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 220 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 96 of file proj3.c.

References G_projection(), G_projection_name(), and 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_get_units_name(), G_projection(), G_projection_units(), and 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 124 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().