Loading...
Searching...
No Matches
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.
int | G_database_unit (void)
| Get units id for the current location.
const char * | G_database_projection_name (void)
| Query cartographic projection for the current location.
double | G_database_units_to_meters_factor (void)
| Conversion to meters.
const char * | G_database_datum_name (void)
| Get datum name for the current location.
const char * | G_database_ellipse_name (void)
| Get ellipsoid name for the current location.
const char * | G_database_epsg_code (void)
| Get EPGS code for the current location.

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

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

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

References G_get_ellipsoid_parameters(), G_store(), and 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 236 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 118 of file proj3.c.

References G_projection(), G_projection_name(), and name.

## G_database_unit()

int G_database_unit | ( | void |  | ) |

Get units id for the current location.

Returns
  units id

Definition at line 66 of file proj3.c.

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

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

  plural | plural 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_database_units_to_meters_factor(), 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 146 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().