GRASS GIS 8 Programmer's Manual  8.4.0dev(2024)-8cbe8fef7c
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 */
5 int GPJ_init_transform(const struct pj_info *, const struct pj_info *,
6  struct pj_info *);
7 int GPJ_transform(const struct pj_info *, const struct pj_info *,
8  const struct pj_info *, int, double *, double *, double *);
9 int 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 */
14 int pj_do_proj(double *, double *, const struct pj_info *,
15  const struct pj_info *);
16 int 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 */
21 int pj_get_kv(struct pj_info *, const struct Key_Value *,
22  const struct Key_Value *);
23 int pj_get_string(struct pj_info *, char *);
24 
25 #ifndef HAVE_PROJ_H
26 int GPJ_get_equivalent_latlong(struct pj_info *, struct pj_info *);
27 #endif
28 const char *set_proj_share(const char *);
29 int pj_print_proj_params(const struct pj_info *, const struct pj_info *);
30 
31 /* convert.c */
32 char *GPJ_grass_to_wkt(const struct Key_Value *, const struct Key_Value *, int,
33  int);
34 char *GPJ_grass_to_wkt2(const struct Key_Value *, const struct Key_Value *,
35  const struct Key_Value *, int, int);
36 #ifdef HAVE_OGR
37 OGRSpatialReferenceH GPJ_grass_to_osr(const struct Key_Value *,
38  const struct Key_Value *);
39 OGRSpatialReferenceH GPJ_grass_to_osr2(const struct Key_Value *,
40  const struct Key_Value *,
41  const struct Key_Value *);
42 const char *GPJ_set_csv_loc(const char *);
43 int GPJ_osr_to_grass(struct Cell_head *, struct Key_Value **,
44  struct Key_Value **, OGRSpatialReferenceH, int);
45 #endif
46 int GPJ_wkt_to_grass(struct Cell_head *, struct Key_Value **,
47  struct Key_Value **, const char *, int);
48 
49 /* datum.c */
50 int GPJ_get_datum_by_name(const char *, struct gpj_datum *);
51 int GPJ_get_default_datum_params_by_name(const char *, char **);
52 int GPJ_get_datum_params(char **, char **);
53 int GPJ__get_datum_params(const struct Key_Value *, char **, char **);
54 void GPJ_free_datum(struct gpj_datum *);
57 
58 /* ellipse.c */
59 int GPJ_get_ellipsoid_by_name(const char *, struct gpj_ellps *);
60 int GPJ_get_ellipsoid_params(double *, double *, double *);
61 int GPJ__get_ellipsoid_params(const struct Key_Value *, double *, double *,
62  double *);
63 void GPJ_free_ellps(struct gpj_ellps *);
64 
65 #ifndef HAVE_PROJ_H
66 /* PROJ.4's private datastructures copied from projects.h as removed
67  from upstream; pending better solution. see:
68  http://trac.osgeo.org/proj/ticket/98 */
69 
70 int pj_factors(LP, void *, double, struct FACTORS *);
71 
72 /* end of copy */
73 #endif
74 
75 #endif
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:119
const char * GPJ_set_csv_loc(const char *)
Definition: convert.c:1010
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
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:1008
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:434
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:1227
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:160
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:303
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:339
int pj_factors(LP, void *, double, struct FACTORS *)
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:978
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:168
const char * set_proj_share(const char *)
Definition: get_proj.c:518
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:1620
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:554
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:1490
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:359
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:150
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_equivalent_latlong(struct pj_info *, struct pj_info *)
int GPJ_get_datum_params(char **, char **)
Extract the datum transformation-related parameters for the current location.
Definition: proj/datum.c:135
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:421
2D/3D raster map header (used also for region)
Definition: gis.h:437
Definition: gis.h:525