# MI - Fimex: MetNoFimex::ProjectionImpl Class Reference

# MetNoFimex::ProjectionImpl Class Reference

`#include <ProjectionImpl.h>`

Inheritance diagram for MetNoFimex::ProjectionImpl:

List of all members.

## Public Member Functions

virtual | ~ProjectionImpl ()
virtual std::vector< CDMAttribute > | getParameters () const
virtual void | addParameter (CDMAttribute attribute)
virtual void | addParameters (std::vector< CDMAttribute > attributes)
virtual void | removeParameter (std::string paramName)
virtual const std::string & | getName () const
virtual const bool | isDegree () const
virtual std::string | getProj4String () const
virtual std::string | toString () const

## Protected Member Functions

| ProjectionImpl (std::string name, bool isDegree)
virtual std::ostream & | getProj4ProjectionPart (std::ostream &) const =0
bool | addParameterToStream (std::ostream &outStream, const std::string &name, std::string replaceName="") const

## Static Protected Member Functions

static bool | proj4ProjectionMatchesName (const std::string &proj4String, const std::string &name)
static void | proj4GetEarthAttributes (const std::string &proj4String, std::vector< CDMAttribute > &attrList)

## Protected Attributes

std::vector< CDMAttribute > | params_

## Detailed Description

ProjectionImpl is a next to complete implementation of Projection, storing all parameters as a vector<CDMAttribute>. Implementations only need to implement a constructor calling the ProjectionImpl("proj-name") and the method getProj4ProjectionPart()

Note:
  the implemented projection needs to get made visible in Projection::create() and Projection::createByProj4

## Constructor & Destructor Documentation

virtual MetNoFimex::ProjectionImpl::~ProjectionImpl | ( |  | ) | `[virtual]`

MetNoFimex::ProjectionImpl::ProjectionImpl | ( | std::string | name,
|  | bool | isDegree |
| ) |  |  | `[explicit, protected]`

## Member Function Documentation

virtual std::vector<CDMAttribute> MetNoFimex::ProjectionImpl::getParameters | ( |  | ) | const`[virtual]`

Implements MetNoFimex::Projection.

virtual void MetNoFimex::ProjectionImpl::addParameter | ( | CDMAttribute | attribute | ) | `[virtual]`

Implements MetNoFimex::Projection.

virtual void MetNoFimex::ProjectionImpl::addParameters | ( | std::vector< CDMAttribute > | attributes | ) | `[virtual]`

Implements MetNoFimex::Projection.

virtual void MetNoFimex::ProjectionImpl::removeParameter | ( | std::string | paramName | ) | `[virtual]`

Implements MetNoFimex::Projection.

virtual const std::string& MetNoFimex::ProjectionImpl::getName | ( |  | ) | const`[virtual]`

get the projection name

Implements MetNoFimex::Projection.

virtual const bool MetNoFimex::ProjectionImpl::isDegree | ( |  | ) | const`[virtual]`

check if the coordinates belonging to this projection are in degree (otherwise metrical)

Implements MetNoFimex::Projection.

virtual std::string MetNoFimex::ProjectionImpl::getProj4String | ( |  | ) | const`[virtual]`

get the proj4 string defined by the parameters. If a parameter named 'proj4' exists, that one will be used and all other parameters will be ignored.

Note:
  Implementors should not overwrite this method, but the protected getProj4ProjectionPart() method

Implements MetNoFimex::Projection.

virtual std::string MetNoFimex::ProjectionImpl::toString | ( |  | ) | const`[virtual]`

get a string representation

Implements MetNoFimex::Projection.

static bool MetNoFimex::ProjectionImpl::proj4ProjectionMatchesName | ( | const std::string & | proj4String,
|  | const std::string & | name |
| ) |  |  | `[static, protected]`

match the +proj= part of a proj4 string

static void MetNoFimex::ProjectionImpl::proj4GetEarthAttributes | ( | const std::string & | proj4String,
|  | std::vector< CDMAttribute > & | attrList |
| ) |  |  | `[static, protected]`

add the attributes describing the earth from a proj4-string to the outAttrs

Parameters:

  | proj4String | string as used for proj4
  | output | list of CDMAttributes

virtual std::ostream& MetNoFimex::ProjectionImpl::getProj4ProjectionPart | ( | std::ostream & |  | ) | const`[protected, pure virtual]`

add the pure projection parameters for proj4 to the stream, i.e. no earth definitions, and no +no_defs

Implemented in MetNoFimex::LambertConformalConicProjection, MetNoFimex::LatitudeLongitudeProjection, MetNoFimex::MercatorProjection, MetNoFimex::RotatedLatitudeLongitudeProjection, MetNoFimex::StereographicProjection, and MetNoFimex::TransverseMercatorProjection.

bool MetNoFimex::ProjectionImpl::addParameterToStream | ( | std::ostream & | outStream,
|  | const std::string & | name,
|  | std::string | replaceName = `""` |
| ) |  |  | const`[protected]`

Add the numeric value of a parameter named name as replaceName to oproj, e.g. name = false_easting, replaceName = +x_0, sets "+x_0=... " Assume only one value at maximum

Parameters:

  | outStream |
  | name | the parameters name
  | replaceName | the name to use in the stream to the parameter, defaults to original name ("")

Returns:
  true if parameter found and set

## Member Data Documentation

std::vector<CDMAttribute> MetNoFimex::ProjectionImpl::params_ `[protected]`

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

- include/fimex/coordSys/ProjectionImpl.h