GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
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

◆ G_database_datum_name()

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 explicitly 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 184 of file proj3.c.

References name.

◆ G_database_ellipse_name()

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 210 of file proj3.c.

References name.

◆ G_database_epsg_code()

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 234 of file proj3.c.

◆ G_database_projection_name()

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 110 of file proj3.c.

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

Referenced by Vect_get_proj_name().

◆ G_database_unit()

int G_database_unit ( )

Get units id for the current location.

Returns
units id

Definition at line 65 of file proj3.c.

References G_projection(), G_projection_units(), name, and U_UNDEFINED.

Referenced by G_database_unit_name().

◆ 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 53 of file proj3.c.

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

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

◆ G_database_units_to_meters_factor()

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 138 of file proj3.c.

Referenced by N_init_geom_data_3d().