Public Types | Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
Projector Class Reference
Collaboration diagram for Projector:
Collaboration graph
[legend]

Public Types

enum  CRS_mode { ACCEPT_CRS , REMOVE_CRS , FORCE_CRS }
 
enum  PROJDEF_variant {
  ORIG , MODIFIED , PROJ4 , PROJ5 ,
  SIMPLE
}
 Each projector has three (3) versions of project definition.
 
typedef drain::Dictionary< std::string, std::string > ProjDef
 

Public Member Functions

 Projector (const std::string &projDef="", CRS_mode crs=ACCEPT_CRS)
 
 Projector (PJ_CONTEXT *pjContext, const std::string &projDef="", CRS_mode crs=ACCEPT_CRS)
 
 Projector (const Projector &pr)
 
const std::string & getProjDef (PROJDEF_variant v=SIMPLE) const
 
void clear ()
 Deletes projection object and clears all the metadata.
 
void setProjection (const std::string &str, CRS_mode crs=FORCE_CRS)
 Sets projection defined as Proj string.
 
void setProjection (int epsg, CRS_mode crs=FORCE_CRS)
 Sets projection defined as EPSG code.
 
void updateProjectionDefs (CRS_mode crs)
 
bool isSet () const
 Returns true, if PJ object has been set.
 
bool isLongLat () const
 
int getEPSG () const
 
void info (std::ostream &ostr=std::cout, int wkt=-1)
 Prunes "+init=epsg:<...>" and optionally "+type=crs" codes.
 
std::string getErrorString () const
 
void info (PJ *pj, std::ostream &ostr=std::cout, int wkt=-1)
 Dump misc information, for debugging.
 

Static Public Member Functions

static void getProjDefDict (const std::string &str, ProjDef &dict)
 
static int extractEPSG (const ProjDef &projDefDict)
 
static void getProjDefStr (const ProjDef &dict, std::stringstream &sstr, const std::set< std::string > &excludeKeys={"+type"})
 

Static Protected Member Functions

static bool isLongLat (const PJ *prj)
 For setting projection. More...
 

Protected Attributes

ProjDef projDefDict
 
std::map< PROJDEF_variant, std::string > projDefs
 
PJ_CONTEXT * pjContext
 
PJ * pj
 
int epsg
 

Friends

class Proj6
 

Member Function Documentation

◆ isLongLat()

bool isLongLat ( const PJ *  prj)
staticprotected

For setting projection.

Parameters
projStr- string in Proj format
CRS- set or unset

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