GRASS GIS 7 Programmer's Manual  7.9.dev(2021)-e5379bbd7
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,
11  double *, double *, double *, int);
12 
13 /* old API, to be removed */
14 int pj_do_proj(double *, double *, const struct pj_info *, const struct pj_info *);
15 int pj_do_transform(int, double *, double *, double *,
16  const struct pj_info *, const struct pj_info *);
17 
18 /* get_proj.c */
19 /* TODO: rename pj_ to GPJ_ to avoid symbol clash with PROJ lib */
20 int pj_get_kv(struct pj_info *, const struct Key_Value *, const struct Key_Value *);
21 int pj_get_string(struct pj_info *, char *);
22 #ifndef HAVE_PROJ_H
23 int GPJ_get_equivalent_latlong(struct pj_info *, struct pj_info *);
24 #endif
25 const char *set_proj_share(const char *);
26 int pj_print_proj_params(const struct pj_info *, const struct pj_info *);
27 
28 /* convert.c */
29 char *GPJ_grass_to_wkt(const struct Key_Value *, const struct Key_Value *, int, int);
30 char *GPJ_grass_to_wkt2(const struct Key_Value *, const struct Key_Value *, const struct Key_Value *, int, int);
31 #ifdef HAVE_OGR
32 OGRSpatialReferenceH GPJ_grass_to_osr(const struct Key_Value *, const struct Key_Value *);
33 OGRSpatialReferenceH GPJ_grass_to_osr2(const struct Key_Value *, const struct Key_Value *, const struct Key_Value *);
34 const char *GPJ_set_csv_loc(const char *);
35 int GPJ_osr_to_grass(struct Cell_head *, struct Key_Value **,
36  struct Key_Value **, OGRSpatialReferenceH, int);
37 #endif
38 int GPJ_wkt_to_grass(struct Cell_head *, struct Key_Value **,
39  struct Key_Value **, const char *, int);
40 
41 /* datum.c */
42 int GPJ_get_datum_by_name(const char *, struct gpj_datum *);
43 int GPJ_get_default_datum_params_by_name(const char *, char **);
44 int GPJ_get_datum_params(char **, char **);
45 int GPJ__get_datum_params(const struct Key_Value *, char **, char **);
46 void GPJ_free_datum(struct gpj_datum *);
49 
50 /* ellipse.c */
51 int GPJ_get_ellipsoid_by_name(const char *, struct gpj_ellps *);
52 int GPJ_get_ellipsoid_params(double *, double *, double *);
53 int GPJ__get_ellipsoid_params(const struct Key_Value *,
54  double *, double *, double *);
55 void GPJ_free_ellps(struct gpj_ellps *);
56 
57 #ifndef HAVE_PROJ_H
58 /* PROJ.4's private datastructures copied from projects.h as removed
59  from upstream; pending better solution. see:
60  http://trac.osgeo.org/proj/ticket/98 */
61 
62 int pj_factors(LP, void *, double, struct FACTORS *);
63 /* end of copy */
64 #endif
65 
66 #endif
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:170
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:121
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:388
2D/3D raster map header (used also for region)
Definition: gis.h:412
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:932
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:61
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:965
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 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:1544
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:331
int GPJ_get_ellipsoid_params(double *, double *, double *)
Get the ellipsoid parameters from the database.
Definition: ellipse.c:43
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:532
int GPJ__get_ellipsoid_params(const struct Key_Value *, double *, double *, double *)
Get the ellipsoid parameters from proj keys structure.
Definition: ellipse.c:73
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:85
const char * GPJ_set_csv_loc(const char *)
Definition: convert.c:997
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:37
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:1415
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:422
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:361
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
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:152
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:325
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
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:236
void GPJ_free_datum(struct gpj_datum *)
Free the memory used for the strings in a gpj_datum struct.
Definition: proj/datum.c:402
void GPJ_free_ellps(struct gpj_ellps *)
Free ellipsoid data structure.
Definition: ellipse.c:309
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:1152
Definition: gis.h:501
const char * set_proj_share(const char *)
Definition: get_proj.c:496
int pj_factors(LP, void *, double, struct FACTORS *)