Wrapper for proj4 C API.
More...
#include <Proj4API.h>
|
| Proj4API () |
|
| ~Proj4API () |
|
int | Initialize (string srcdef, string dstdef) |
|
int | Transform (double *x, double *y, size_t n, int offset=1) const |
|
int | Transform (double *x, double *y, double *z, size_t n, int offset=1) const |
|
int | Transform (float *x, float *y, size_t n, int offset=1) const |
|
int | Transform (float *x, float *y, float *z, size_t n, int offset=1) const |
|
bool | IsLatLonSrc () const |
|
bool | IsLatLonDst () const |
|
bool | IsGeocentSrc () const |
|
bool | IsGeocentDst () const |
|
string | GetSrcStr () const |
| Return the current source projection definition string.
|
|
string | GetDstStr () const |
| Return the current destination projection definition string.
|
|
int | Transform (string srcdef, string dstdef, double *x, double *y, double *z, size_t n, int offset) const |
|
int | Transform (string srcdef, string dstdef, float *x, float *y, float *z, size_t n, int offset) const |
|
string | ProjErr () const |
|
void | Clamp (double *x, double *y, size_t n, int offset) const |
|
bool | IsCylindrical () const |
|
| MyBase () |
|
const string & | getClassName () const |
|
Wrapper for proj4 C API.
- Author
- John Clyne
This class provides a convience wrapper for the proj4 Cartographic Projections Library http://trac.osgeo.org/proj/
Definition at line 17 of file Proj4API.h.
◆ Proj4API()
VAPoR::Proj4API::Proj4API |
( |
| ) |
|
◆ ~Proj4API()
VAPoR::Proj4API::~Proj4API |
( |
| ) |
|
◆ Clamp()
void VAPoR::Proj4API::Clamp |
( |
double * |
x, |
|
|
double * |
y, |
|
|
size_t |
n, |
|
|
int |
offset |
|
) |
| const |
Clamp the input values to bounds permitted by the source projection. If the source projection is not recognized the method is a no-op
◆ GetDstStr()
string VAPoR::Proj4API::GetDstStr |
( |
| ) |
const |
Return the current destination projection definition string.
◆ GetSrcStr()
string VAPoR::Proj4API::GetSrcStr |
( |
| ) |
const |
Return the current source projection definition string.
◆ Initialize()
int VAPoR::Proj4API::Initialize |
( |
string |
srcdef, |
|
|
string |
dstdef |
|
) |
| |
Initialize the class
Initializes the class with source and destination proj4 transformation strings.
- Parameters
-
[in] | srcdef | The source proj4 transformation definition. If empty, the string "+proj=latlong" is used. |
[in] | dstdef | The destintation proj4 transformation definition. If empty, the string "+proj=latlong" is used. |
- Return values
-
status | Retruns a negative int on failure |
- See also
- pj_init_plus()
◆ IsCylindrical()
bool VAPoR::Proj4API::IsCylindrical |
( |
| ) |
const |
Return true if the destination projection is cylindrical
Returns true if the destination projection string is either cylindrical "eqc", or mercator "merc"
◆ IsGeocentDst()
bool VAPoR::Proj4API::IsGeocentDst |
( |
| ) |
const |
◆ IsGeocentSrc()
bool VAPoR::Proj4API::IsGeocentSrc |
( |
| ) |
const |
◆ IsLatLonDst()
bool VAPoR::Proj4API::IsLatLonDst |
( |
| ) |
const |
Return true of destination projection definition is lat-long
This method returns true iff the destination projection definition is geographic (i.e. +proj=latlong). If true, subsequent transforms will return output values in geographic coordinates (i.e. degrees) False is returned otherwise
- See also
- Initialize(), pj_is_latlong()
◆ IsLatLonSrc()
bool VAPoR::Proj4API::IsLatLonSrc |
( |
| ) |
const |
Return true of source projection definition is lat-long
This method returns true iff the source projection definition is geographic (i.e. +proj=latlong). If true, subsequent transforms expect input values to be in geographic coordinates (i.e. degrees) False is returned otherwise
- See also
- Initialize(), pj_is_latlong()
◆ ProjErr()
string VAPoR::Proj4API::ProjErr |
( |
| ) |
const |
Return the error string generated by the proj4 C API for the most recent error
- See also
- pj_strerrno()
◆ Transform() [1/6]
int VAPoR::Proj4API::Transform |
( |
double * |
x, |
|
|
double * |
y, |
|
|
double * |
z, |
|
|
size_t |
n, |
|
|
int |
offset = 1 |
|
) |
| const |
◆ Transform() [2/6]
int VAPoR::Proj4API::Transform |
( |
double * |
x, |
|
|
double * |
y, |
|
|
size_t |
n, |
|
|
int |
offset = 1 |
|
) |
| const |
Transform coordinates
Transforms coordinates based on defintions of the source and destination proj4 transformation definitions passed to Initialize(). Transformations are performed between Geographic coordinates (latitude and longitude) and Cartographic coordinates (Cartesian) as specified by the transformation definitions. Cartographic coordinates are referred to as the Projection Coordinate System (PCS). Default units for the PCS are meters on the ground. Geographic coordinates are always in degrees.
- Note
- As with the proj4 C library the transformations are performed in place, modifiying the input values
- Parameters
-
[in,out] | x | array of longitudes or PCS X values |
[in,out] | y | array of latitudes or PCS Y values |
[in] | n | num elements in x, y, and z |
[in] | offset | Offset between adjacent values in the input and output arrays. |
- Return values
-
status | Retruns a negative int on failure |
- See also
- Initialize(), pj_transform()
◆ Transform() [3/6]
int VAPoR::Proj4API::Transform |
( |
float * |
x, |
|
|
float * |
y, |
|
|
float * |
z, |
|
|
size_t |
n, |
|
|
int |
offset = 1 |
|
) |
| const |
◆ Transform() [4/6]
int VAPoR::Proj4API::Transform |
( |
float * |
x, |
|
|
float * |
y, |
|
|
size_t |
n, |
|
|
int |
offset = 1 |
|
) |
| const |
◆ Transform() [5/6]
int VAPoR::Proj4API::Transform |
( |
string |
srcdef, |
|
|
string |
dstdef, |
|
|
double * |
x, |
|
|
double * |
y, |
|
|
double * |
z, |
|
|
size_t |
n, |
|
|
int |
offset |
|
) |
| const |
◆ Transform() [6/6]
int VAPoR::Proj4API::Transform |
( |
string |
srcdef, |
|
|
string |
dstdef, |
|
|
float * |
x, |
|
|
float * |
y, |
|
|
float * |
z, |
|
|
size_t |
n, |
|
|
int |
offset |
|
) |
| const |
The documentation for this class was generated from the following file: