RAVE
projection.h
Go to the documentation of this file.
1/* --------------------------------------------------------------------
2Copyright (C) 2009 Swedish Meteorological and Hydrological Institute, SMHI,
3
4This file is part of RAVE.
5
6RAVE is free software: you can redistribute it and/or modify
7it under the terms of the GNU Lesser General Public License as published by
8the Free Software Foundation, either version 3 of the License, or
9(at your option) any later version.
10
11RAVE is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU Lesser General Public License for more details.
15
16You should have received a copy of the GNU Lesser General Public License
17along with RAVE. If not, see <http://www.gnu.org/licenses/>.
18------------------------------------------------------------------------*/
26#ifndef PROJECTION_H
27#define PROJECTION_H
28
29#include "rave_object.h"
30#include "rave_proj.h"
31
36
41
46void Projection_setDebugLevel(int debugPj);
47
53
58const char* Projection_getProjVersion(void);
59
64void Projection_setDefaultLonLatProjDef(const char* projdef);
65
71
75int Projection_init(Projection_t* projection, const char* id, const char* description, const char* definition);
76
90Projection_t* Projection_create(const char* id, const char* description, const char* definition);
91
97
103const char* Projection_getID(Projection_t* projection);
104
110const char* Projection_getDescription(Projection_t* projection);
111
117const char* Projection_getDefinition(Projection_t* projection);
118
124int Projection_isLatLong(Projection_t* projection);
125
136int Projection_transform(Projection_t* projection, Projection_t* tgt, double* x, double* y, double* z);
137
155 double x, double y, double z, double* ox, double* oy, double* oz);
156
166int Projection_inv(Projection_t* projection, double x, double y, double* lon, double* lat);
167
177int Projection_fwd(Projection_t* projection, double lon, double lat, double* x, double* y);
178
179#endif
const char * Projection_getDefinition(Projection_t *projection)
Returns the definition for this projection.
Definition projection.c:268
const char * Projection_getID(Projection_t *projection)
Returns the ID for this projection.
Definition projection.c:256
int Projection_init(Projection_t *projection, const char *id, const char *description, const char *definition)
Initializes a projection with the projection.
Definition projection.c:181
RaveCoreObjectType Projection_TYPE
Type definition to use when creating a rave object.
Definition projection.c:514
const char * Projection_getProjVersion(void)
Returns the currently used Proj version.
Definition projection.c:146
Projection_t * Projection_createDefaultLonLatProjection(void)
Creates a default lon lat projection by using the default lonlat pcs definition.
Definition projection.c:244
int Projection_inv(Projection_t *projection, double x, double y, double *lon, double *lat)
Translates surface coordinate into lon/lat.
Definition projection.c:454
int Projection_getDebugLevel(void)
Returns the debug level when using proj API.
Definition projection.c:142
const char * Projection_getDescription(Projection_t *projection)
Returns the description for this projection.
Definition projection.c:262
const char * Projection_getDefaultLonLatProjDef(void)
Returns the default lonlat proj definition.
Definition projection.c:172
int Projection_transform(Projection_t *projection, Projection_t *tgt, double *x, double *y, double *z)
Transforms the coordinates in this projection into the target projection.
Definition projection.c:334
int Projection_transformx(Projection_t *projection, Projection_t *tgt, double x, double y, double z, double *ox, double *oy, double *oz)
This is an alternate version of Projection_transform.
Definition projection.c:390
Projection_t * Projection_create(const char *id, const char *description, const char *definition)
Creates a projection directly.
Definition projection.c:232
void Projection_setDebugLevel(int debugPj)
Sets the debug level when using proj API.
Definition projection.c:138
int Projection_isLatLong(Projection_t *projection)
Returns if this projection is a latlong or not.
Definition projection.c:274
int Projection_fwd(Projection_t *projection, double lon, double lat, double *x, double *y)
Translates lon/lat coordinate into a surface coordinate.
Definition projection.c:485
void Projection_setDefaultLonLatProjDef(const char *projdef)
Sets the default lon/lat proj definition to use.
Definition projection.c:165
Generic implementation of an object that is used within rave.
Handles compatibility issues related to PROJ versions and the definitions.
Represents one projection.
Definition projection.c:55
char * description
the description
Definition projection.c:59
char * definition
the proj.4 definition string
Definition projection.c:60
The rave object type definition.
Definition rave_object.h:52