Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected 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 createProjection (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 int extractEPSG (const std::string &projDef)
 

Static Public Attributes

static const std::string proj4version = drain::StringBuilder<'.'>(PROJ_VERSION_MAJOR, PROJ_VERSION_MINOR, PROJ_VERSION_PATCH)
 

Protected Member Functions

void storeProjDef (const std::string &str)
 

Static Protected Member Functions

static void getProjDefStr (const ProjDef &dict, std::stringstream &sstr, const std::set< std::string > &excludeKeys={"+type"})
 
static bool isLongLat (const PJ *prj)
 For setting projection. More...
 

Protected Attributes

PJ_CONTEXT * pjContext
 Metadata for PROJ (introduced in latest versions, currently not used by Drain & Rack )
 
PJ * pj
 Essential member: the pointer to a PJ object. This is the primary description of state.
 
ProjDef projDefDict
 Secondary description of state.
 
int epsg = 0
 
std::map< PROJDEF_variant, std::string > projDefs
 

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: