libimage  0.25.4
 All Classes Namespaces Files Functions Variables Enumerations Macros Pages
Public Member Functions | Private Attributes | List of all members
CRS Class Reference

Reference systems handler. More...

#include <CRS.h>

Collaboration diagram for CRS:
Collaboration graph

Public Member Functions

 CRS ()
 Create a CRS without Proj correspondance.
 CRS (std::string crs_code)
 Create a CRS from its identifier.
 CRS (const CRS &crs)
 Copy Constructor.
CRSoperator= (CRS const &other)
 Assignement.
bool operator== (const CRS &crs) const
 Test whether 2 CRS are equals.
bool operator!= (const CRS &crs) const
 Test whether 2 CRS are different.
void buildProj4Code ()
 Determine the Proj code from the requested CRS.
void fetchDefinitionArea ()
 Fetch the CRS definition area from Proj registries.
bool isProj4Compatible ()
 Test whether the CRS has a Proj equivalent.
bool isLongLat ()
 Test whether the CRS is geographic.
long double getMetersPerUnit ()
 Amount of meter in one CRS's unit.
void setRequestCode (std::string crs)
 Assign a new code to the CRS.
bool cmpRequestCode (std::string crs)
 Compare the CRS original code with the supplied string.
std::string getAuthority ()
 Return the CRS authority.
std::string getIdentifier ()
 Return the CRS identifier without the authority.
bool isDefine ()
 Return the CRS identifier from Proj registry.
std::string getRequestCode ()
 Return the CRS identifier from the WMS request.
std::string getProj4Code ()
 Return the CRS identifier from Proj registry.
BoundingBox< double > boundingBoxFromGeographic (BoundingBox< double > geographicBBox)
 Compute a BoundingBox in the current CRS from a geographic BoundingBox.
BoundingBox< double > boundingBoxFromGeographic (double minx, double miny, double maxx, double maxy)
 Compute a BoundingBox in the current CRS from a geographic BoundingBox.
BoundingBox< double > boundingBoxToGeographic (BoundingBox< double > projectedBBox)
 Compute a geographic BoundingBox from a BoundingBox in the current CRS.
BoundingBox< double > boundingBoxToGeographic (double minx, double miny, double maxx, double maxy)
 Compute a geographic BoundingBox from a BoundingBox in the current CRS.
bool validateBBox (BoundingBox< double > BBox)
 Verify if the supplied BoundingBox is in the CRS definition area.
bool validateBBox (double minx, double miny, double maxx, double maxy)
 Verify if the supplied BoundingBox is in the CRS definition area.
bool validateBBoxGeographic (BoundingBox< double > BBox)
 Verify if the supplied BoundingBox is in the CRS definition area.
bool validateBBoxGeographic (double minx, double miny, double maxx, double maxy)
 Verify if the supplied BoundingBox is in the CRS definition area.
BoundingBox< double > cropBBox (BoundingBox< double > BBox)
 Compute a BoundingBox included in the current CRS definition area.
BoundingBox< double > cropBBox (double minx, double miny, double maxx, double maxy)
 Compute a BoundingBox included in the current CRS definition area.
BoundingBox< double > cropBBoxGeographic (BoundingBox< double > BBox)
 Compute a BoundingBox included in the current CRS definition area.
BoundingBox< double > cropBBoxGeographic (double minx, double miny, double maxx, double maxy)
 Compute a BoundingBox included in the current CRS definition area.
std::string getProj4Def ()
 Return the complete definition of the CRS from Proj registry.
std::string getProj4Param (std::string paramName)
 Return the value of a parameter in complete definition of the CRS from Proj registry.
bool testProj4Param (std::string paramName)
 Return true if a parameter exists.
 ~CRS ()
 Default destructor.

Private Attributes

std::string requestCode
 CRS identifier from the WMS request.
std::string proj4Code
 CRS identifier from Proj registry.
BoundingBox< double > definitionArea
 CRS's definition area.

Detailed Description

Reference systems handler.

Author
Institut national de l'information géographique et forestière

A CRS allow to link the WMS and the Proj library identifiers. Functions are availlable to work with bounding boxes (reprojection, cropping on the definition area)

Constructor & Destructor Documentation

CRS::CRS ( std::string  crs_code)

Create a CRS from its identifier.

The string is compared, case insensitively, to Proj registry. Then the corresponding definition area is fetched from Proj.

Parameters
[in]crs_codeCRS identifier

Here is the call graph for this function:

CRS::CRS ( const CRS crs)

Copy Constructor.

Create a CRS from another

Parameters
[in]crsCRS to copy

Here is the call graph for this function:

Member Function Documentation

BoundingBox< double > CRS::boundingBoxFromGeographic ( BoundingBox< double >  geographicBBox)

Compute a BoundingBox in the current CRS from a geographic BoundingBox.

Parameters
[in]geographicBBoxa BoundingBox in geographic coordinate WGS84
Returns
the same BoundingBox in the current CRS

Here is the caller graph for this function:

BoundingBox< double > CRS::boundingBoxFromGeographic ( double  minx,
double  miny,
double  maxx,
double  maxy 
)

Compute a BoundingBox in the current CRS from a geographic BoundingBox.

Parameters
[in]minxx-coordinate of the bottom left corner of the boundingBox in WGS84
[in]minyy-coordinate of the bottom left corner of the boundingBox in WGS84
[in]maxxx-coordinate of the top right corner of the boundingBox in WGS84
[in]maxyy-coordinate of the top right corner of the boundingBox in WGS84
Returns
the same BoundingBox in the current CRS

Here is the call graph for this function:

BoundingBox< double > CRS::boundingBoxToGeographic ( BoundingBox< double >  projectedBBox)

Compute a geographic BoundingBox from a BoundingBox in the current CRS.

Parameters
[in]geographicBBoxa BoundingBox in the current CRS
Returns
the same BoundingBox in WGS84

Here is the caller graph for this function:

BoundingBox< double > CRS::boundingBoxToGeographic ( double  minx,
double  miny,
double  maxx,
double  maxy 
)

Compute a geographic BoundingBox from a BoundingBox in the current CRS.

Parameters
[in]minxx-coordinate of the bottom left corner of the boundingBox in the current CRS
[in]minyy-coordinate of the bottom left corner of the boundingBox in the current CRS
[in]maxxx-coordinate of the top right corner of the boundingBox in the current CRS
[in]maxyy-coordinate of the top right corner of the boundingBox in the current CRS
Returns
the same BoundingBox in WGS84

Here is the call graph for this function:

bool CRS::cmpRequestCode ( std::string  crs)

Compare the CRS original code with the supplied string.

Parameters
[in]crsstring for comparison
Returns
true if identic (case insensitive)

Here is the call graph for this function:

BoundingBox< double > CRS::cropBBox ( BoundingBox< double >  BBox)

Compute a BoundingBox included in the current CRS definition area.

Parameters
[in]BBoxa BoundingBox in the current CRS
Returns
the cropped BoundingBox

Here is the call graph for this function:

Here is the caller graph for this function:

BoundingBox< double > CRS::cropBBox ( double  minx,
double  miny,
double  maxx,
double  maxy 
)

Compute a BoundingBox included in the current CRS definition area.

Parameters
[in]minxx-coordinate of the bottom left corner of the boundingBox in the current CRS
[in]minyy-coordinate of the bottom left corner of the boundingBox in the current CRS
[in]maxxx-coordinate of the top right corner of the boundingBox in the current CRS
[in]maxyy-coordinate of the top right corner of the boundingBox in the current CRS
Returns
the cropped BoundingBox

Here is the call graph for this function:

BoundingBox< double > CRS::cropBBoxGeographic ( BoundingBox< double >  BBox)

Compute a BoundingBox included in the current CRS definition area.

Parameters
[in]geographicBBoxa BoundingBox in WGS84
Returns
the cropped BoundingBox

Here is the caller graph for this function:

BoundingBox< double > CRS::cropBBoxGeographic ( double  minx,
double  miny,
double  maxx,
double  maxy 
)

Compute a BoundingBox included in the current CRS definition area.

Parameters
[in]minxx-coordinate of the bottom left corner of the boundingBox in WGS84
[in]minyy-coordinate of the bottom left corner of the boundingBox in WGS84
[in]maxxx-coordinate of the top right corner of the boundingBox in WGS84
[in]maxyy-coordinate of the top right corner of the boundingBox in WGS84
Returns
the cropped BoundingBox

Here is the call graph for this function:

std::string CRS::getAuthority ( )

Return the CRS authority.

Returns
the authority identifier
std::string CRS::getIdentifier ( )

Return the CRS identifier without the authority.

Returns
the system identifier
long double CRS::getMetersPerUnit ( )

Amount of meter in one CRS's unit.

Returns
quotient between meter and CRS's unit
Todo:
Support all CRS types not only projected in meter and geographic in degree

Here is the call graph for this function:

std::string CRS::getProj4Code ( )
inline

Return the CRS identifier from Proj registry.

Returns
CRS identifier

Here is the caller graph for this function:

std::string CRS::getProj4Def ( )

Return the complete definition of the CRS from Proj registry.

Returns
CRS definition

Here is the call graph for this function:

Here is the caller graph for this function:

std::string CRS::getProj4Param ( std::string  paramName)

Return the value of a parameter in complete definition of the CRS from Proj registry.

Parameters
[in]paramparameter name
Returns
parameter value

Here is the call graph for this function:

std::string CRS::getRequestCode ( )
inline

Return the CRS identifier from the WMS request.

Returns
CRS identifier
bool CRS::isDefine ( )
inline

Return the CRS identifier from Proj registry.

Returns
CRS identifier

Here is the caller graph for this function:

bool CRS::isLongLat ( )

Test whether the CRS is geographic.

Returns
true if geographic

Here is the call graph for this function:

Here is the caller graph for this function:

bool CRS::isProj4Compatible ( )

Test whether the CRS has a Proj equivalent.

Returns
true if available in Proj
bool CRS::operator!= ( const CRS crs) const

Test whether 2 CRS are different.

Returns
true if the the Proj identifier is different
bool CRS::operator== ( const CRS crs) const

Test whether 2 CRS are equals.

Returns
true if they share the same Proj identifier
void CRS::setRequestCode ( std::string  crs)

Assign a new code to the CRS.

The string is compared, case insensitively, to Proj registry. Then the corresponding definition area is fetched from Proj.

Parameters
[in]crs_codeCRS identifier

Here is the call graph for this function:

bool CRS::testProj4Param ( std::string  paramName)

Return true if a parameter exists.

Parameters
[in]paramparameter name
Returns
bool

Here is the call graph for this function:

bool CRS::validateBBox ( BoundingBox< double >  BBox)

Verify if the supplied BoundingBox is in the CRS definition area.

Parameters
[in]geographicBBoxa BoundingBox in the current CRS
Returns
true if inside

Here is the call graph for this function:

bool CRS::validateBBox ( double  minx,
double  miny,
double  maxx,
double  maxy 
)

Verify if the supplied BoundingBox is in the CRS definition area.

Parameters
[in]minxx-coordinate of the bottom left corner of the boundingBox in the current CRS
[in]minyy-coordinate of the bottom left corner of the boundingBox in the current CRS
[in]maxxx-coordinate of the top right corner of the boundingBox in the current CRS
[in]maxyy-coordinate of the top right corner of the boundingBox in the current CRS
Returns
true if inside

Here is the call graph for this function:

bool CRS::validateBBoxGeographic ( BoundingBox< double >  BBox)

Verify if the supplied BoundingBox is in the CRS definition area.

Parameters
[in]geographicBBoxa BoundingBox in WGS84
Returns
true if inside

Here is the caller graph for this function:

bool CRS::validateBBoxGeographic ( double  minx,
double  miny,
double  maxx,
double  maxy 
)

Verify if the supplied BoundingBox is in the CRS definition area.

Parameters
[in]minxx-coordinate of the bottom left corner of the boundingBox in WGS84
[in]minyy-coordinate of the bottom left corner of the boundingBox in WGS84
[in]maxxx-coordinate of the top right corner of the boundingBox in WGS84
[in]maxyy-coordinate of the top right corner of the boundingBox in WGS84
Returns
true if inside

Here is the call graph for this function:


The documentation for this class was generated from the following files: