GRASS 8 Programmer's Manual 8.6.0dev(2026)-ddeab64dbf
Loading...
Searching...
No Matches
defs/gprojects.h
Go to the documentation of this file.
1#ifndef GRASS_GPROJECTSDEFS_H
2#define GRASS_GPROJECTSDEFS_H
3
4/* do_proj.c */
5int GPJ_init_transform(const struct pj_info *, const struct pj_info *,
6 struct pj_info *);
7int GPJ_transform(const struct pj_info *, const struct pj_info *,
8 const struct pj_info *, int, double *, double *, double *);
9int GPJ_transform_array(const struct pj_info *, const struct pj_info *,
10 const struct pj_info *, int, double *, double *,
11 double *, int);
12
13/* old API, to be removed */
14int pj_do_proj(double *, double *, const struct pj_info *,
15 const struct pj_info *);
16int pj_do_transform(int, double *, double *, double *, const struct pj_info *,
17 const struct pj_info *);
18
19/* get_proj.c */
20/* TODO: rename pj_ to GPJ_ to avoid symbol clash with PROJ lib */
21int pj_get_kv(struct pj_info *, const struct Key_Value *,
22 const struct Key_Value *);
23int pj_get_string(struct pj_info *, char *);
24
25const char *set_proj_share(const char *);
26int pj_print_proj_params(const struct pj_info *, const struct pj_info *);
27
28/* convert.c */
29char *GPJ_grass_to_wkt(const struct Key_Value *, const struct Key_Value *, int,
30 int);
31char *GPJ_grass_to_wkt2(const struct Key_Value *, const struct Key_Value *,
32 const struct Key_Value *, int, int);
33OGRSpatialReferenceH GPJ_grass_to_osr(const struct Key_Value *,
34 const struct Key_Value *);
35OGRSpatialReferenceH GPJ_grass_to_osr2(const struct Key_Value *,
36 const struct Key_Value *,
37 const struct Key_Value *);
38const char *GPJ_set_csv_loc(const char *);
39int GPJ_osr_to_grass(struct Cell_head *, struct Key_Value **,
40 struct Key_Value **, OGRSpatialReferenceH, int);
41int GPJ_wkt_to_grass(struct Cell_head *, struct Key_Value **,
42 struct Key_Value **, const char *, int);
43
44/* datum.c */
45int GPJ_get_datum_by_name(const char *, struct gpj_datum *);
46int GPJ_get_default_datum_params_by_name(const char *, char **);
47int GPJ_get_datum_params(char **, char **);
48int GPJ__get_datum_params(const struct Key_Value *, char **, char **);
49void GPJ_free_datum(struct gpj_datum *);
52
53/* ellipse.c */
54int GPJ_get_ellipsoid_by_name(const char *, struct gpj_ellps *);
55int GPJ_get_ellipsoid_params(double *, double *, double *);
56int GPJ__get_ellipsoid_params(const struct Key_Value *, double *, double *,
57 double *);
58void GPJ_free_ellps(struct gpj_ellps *);
59
60#endif
int GPJ_transform(const struct pj_info *, const struct pj_info *, const struct pj_info *, int, double *, double *, double *)
Re-project a point between two co-ordinate systems using a transformation object prepared with GPJ_pr...
Definition do_proj.c:873
void GPJ_free_datum(struct gpj_datum *)
Free the memory used for the strings in a gpj_datum struct.
Definition proj/datum.c:396
int GPJ_init_transform(const struct pj_info *, const struct pj_info *, struct pj_info *)
Create a PROJ transformation object to transform coordinates from an input SRS to an output SRS.
Definition do_proj.c:425
int GPJ_transform_array(const struct pj_info *, const struct pj_info *, const struct pj_info *, int, double *, double *, double *, int)
Re-project an array of points between two co-ordinate systems using a transformation object prepared ...
Definition do_proj.c:1031
const char * GPJ_set_csv_loc(const char *)
Definition convert.c:998
int GPJ_get_ellipsoid_by_name(const char *, struct gpj_ellps *)
Looks up ellipsoid in ellipsoid table and returns the a, e2 parameters for the ellipsoid.
Definition ellipse.c:159
int GPJ_get_datum_by_name(const char *, struct gpj_datum *)
Look up a string in datum.table file to see if it is a valid datum name and if so place its informati...
Definition proj/datum.c:38
void GPJ_free_ellps(struct gpj_ellps *)
Free ellipsoid data structure.
Definition ellipse.c:302
int GPJ_get_default_datum_params_by_name(const char *, char **)
"Last resort" function to retrieve a "default" set of datum parameters for a datum (N....
Definition proj/datum.c:86
int pj_get_string(struct pj_info *, char *)
Create a pj_info struct Co-ordinate System definition from a string with a sequence of key=value pair...
Definition get_proj.c:319
int GPJ_wkt_to_grass(struct Cell_head *, struct Key_Value **, struct Key_Value **, const char *, int)
Converts a WKT projection description to a GRASS co-ordinate system.
Definition convert.c:971
char * GPJ_grass_to_wkt2(const struct Key_Value *, const struct Key_Value *, const struct Key_Value *, int, int)
Converts a GRASS co-ordinate system representation to WKT style. EPSG code is preferred if available.
Definition convert.c:143
const char * set_proj_share(const char *)
Definition get_proj.c:438
int GPJ__get_datum_params(const struct Key_Value *, char **, char **)
Extract the datum transformation-related parameters from a set of general PROJ_INFO parameters.
Definition proj/datum.c:173
int pj_get_kv(struct pj_info *, const struct Key_Value *, const struct Key_Value *)
Create a pj_info struct Co-ordinate System definition from a set of PROJ_INFO / PROJ_UNITS-style key-...
Definition get_proj.c:60
OGRSpatialReferenceH GPJ_grass_to_osr(const struct Key_Value *, const struct Key_Value *)
Converts a GRASS co-ordinate system to an OGRSpatialReferenceH object.
Definition convert.c:160
int pj_do_transform(int, double *, double *, double *, const struct pj_info *, const struct pj_info *)
Re-project an array of points between two co-ordinate systems with optional ellipsoidal height conver...
Definition do_proj.c:1318
int pj_print_proj_params(const struct pj_info *, const struct pj_info *)
Print projection parameters as used by PROJ.4 for input and output co-ordinate systems.
Definition get_proj.c:474
int pj_do_proj(double *, double *, const struct pj_info *, const struct pj_info *)
Re-project a point between two co-ordinate systems.
Definition do_proj.c:1232
OGRSpatialReferenceH GPJ_grass_to_osr2(const struct Key_Value *, const struct Key_Value *, const struct Key_Value *)
Converts a GRASS co-ordinate system to an OGRSpatialReferenceH object. EPSG code is preferred if avai...
Definition convert.c:347
int GPJ_get_ellipsoid_params(double *, double *, double *)
Get the ellipsoid parameters from the database.
Definition ellipse.c:44
int GPJ__get_ellipsoid_params(const struct Key_Value *, double *, double *, double *)
Get the ellipsoid parameters from proj keys structure.
Definition ellipse.c:74
void GPJ_free_datum_transform(struct gpj_datum_transform_list *)
Free the memory used by a gpj_datum_transform_list struct.
Definition proj/datum.c:323
int GPJ_get_datum_params(char **, char **)
Extract the datum transformation-related parameters for the current location.
Definition proj/datum.c:135
char * GPJ_grass_to_wkt(const struct Key_Value *, const struct Key_Value *, int, int)
Converts a GRASS co-ordinate system representation to WKT style.
Definition convert.c:112
int GPJ_osr_to_grass(struct Cell_head *, struct Key_Value **, struct Key_Value **, OGRSpatialReferenceH, int)
Converts an OGRSpatialReferenceH object to a GRASS co-ordinate system.
Definition convert.c:413
struct gpj_datum_transform_list * GPJ_get_datum_transform_by_name(const char *)
Internal function to find all possible sets of transformation parameters for a particular datum.
Definition proj/datum.c:237
2D/3D raster map header (used also for region)
Definition gis.h:446