|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
|
GProj library - Functions for reading datum parameters from the location 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>#include <grass/gprojects.h>#include "local_proto.h"
Go to the source code of this file.
Functions | |
| int | GPJ_get_ellipsoid_params (double *a, double *e2, double *rf) |
| Get the ellipsoid parameters from the database. | |
| int | GPJ__get_ellipsoid_params (const struct Key_Value *proj_keys, double *a, double *e2, double *rf) |
| Get the ellipsoid parameters from proj keys structure. | |
| int | GPJ_get_ellipsoid_by_name (const char *name, struct gpj_ellps *estruct) |
| Looks up ellipsoid in ellipsoid table and returns the a, e2 parameters for the ellipsoid. | |
| struct ellps_list * | read_ellipsoid_table (int fatal) |
| void | GPJ_free_ellps (struct gpj_ellps *estruct) |
| Free ellipsoid data structure. | |
| void | free_ellps_list (struct ellps_list *elist) |
GProj library - Functions for reading datum parameters from the location database.
(C) 2003-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 ellipse.c.
| void free_ellps_list | ( | struct ellps_list * | elist | ) |
Definition at line 309 of file ellipse.c.
References AMI_STREAM< T >::AMI_STREAM(), G_free(), AMI_STREAM< T >::name(), and NULL.
Referenced by GPJ_get_ellipsoid_by_name(), and GPJ_osr_to_grass().
| int GPJ__get_ellipsoid_params | ( | const struct Key_Value * | proj_keys, |
| double * | a, | ||
| double * | e2, | ||
| double * | rf | ||
| ) |
Get the ellipsoid parameters from proj keys structure.
If the PROJECTION_FILE exists in the PERMANENT mapset, read info from that file, otherwise return WGS 84 values.
Dies with diagnostic if there is an error.
| proj_keys | proj definition | |
| [out] | a | semi-major axis |
| [out] | e2 | first eccentricity squared |
| [out] | rf | reciprocal of the ellipsoid flattening term |
Definition at line 74 of file ellipse.c.
References _, gpj_datum::ellps, G_asprintf(), G_fatal_error(), G_find_key_value(), G_free(), G_store(), GPJ_free_datum(), GPJ_free_ellps(), GPJ_get_datum_by_name(), GPJ_get_ellipsoid_by_name(), and NULL.
Referenced by GPJ_get_ellipsoid_params(), GPJ_grass_to_osr(), GPJ_osr_to_grass(), and pj_get_kv().
Free ellipsoid data structure.
| estruct | data structure to be freed |
Definition at line 302 of file ellipse.c.
References G_free(), and AMI_STREAM< T >::name().
Referenced by GPJ__get_ellipsoid_params(), and GPJ_grass_to_osr().
Looks up ellipsoid in ellipsoid table and returns the a, e2 parameters for the ellipsoid.
| name | ellipsoid name | |
| [out] | estruct | ellipsoid |
Definition at line 159 of file ellipse.c.
References AMI_STREAM< T >::AMI_STREAM(), free_ellps_list(), G_store(), G_strcasecmp(), AMI_STREAM< T >::name(), name, NULL, and read_ellipsoid_table().
Referenced by GPJ__get_ellipsoid_params(), and GPJ_grass_to_osr().
Get 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.
Dies with diagnostic if there is an error.
| [out] | a | semi-major axis |
| [out] | e2 | first eccentricity squared |
| [out] | rf | reciprocal of the ellipsoid flattening term |
Definition at line 44 of file ellipse.c.
References G_create_key_value(), G_free_key_value(), G_get_projinfo(), GPJ__get_ellipsoid_params(), and NULL.
| struct ellps_list * read_ellipsoid_table | ( | int | fatal | ) |
Definition at line 223 of file ellipse.c.
References _, AMI_STREAM< T >::AMI_STREAM(), UntypedStream::buf, ELLIPSOIDTABLE, err(), file, G_fatal_error(), G_getl2(), G_gisbase(), G_malloc, G_store(), G_strip(), G_warning(), GPATH_MAX, n_, AMI_STREAM< T >::name(), name, and NULL.
Referenced by GPJ_get_ellipsoid_by_name(), and GPJ_osr_to_grass().