GRASS Programmer's Manual
6.5.svn(2014)-r66266
|
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.
Data Structures | |
struct | table |
Functions | |
void | ellipsoid_table_file (char *) |
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... | |
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... | |
char * | G_ellipsoid_description (int n) |
get description for nth ellipsoid More... | |
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.
Returns: 1 ok, 0 default values used. Dies with diagnostic if there is an error
(C) 2001-2008 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.
void ellipsoid_table_file | ( | char * | file | ) |
Definition at line 249 of file get_ellipse.c.
References G_gisbase(), and sprintf().
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.
[in] | n | ellipsoid identificator |
Definition at line 202 of file get_ellipse.c.
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.
[in] | n | ellipsoid identificator |
Definition at line 138 of file get_ellipse.c.
References count, n, and NULL.
Referenced by G_ask_ellipse_name().
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. Returns 1 if name is a known ellipsoid, 0 otherwise.
[in] | name | ellipsoid name |
[out] | a | semi-major axis |
[out] | e2 | eccentricity squared |
Definition at line 110 of file get_ellipse.c.
References count, and G_strcasecmp().
Referenced by G_ask_ellipse_name().
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.
References G__file_name(), G_fatal_error(), G_free_key_value(), G_read_key_value_file(), NULL, PERMANENT, and stat.
Referenced by G_begin_cell_area_calculations(), G_begin_distance_calculations(), G_begin_polygon_area_calculations(), and G_database_ellipse_name().
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. Returns 1 if name is a known ellipsoid, 0 otherwise.
[in] | name | spheroid name |
[out] | a | semi-major axis |
[out] | e2 | eccentricity squared |
[out] | f | inverse flattening |
Definition at line 171 of file get_ellipse.c.
References count, and G_strcasecmp().