|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
|
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 | |
| int | G_get_ellipsoid_by_name (const char *name, double *a, double *e2) |
| Get ellipsoid parameters by name. | |
| const char * | G_ellipsoid_name (int n) |
| Get ellipsoid name. | |
| int | G_get_spheroid_by_name (const char *name, double *a, double *e2, double *f) |
| Get spheroid parameters by name. | |
| const char * | G_ellipsoid_description (int n) |
| Get description for nth ellipsoid. | |
| int | G_read_ellipsoid_table (int fatal) |
| Read ellipsoid table. | |
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.
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(), and NULL.
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(), AMI_STREAM< T >::name(), and NULL.
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.
References G_read_ellipsoid_table(), G_strcasecmp(), AMI_STREAM< T >::name(), and name.
Referenced by G_compare_projections().
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 access, G_file_name(), G_free_key_value(), G_read_key_value_file(), GPATH_MAX, NULL, PERMANENT, and PROJECTION_FILE.
Referenced by G_begin_cell_area_calculations(), G_begin_distance_calculations(), G_begin_polygon_area_calculations(), and G_database_ellipse_name().
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.
References G_read_ellipsoid_table(), G_strcasecmp(), AMI_STREAM< T >::name(), and name.
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 _, err(), file, G_fatal_error(), G_getl2(), G_gisbase(), G_initialize_done(), G_is_initialized(), G_realloc, G_store(), G_strip(), G_strlcat(), G_warning(), GPATH_MAX, n_, name, and NULL.
Referenced by G_ellipsoid_description(), G_ellipsoid_name(), G_get_ellipsoid_by_name(), G_get_spheroid_by_name(), and G_init_all().