Isis 3 Programmer Reference
Isis::ProjectionFactory Class Reference

Initialize a map projection. More...

#include <ProjectionFactory.h>

Collaboration diagram for Isis::ProjectionFactory:
Collaboration graph

Static Public Member Functions

static Isis::ProjectionCreate (Isis::Pvl &label, bool allowDefaults=false)
 This method returns a pointer to a Projection object.
 
static Isis::ProjectionRingsCreate (Isis::Pvl &label, bool allowDefaults=false)
 This method returns a pointer to a RingPlaneProjection object.
 
static Isis::ProjectionCreateFromCube (Isis::Cube &cube)
 This method is a helper method.
 
static Isis::ProjectionRingsCreateFromCube (Isis::Cube &cube)
 This method is a helper method.
 
static Isis::ProjectionCreateFromCube (Isis::Pvl &label)
 This method loads a map projection from a cube returning a pointer to a Projection object.
 
static Isis::ProjectionRingsCreateFromCube (Isis::Pvl &label)
 This method loads a map projection from a cube returning a pointer to a Projection object.
 
static Isis::ProjectionCreateForCube (Isis::Pvl &label, int &ns, int &nl, bool sizeMatch=true)
 This method creates a map projection for a cube given a label.
 
static Isis::ProjectionRingsCreateForCube (Isis::Pvl &label, int &samples, int &lines, bool sizeMatch)
 This method creates a projection for a cube to a ring plane given a label.
 
static Isis::ProjectionCreateForCube (Isis::Pvl &label, int &samples, int &lines, Camera &cam)
 Create a map projection group for a cube using a camera.
 
static Isis::ProjectionRingsCreateForCube (Isis::Pvl &label, int &samples, int &lines, Camera &cam)
 Create a ring plane map projection group for a cube using a camera.
 

Private Member Functions

 ProjectionFactory ()
 Constructor (Its private, so you cannot use it.) Use the Create method instead.
 
 ~ProjectionFactory ()
 Destroys the ProjectionFactory object.
 

Static Private Attributes

static Plugin m_projPlugin
 

Detailed Description

Initialize a map projection.

This factory class is used to obtain a Projection object given a PVL which contains a valid Mapping group. The Mapping group can come from an image/cube or a hand-created PVL file. The projection is loaded based on information using the ProjectionName contained in the Mapping group. It is plugin oriented. That is, this class looks in $ISISROOT/lib/Projection.plugin to convert the ProjectionName into a pointer to the appropriate projection class (e.g., Sinusoidal, SimpleCylindrical). This allows programmers who develop new projection to create a plugin without the need for recompiling all the Isis cartographic programs (cam2map, map2map, mappos, etc).

Author
2005-06-22 Elizabeth Ribelin
History

2005-06-22 Elizabeth Ribelin - Merged ProjectionManager and CubeProjection into a single class

2006-01-27 Jacob Danton - Renamed PixelMapper to PFPixelMapper

2006-05-19 Elizabeth Miller - Depricated ProjectionManager and CubeProjection. Renamed ProjectionManager.plugin to Projection.plugin

2006-09-07 Elizabeth Miller - Added the bool sizeMatch parameter to CreateForCube()

2007-03-13 Jeff Anderson - Added new method CreateForCube using a camera

2007-06-29 Steven Lambright - Removed TrueScaleLatitude keyword from CreateForCube methods, added units to Scale and PixelResolution keywords

2008-06-18 Steven Koechle - Fixed Documentation Error

2009-06-18 Jeff Anderson - Modified the CreateForCube method to make sure extra pixels were not included in the image size due to machine precision roundoff problems.

2011-02-10 Jai Rideout - UpperLeftCornerX and UpperLeftCornerY are now set in projection mapping group via the new SetUpperLeftCorner method in Projection.

2011-05-23 Jannet Barrett and Steven Lambright - Added m_projPlugin to reduce cost of instantiating Projections.

2013-03-13 Debbie A. Cook - Modified to differentiate between Project subclasses: TProjection and RingPlaneProjection.

2013-05-09 Jeannie Backer - Modified CreateForCube and RingsCreateForCube() methods to ensure that the distances from the MinimumX to the MaximumX and from the MinimumY to the MaximumY are at least one pixel resolution. This ensures that the created cube will have at least one sample and at least one line. References #775.

2014-01-16 Kimberly Oyama - Updated the error messages for unsupported projections to include the source of the error. Fixes #988.

2016-09-02 Tyler Wilson - Fixed a bug in the CreateForCube function because it was producing an unequal number of lines/samples for maps from projections that are symmetric about the prime meridian or the equator. Fixes #2245.

Definition at line 75 of file ProjectionFactory.h.

Constructor & Destructor Documentation

◆ ProjectionFactory()

Isis::ProjectionFactory::ProjectionFactory ( )
inlineprivate

Constructor (Its private, so you cannot use it.) Use the Create method instead.

Definition at line 101 of file ProjectionFactory.h.

◆ ~ProjectionFactory()

Isis::ProjectionFactory::~ProjectionFactory ( )
inlineprivate

Destroys the ProjectionFactory object.

Definition at line 104 of file ProjectionFactory.h.

Member Function Documentation

◆ Create()

Isis::Projection * Isis::ProjectionFactory::Create ( Isis::Pvl & label,
bool allowDefaults = false )
static

This method returns a pointer to a Projection object.

The projection is intialized using information contained in a Label object. The information must be a valid Mapping group as defined in the Isis Map Projection Users Guide.

Parameters
labelThe label object containing a valid mapping group.
allowDefaultsIf false then the projection class as indicated by the ProjectionName keyword will require that projection specific parameters such as CenterLatitude, CenterLongitude, etc must be in the Pvl label object. Otherwise if true then those parameters that are not in the Pvl object will be initialized using the latitude/longitude range.
Returns
A pointer to a Projection object.
Exceptions
Isis::iException::System- Unsupported projection, unable to find plugin

Definition at line 51 of file ProjectionFactory.cpp.

References Isis::PvlObject::findGroup(), Isis::IException::Io, Isis::PvlObject::Traverse, and Isis::IException::Unknown.

Referenced by Isis::TiffImporter::convertProjection(), CreateForCube(), CreateForCube(), CreateFromCube(), Isis::ProjectionConfigDialog::createProjection(), Isis::ProcessExportPds::ProjectionName(), and Isis::ProcessExportPds4::StandardAllMapping().

◆ CreateForCube() [1/2]

Isis::Projection * Isis::ProjectionFactory::CreateForCube ( Isis::Pvl & label,
int & samples,
int & lines,
bool sizeMatch = true )
static

This method creates a map projection for a cube given a label.

The label must contain all the proper mapping information (radii, projection name, parameters, pixel resolution, etc). If the labels contain a Cube group and the Mapping group already has the upper left corner, then the values in the label will be used to set the cube size. If they don't exist then the minimum/maximum latitude/longitude values (ground range) are expected to be in the Mapping group and will be used to compute the cube size and upper left corner values.

Parameters
labelA label containing valid map projection information for a cube.
samplesThe number of samples. This value is calculated in the method and returned.
linesThe number of lines. This value is calculated in the method and returned.
sizeMatchBoolean value that determines whether the method should match the size of the output cube to the size of the input cube. This parameter defaults to true.
Returns
A pointer to a Projection object.

Definition at line 188 of file ProjectionFactory.cpp.

References Isis::IException::append(), Create(), Isis::PvlContainer::fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::hasObject(), Isis::Displacement::Meters, Isis::Null, Isis::PI, Isis::toString(), Isis::PvlObject::Traverse, and Isis::IException::Unknown.

Referenced by Isis::ProcessMapMosaic::SetOutputCube(), Isis::ProcessMapMosaic::SetOutputCube(), and Isis::ProcessGroundPolygons::SetStatCubes().

◆ CreateForCube() [2/2]

Isis::Projection * Isis::ProjectionFactory::CreateForCube ( Isis::Pvl & label,
int & samples,
int & lines,
Camera & cam )
static

Create a map projection group for a cube using a camera.

This method walks the boundary of the cube computing lat/lons and then uses those lat/lon as input to the projection to compute a x/y range. This x/y range will be minimal (compared to the alternate CreateForCube method and generates significantly small cube size (samples,lines) depending on the projection. Projections with curved meridians and/or parallels generate larger x/y ranges when only looking at the ground range.

Parameters
labelA label containing valid map projection information for a cube.
samplesThe number of samples. This value is calculated in the method and returned.
linesThe number of lines. This value is calculated in the method and returned.
camAn initialized camera model
Returns
Projection* A pointer to a Projection object.

Definition at line 621 of file ProjectionFactory.cpp.

References Create(), Isis::PvlContainer::fileName(), Isis::PvlObject::findGroup(), Isis::Displacement::Meters, Isis::PI, Isis::toString(), Isis::PvlObject::Traverse, and Isis::IException::Unknown.

◆ CreateFromCube() [1/2]

Isis::Projection * Isis::ProjectionFactory::CreateFromCube ( Isis::Cube & cube)
static

◆ CreateFromCube() [2/2]

Isis::Projection * Isis::ProjectionFactory::CreateFromCube ( Isis::Pvl & label)
static

This method loads a map projection from a cube returning a pointer to a Projection object.

Parameters
labelA label containing valid map projection information for a cube.
Returns
(Isis::Projection) A pointer to a Projection object.

Definition at line 1095 of file ProjectionFactory.cpp.

References Create(), Isis::PvlContainer::fileName(), Isis::PvlObject::findGroup(), Isis::Displacement::Meters, Isis::PvlObject::Traverse, and Isis::IException::Unknown.

◆ RingsCreate()

Isis::Projection * Isis::ProjectionFactory::RingsCreate ( Isis::Pvl & label,
bool allowDefaults = false )
static

This method returns a pointer to a RingPlaneProjection object.

The projection is intialized using information contained in a Label object. The information must be a valid Mapping group as defined in the Isis Map Projection Users Guide.

Parameters
labelThe label object containing a valid mapping group.
allowDefaultsIf false then the projection class as indicated by the ProjectionName keyword will require that projection specific parameters such as CenterRadius, CenterRingLongitude, etc must be in the Pvl label object. Otherwise if true then those parameters that are not in the Pvl object will be initialized using the latitude/longitude range.
Returns
A pointer to a RingPlaneProjection object.
Exceptions
Isis::iException::System- Unsupported projection, unable to find plugin

Definition at line 119 of file ProjectionFactory.cpp.

References Isis::PvlObject::findGroup(), Isis::IException::Io, Isis::PvlObject::Traverse, and Isis::IException::Unknown.

Referenced by RingsCreateForCube(), RingsCreateForCube(), and RingsCreateFromCube().

◆ RingsCreateForCube() [1/2]

Isis::Projection * Isis::ProjectionFactory::RingsCreateForCube ( Isis::Pvl & label,
int & samples,
int & lines,
bool sizeMatch )
static

This method creates a projection for a cube to a ring plane given a label.

Currently this is utilized only for projecting images of rings to the ring plane (i.e the equatorial plane). The label must contain all the proper mapping information (radii, projection name, parameters, pixel resolution, etc). If the labels contain a Cube group and the Mapping group already has the upper left corner, then the values in the label will be used to set the cube size. If they don't exist then the minimum/maximum latitude/longitude values (ground range) are expected to be in the Mapping group and will be used to compute the cube size and upper left corner values.

Parameters
labelA label containing valid map projection information for a cube.
samplesThe number of samples. This value is calculated in the method and returned.
linesThe number of lines. This value is calculated in the method and returned.
sizeMatchBoolean value specifying whether the method should match the size of the output cube to the size of the input cube. Defaults to true.
Returns
Projection* A pointer to a Projection object.

Definition at line 432 of file ProjectionFactory.cpp.

References Isis::IException::append(), Isis::PvlContainer::fileName(), Isis::PvlObject::findGroup(), Isis::PvlObject::hasObject(), Isis::Displacement::Meters, Isis::Null, Isis::PI, RingsCreate(), Isis::toString(), Isis::PvlObject::Traverse, and Isis::IException::Unknown.

Referenced by Isis::ProcessMapMosaic::RingsSetOutputCube(), and Isis::ProcessMapMosaic::RingsSetOutputCube().

◆ RingsCreateForCube() [2/2]

Isis::Projection * Isis::ProjectionFactory::RingsCreateForCube ( Isis::Pvl & label,
int & samples,
int & lines,
Camera & cam )
static

Create a ring plane map projection group for a cube using a camera.

This method walks the boundary of the cube computing lat/lons and then uses those lat/lon as input to the projection to compute a x/y range. This x/y range will be minimal (compared to the alternate CreateForCube method and generates significantly small cube size (samples,lines) depending on the projection. Projections with curved meridians and/or parallels generate larger x/y ranges when only looking at the ground range.

Parameters
labelA label containing valid map projection information for a cube.
samplesThe number of samples. This value is calculated in the method and returned.
linesThe number of lines. This value is calculated in the method and returned.
camAn initialized camera model
Returns
Projection* A pointer to a Projection object.

Definition at line 872 of file ProjectionFactory.cpp.

References Isis::IException::append(), Isis::PvlContainer::fileName(), Isis::PvlObject::findGroup(), Isis::Displacement::Meters, Isis::PI, RingsCreate(), Isis::toString(), Isis::PvlObject::Traverse, and Isis::IException::Unknown.

◆ RingsCreateFromCube() [1/2]

Isis::Projection * Isis::ProjectionFactory::RingsCreateFromCube ( Isis::Cube & cube)
static

This method is a helper method.

See RingsCreateFromCube(Pvl).

Parameters
cubeA cube containing valid map projection information
Returns
A pointer to a Projection object

Definition at line 1081 of file ProjectionFactory.cpp.

References Isis::Cube::label(), and RingsCreateFromCube().

Referenced by RingsCreateFromCube(), Isis::ProcessMapMosaic::RingsSetOutputCube(), and Isis::ProcessMapMosaic::RingsSetOutputCube().

◆ RingsCreateFromCube() [2/2]

Isis::Projection * Isis::ProjectionFactory::RingsCreateFromCube ( Isis::Pvl & label)
static

This method loads a map projection from a cube returning a pointer to a Projection object.

Parameters
labelA label containing valid map projection information for a cube.
Returns
(Isis::Projection) A pointer to a Projection object.

Definition at line 1134 of file ProjectionFactory.cpp.

References Isis::PvlContainer::fileName(), Isis::PvlObject::findGroup(), Isis::Displacement::Meters, RingsCreate(), Isis::PvlObject::Traverse, and Isis::IException::Unknown.

Member Data Documentation

◆ m_projPlugin

Plugin Isis::ProjectionFactory::m_projPlugin
staticprivate

Definition at line 106 of file ProjectionFactory.h.


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