GRASS GIS 8 Programmer's Manual
8.5.0dev(2024)-602118adcc
|
GIS Library - Getting ellipsoid parameters from the database. More...
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <grass/gis.h>
#include <grass/glocale.h>
Go to the source code of this file.
Functions | |
int | G_get_ellipsoid_parameters (double *a, double *e2) |
get ellipsoid parameters More... | |
int | G_get_ellipsoid_by_name (const char *name, double *a, double *e2) |
Get ellipsoid parameters by name. More... | |
const char * | G_ellipsoid_name (int n) |
Get ellipsoid name. More... | |
int | G_get_spheroid_by_name (const char *name, double *a, double *e2, double *f) |
Get spheroid parameters by name. More... | |
const char * | G_ellipsoid_description (int n) |
Get description for nth ellipsoid. More... | |
int | G_read_ellipsoid_table (int fatal) |
Read ellipsoid table. More... | |
GIS Library - Getting ellipsoid parameters from the database.
This routine returns the ellipsoid parameters from the database. If the PROJECTION_FILE exists in the PERMANENT mapset, read info from that file, otherwise return WGS 84 values.
New 05/2000 by al: for datum shift the f parameter is needed too. This all is not a clean design, but it keeps backward- compatibility. Looks up ellipsoid in ellipsoid table and returns the a, e2 and f parameters for the ellipsoid
(C) 2001-2009 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.
Definition in file get_ellipse.c.
const char* G_ellipsoid_description | ( | int | n | ) |
Get description for nth ellipsoid.
This function returns a pointer to the description text for the nth ellipsoid. If n is less than 0 or greater than the number of known ellipsoids, it returns a NULL pointer.
n | ellipsoid identificator |
Definition at line 182 of file get_ellipse.c.
References G_read_ellipsoid_table().
const char* G_ellipsoid_name | ( | int | n | ) |
Get ellipsoid name.
This function returns a pointer to the short name for the nth ellipsoid. If n is less than 0 or greater than the number of known ellipsoids, it returns a NULL pointer.
n | ellipsoid identificator |
Definition at line 132 of file get_ellipse.c.
References G_read_ellipsoid_table().
int G_get_ellipsoid_by_name | ( | const char * | name, |
double * | a, | ||
double * | e2 | ||
) |
Get ellipsoid parameters by name.
This routine returns the semi-major axis a (in meters) and eccentricity squared e2 for the named ellipsoid.
name | ellipsoid name | |
[out] | a | semi-major axis |
[out] | e2 | eccentricity squared |
Definition at line 104 of file get_ellipse.c.
int G_get_ellipsoid_parameters | ( | double * | a, |
double * | e2 | ||
) |
get ellipsoid parameters
This routine returns the semi-major axis a (in meters) and the eccentricity squared e2 for the ellipsoid associated with the database. If there is no ellipsoid explicitly associated with the database, it returns the values for the WGS 84 ellipsoid.
[out] | a | semi-major axis |
[out] | e2 | eccentricity squared |
Definition at line 66 of file get_ellipse.c.
int G_get_spheroid_by_name | ( | const char * | name, |
double * | a, | ||
double * | e2, | ||
double * | f | ||
) |
Get spheroid parameters by name.
This function returns the semi-major axis a (in meters), the eccentricity squared e2 and the inverse flattening f for the named ellipsoid.
name | spheroid name | |
[out] | a | semi-major axis |
[out] | e2 | eccentricity squared |
[out] | f | inverse flattening |
Definition at line 153 of file get_ellipse.c.
int G_read_ellipsoid_table | ( | int | fatal | ) |
Read ellipsoid table.
fatal | non-zero value for G_fatal_error(), otherwise G_warning() is used |
Definition at line 246 of file get_ellipse.c.
References file, and GPATH_MAX.
Referenced by G_ellipsoid_description(), G_ellipsoid_name(), and G_init_all().