VAPOR3 3.9.4
Public Member Functions | List of all members
VAPoR::Proj4API Class Reference

Wrapper for proj4 C API. More...

#include <Proj4API.h>

Inheritance diagram for VAPoR::Proj4API:
Wasp::MyBase

Public Member Functions

 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
 
- Public Member Functions inherited from Wasp::MyBase
 MyBase ()
 
const string & getClassName () const
 

Additional Inherited Members

- Public Types inherited from Wasp::MyBase
typedef void(* ErrMsgCB_T) (const char *msg, int err_code)
 
typedef void(* DiagMsgCB_T) (const char *msg)
 
- Static Public Member Functions inherited from Wasp::MyBase
static void SetErrMsg (const char *format,...)
 Record a formatted error message.
 
static void SetErrMsg (int errcode, const char *format,...)
 Record a formatted error message and an error code.
 
static const char * GetErrMsg ()
 
static void SetErrCode (int err_code)
 Record an error code.
 
static int GetErrCode ()
 Retrieve the current error code.
 
static void SetErrMsgCB (ErrMsgCB_T cb)
 
static ErrMsgCB_T GetErrMsgCB ()
 
static void SetErrMsgFilePtr (FILE *fp)
 
static const FILE * SetErrMsgFilePtr ()
 
static void SetDiagMsg (const char *format,...)
 Record a formatted diagnostic message.
 
static const char * GetDiagMsg ()
 
static void SetDiagMsgCB (DiagMsgCB_T cb)
 
static DiagMsgCB_T GetDiagMsgCB ()
 
static void SetDiagMsgFilePtr (FILE *fp)
 
static bool EnableErrMsg (bool enable)
 
static bool GetEnableErrMsg ()
 
- Static Public Attributes inherited from Wasp::MyBase
static char * ErrMsg
 
static int ErrCode
 
static int ErrMsgSize
 
static FILE * ErrMsgFilePtr
 
static ErrMsgCB_T ErrMsgCB
 
static char * DiagMsg
 
static int DiagMsgSize
 
static FILE * DiagMsgFilePtr
 
static DiagMsgCB_T DiagMsgCB
 
static bool Enabled
 
- Protected Member Functions inherited from Wasp::MyBase
void SetClassName (const string &name)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Proj4API()

VAPoR::Proj4API::Proj4API ( )

◆ ~Proj4API()

VAPoR::Proj4API::~Proj4API ( )

Member Function Documentation

◆ 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]srcdefThe source proj4 transformation definition. If empty, the string "+proj=latlong" is used.
[in]dstdefThe destintation proj4 transformation definition. If empty, the string "+proj=latlong" is used.
Return values
statusRetruns 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]xarray of longitudes or PCS X values
[in,out]yarray of latitudes or PCS Y values
[in]nnum elements in x, y, and z
[in]offsetOffset between adjacent values in the input and output arrays.
Return values
statusRetruns 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: