OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
Public Member Functions | List of all members
ossimLlxyProjection Class Reference

#include <ossimLlxyProjection.h>

Inheritance diagram for ossimLlxyProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimLlxyProjection ()
 
 ossimLlxyProjection (const ossimLlxyProjection &rhs)
 
 ossimLlxyProjection (const ossimEllipsoid &ellipsoid, const ossimGpt &origin)
 
 ossimLlxyProjection (const ossimGpt &origin, double latSpacing, double lonSpacing)
 
virtual ~ossimLlxyProjection ()
 
virtual ossimObjectdup () const
 
virtual bool isGeographic () const
 
virtual ossimDpt forward (const ossimGpt &worldPoint) const
 All map projections will convert the world coordinate to an easting northing (Meters). More...
 
virtual ossimGpt inverse (const ossimDpt &projectedPoint) const
 Will take a point in meters and convert it to ground. More...
 
virtual double getLatSpacing () const
 
virtual double getLonSpacing () const
 
virtual void setLatSpacing (double spacing)
 
virtual void setLonSpacing (double spacing)
 
virtual void worldToLineSample (const ossimGpt &worldPoint, ossimDpt &lineSampPt) const
 
virtual void lineSampleToWorld (const ossimDpt &lineSampPt, ossimGpt &worldPt) const
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 
virtual std::ostream & print (std::ostream &out) const
 Prints data members to stream. More...
 
virtual bool operator== (const ossimProjection &projection) const
 Compares this to arg projection and returns TRUE if the same. More...
 
virtual void setMetersPerPixel (const ossimDpt &pt)
 
virtual void computeDegreesPerPixel (const ossimGpt &ground, const ossimDpt &metersPerPixel, double &deltaLat, double &deltaLon)
 
virtual void computeMetersPerPixel (const ossimGpt &center, double deltaDegreesPerPixelLat, double deltaDegreesPerPixelLon, ossimDpt &metersPerPixel)
 
- Public Member Functions inherited from ossimMapProjection
 ossimMapProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimMapProjection (const ossimMapProjection &src)
 
virtual ossimGpt origin () const
 
virtual ossimDpt worldToLineSample (const ossimGpt &worldPoint) const
 
virtual ossimGpt lineSampleToWorld (const ossimDpt &projectedPoint) const
 
virtual void lineSampleHeightToWorld (const ossimDpt &lineSampPt, const double &heightAboveEllipsoid, ossimGpt &worldPt) const
 This is the pure virtual that projects the image point to the given elevation above ellipsoid, thereby bypassing reference to a DEM. More...
 
virtual void lineSampleToEastingNorthing (const ossimDpt &liineSample, ossimDpt &eastingNorthing) const
 
virtual void eastingNorthingToLineSample (const ossimDpt &eastingNorthing, ossimDpt &lineSample) const
 
virtual void eastingNorthingToWorld (const ossimDpt &eastingNorthing, ossimGpt &worldPt) const
 
virtual double getFalseEasting () const
 
virtual double getFalseNorthing () const
 
virtual double getStandardParallel1 () const
 Derived classes should implement as needed. More...
 
virtual double getStandardParallel2 () const
 Derived classes should implement as needed. More...
 
virtual void update ()
 
virtual void setPcsCode (ossim_uint32 pcsCode)
 
virtual ossim_uint32 getPcsCode () const
 Returns the EPSG PCS code or 32767 if the projection is a custom (non-EPSG) projection. More...
 
virtual ossimString getProjectionName () const
 Returns the projection name. More...
 
virtual double getA () const
 ACCESS METHODS: More...
 
virtual double getB () const
 
virtual double getF () const
 
virtual ossimDpt getMetersPerPixel () const
 
virtual const ossimDptgetDecimalDegreesPerPixel () const
 Returns decimal degrees per pixel as an ossimDpt with "x" representing longitude and "y" representing latitude. More...
 
virtual const ossimDptgetUlEastingNorthing () const
 
virtual const ossimGptgetUlGpt () const
 
virtual const ossimDatumgetDatum () const
 
const ossimEllipsoidgetEllipsoid () const
 
const ossimGptgetOrigin () const
 
virtual void applyScale (const ossimDpt &scale, bool recenterTiePoint)
 Applies scale to theDeltaLonPerPixel, theDeltaLatPerPixel and theMetersPerPixel data members (eg: theDeltaLonPerPixel *= scale.x). More...
 
virtual void setEllipsoid (const ossimEllipsoid &ellipsoid)
 SET METHODS: More...
 
virtual void setAB (double a, double b)
 
virtual void setDatum (const ossimDatum *datum)
 Sets theDatum to datum. More...
 
virtual void setOrigin (const ossimGpt &origin)
 Sets theOrigin to origin. More...
 
virtual void setDecimalDegreesPerPixel (const ossimDpt &gsd)
 
virtual void setUlTiePoints (const ossimGpt &gpt)
 
virtual void setUlTiePoints (const ossimDpt &eastingNorthing)
 
virtual void setUlEastingNorthing (const ossimDpt &ulEastingNorthing)
 
virtual void setUlGpt (const ossimGpt &ulGpt)
 
virtual void assign (const ossimProjection &aProjection)
 
virtual void computeDegreesPerPixel ()
 Computes the approximate resolution in degrees/pixel. More...
 
virtual void computeMetersPerPixel ()
 This will go from the ground point and give you an approximate meters per pixel. More...
 
void setMatrix (double rotation, const ossimDpt &scale, const ossimDpt &translation)
 
void setMatrixScale (const ossimDpt &scale)
 
void setMatrixRotation (double rotation)
 
void setMatrixTranslation (const ossimDpt &translation)
 
void snapTiePointTo (ossim_float64 multiple, ossimUnitType unitType)
 Utility method to snap the tie point to some multiple. More...
 
void snapTiePointToOrigin ()
 
void setElevationLookupFlag (bool flag)
 
bool getElevationLookupFlag () const
 
ossimUnitType getModelTransformUnitType () const
 
void setModelTransformUnitType (ossimUnitType unit)
 
bool hasModelTransform () const
 
virtual bool isAffectedByElevation () const
 Implementation of pure virtual ossimProjection::isAffectedByElevation method. More...
 
void setProjectionUnits (ossimUnitType units)
 
ossimUnitType getProjectionUnits () const
 OSSIM considers all map projection coordinates (including false eastings and northings) to be in meters. More...
 
virtual bool isEqualTo (const ossimObject &obj, ossimCompareType compareType=OSSIM_COMPARE_FULL) const
 
- Public Member Functions inherited from ossimProjection
 ossimProjection ()
 
virtual ~ossimProjection ()
 
virtual void getRoundTripError (const ossimDpt &imagePoint, ossimDpt &errorResult) const
 
virtual void getRoundTripError (const ossimGpt &groundPoint, ossimDpt &errorResult) const
 
virtual void getGroundClipPoints (ossimGeoPolygon &gpts) const
 
virtual bool operator!= (const ossimProjection &projection) const
 
- Public Member Functions inherited from ossimObject
 ossimObject ()
 
virtual ~ossimObject ()
 
virtual ossimString getShortName () const
 
virtual ossimString getLongName () const
 
virtual ossimString getDescription () const
 
virtual ossimString getClassName () const
 
virtual RTTItypeid getType () const
 
virtual bool canCastTo (ossimObject *obj) const
 
virtual bool canCastTo (const RTTItypeid &id) const
 
virtual bool canCastTo (const ossimString &parentClassName) const
 
virtual void accept (ossimVisitor &visitor)
 
- Public Member Functions inherited from ossimReferenced
 ossimReferenced ()
 
 ossimReferenced (const ossimReferenced &)
 
ossimReferencedoperator= (const ossimReferenced &)
 
void ref () const
 increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unref () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unref_nodelete () const
 decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
int referenceCount () const
 
- Public Member Functions inherited from ossimErrorStatusInterface
 ossimErrorStatusInterface ()
 
virtual ~ossimErrorStatusInterface ()
 
virtual ossimErrorCode getErrorStatus () const
 
virtual ossimString getErrorStatusString () const
 
virtual void setErrorStatus (ossimErrorCode error_status) const
 
virtual void setErrorStatus () const
 
virtual void clearErrorStatus () const
 
bool hasError () const
 

Additional Inherited Members

- Protected Member Functions inherited from ossimMapProjection
virtual ~ossimMapProjection ()
 
void updateFromTransform ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 
- Protected Attributes inherited from ossimMapProjection
ossimEllipsoid theEllipsoid
 This method verifies that the projection parameters match the current pcs code. More...
 
ossimGpt theOrigin
 
const ossimDatumtheDatum
 This is only set if we want to have built in datum shifting. More...
 
ossimDpt theMetersPerPixel
 Holds the number of meters per pixel. More...
 
ossimDpt theDegreesPerPixel
 Hold the decimal degrees per pixel. More...
 
ossimGpt theUlGpt
 Hold tie point in decimal degrees. More...
 
ossimDpt theUlEastingNorthing
 Hold tie point as easting northing. More...
 
ossimDpt theFalseEastingNorthing
 Hold the false easting northing. More...
 
ossim_uint32 thePcsCode
 Projection Coordinate System(PCS) code. More...
 
bool theElevationLookupFlag
 
ossimMatrix4x4 theModelTransform
 
ossimMatrix4x4 theInverseModelTransform
 
ossimUnitType theModelTransformUnitType
 
ossimUnitType theProjectionUnits
 Linear units of the projection as indicated in the projection's specification: More...
 
- Protected Attributes inherited from ossimErrorStatusInterface
ossimErrorCode theErrorStatus
 

Detailed Description

Definition at line 21 of file ossimLlxyProjection.h.

Constructor & Destructor Documentation

◆ ossimLlxyProjection() [1/4]

ossimLlxyProjection::ossimLlxyProjection ( )

Definition at line 28 of file ossimLlxyProjection.cpp.

References ossimMapProjection::theDegreesPerPixel, and ossimDpt::y.

Referenced by dup().

29 {
30  // set to about 1 meter per pixel
31  theDegreesPerPixel.y = DEFAULT_DEGREES_PER_PIXEL;
32  theDegreesPerPixel.x = DEFAULT_DEGREES_PER_PIXEL;
39 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
virtual void computeMetersPerPixel()
This will go from the ground point and give you an approximate meters per pixel.
double y
Definition: ossimDpt.h:165
ossimDpt theUlEastingNorthing
Hold tie point as easting northing.
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164

◆ ossimLlxyProjection() [2/4]

ossimLlxyProjection::ossimLlxyProjection ( const ossimLlxyProjection rhs)

Definition at line 41 of file ossimLlxyProjection.cpp.

References ossimMapProjection::computeMetersPerPixel(), ossimGpt::datum(), ossimDatum::ellipsoid(), ossim::nan(), ossimMapProjection::theDatum, ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theEllipsoid, ossimMapProjection::theMetersPerPixel, ossimMapProjection::theOrigin, ossimMapProjection::theUlEastingNorthing, ossimMapProjection::theUlGpt, ossimDpt::x, and ossimDpt::y.

42  :
44 {
45  theOrigin = rhs.theOrigin;
46  theUlGpt = rhs.theUlGpt;
57 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
virtual void computeMetersPerPixel()
This will go from the ground point and give you an approximate meters per pixel.
double y
Definition: ossimDpt.h:165
ossimDpt theUlEastingNorthing
Hold tie point as easting northing.
ossimGpt theUlGpt
Hold tie point in decimal degrees.
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
virtual const ossimEllipsoid * ellipsoid() const
Definition: ossimDatum.h:60
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ ossimLlxyProjection() [3/4]

ossimLlxyProjection::ossimLlxyProjection ( const ossimEllipsoid ellipsoid,
const ossimGpt origin 
)

Definition at line 79 of file ossimLlxyProjection.cpp.

References ossimMapProjection::computeMetersPerPixel(), ossim::nan(), ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theMetersPerPixel, ossimMapProjection::theOrigin, ossimMapProjection::theUlEastingNorthing, ossimDpt::x, and ossimDpt::y.

81  :ossimMapProjection(ellipsoid, origin)
82 {
83  theDegreesPerPixel.y = 1.0;
84  theDegreesPerPixel.x = 1.0;
91 }
double nan()
Method to return ieee floating point double precision NAN.
Definition: ossimCommon.h:135
virtual void computeMetersPerPixel()
This will go from the ground point and give you an approximate meters per pixel.
double y
Definition: ossimDpt.h:165
ossimDpt theUlEastingNorthing
Hold tie point as easting northing.
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164

◆ ossimLlxyProjection() [4/4]

ossimLlxyProjection::ossimLlxyProjection ( const ossimGpt origin,
double  latSpacing,
double  lonSpacing 
)

Definition at line 59 of file ossimLlxyProjection.cpp.

References ossimMapProjection::computeMetersPerPixel(), ossimGpt::datum(), ossimDatum::ellipsoid(), ossimMapProjection::origin(), ossimMapProjection::theDatum, ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theEllipsoid, ossimMapProjection::theMetersPerPixel, ossimMapProjection::theOrigin, ossimMapProjection::theUlEastingNorthing, ossimMapProjection::theUlGpt, ossimDpt::x, and ossimDpt::y.

62  :
64 {
65  theOrigin = origin;
66  theUlGpt = origin;
67  theUlEastingNorthing.y = 0.0;
68  theUlEastingNorthing.x = 0.0;
71  theDegreesPerPixel.y = latSpacing;
72  theDegreesPerPixel.x = lonSpacing;
77 }
virtual void computeMetersPerPixel()
This will go from the ground point and give you an approximate meters per pixel.
double y
Definition: ossimDpt.h:165
ossimDpt theUlEastingNorthing
Hold tie point as easting northing.
ossimGpt theUlGpt
Hold tie point in decimal degrees.
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
virtual const ossimEllipsoid * ellipsoid() const
Definition: ossimDatum.h:60
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164
ossimEllipsoid theEllipsoid
This method verifies that the projection parameters match the current pcs code.
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ ~ossimLlxyProjection()

ossimLlxyProjection::~ossimLlxyProjection ( )
virtual

Definition at line 93 of file ossimLlxyProjection.cpp.

94 {
95 }

Member Function Documentation

◆ computeDegreesPerPixel()

void ossimLlxyProjection::computeDegreesPerPixel ( const ossimGpt ground,
const ossimDpt metersPerPixel,
double &  deltaLat,
double &  deltaLon 
)
virtual

This will go from the ground point and give you an approximate lat and lon per pixel. the Delta Lat and delta lon will be in degrees.

Definition at line 106 of file ossimLlxyProjection.cpp.

References ossimGpt::metersPerDegree(), ossimDpt::x, and ossimDpt::y.

110 {
111  ossimDpt mpd = ground.metersPerDegree();
112  ossimDpt dpm(1.0/mpd.x,
113  1.0/mpd.y);
114  deltaLat = metersPerPixel.y*dpm.y;
115  deltaLon = metersPerPixel.x*dpm.x;
116 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164
ossimDpt metersPerDegree() const
Definition: ossimGpt.cpp:498

◆ computeMetersPerPixel()

void ossimLlxyProjection::computeMetersPerPixel ( const ossimGpt center,
double  deltaDegreesPerPixelLat,
double  deltaDegreesPerPixelLon,
ossimDpt metersPerPixel 
)
virtual

This will go from the ground point and give you an approximate meters per pixel. the Delta Lat and delta lon will be in degrees.

Definition at line 122 of file ossimLlxyProjection.cpp.

References ossimGpt::metersPerDegree(), ossimDpt::x, and ossimDpt::y.

126 {
127  metersPerPixel = center.metersPerDegree();
128  metersPerPixel.x *= deltaDegreesPerPixelLon;
129  metersPerPixel.y *= deltaDegreesPerPixelLat;
130 }
double y
Definition: ossimDpt.h:165
double x
Definition: ossimDpt.h:164
ossimDpt metersPerDegree() const
Definition: ossimGpt.cpp:498

◆ dup()

ossimObject * ossimLlxyProjection::dup ( ) const
virtual

Implements ossimProjection.

Definition at line 97 of file ossimLlxyProjection.cpp.

References ossimLlxyProjection().

98 {
99  return new ossimLlxyProjection(*this);
100 }

◆ forward()

ossimDpt ossimLlxyProjection::forward ( const ossimGpt worldPoint) const
virtual

All map projections will convert the world coordinate to an easting northing (Meters).

Implements ossimMapProjection.

Definition at line 272 of file ossimLlxyProjection.cpp.

References worldToLineSample().

273 {
274  ossimDpt result;
275 
276  worldToLineSample(worldPoint, result);
277 
278  return result;
279 }
virtual void worldToLineSample(const ossimGpt &worldPoint, ossimDpt &lineSampPt) const

◆ getLatSpacing()

double ossimLlxyProjection::getLatSpacing ( ) const
virtual

METHOD: getLatSpacing() Returns the latitude spacing as a double representing decimal degrees.

Definition at line 313 of file ossimLlxyProjection.cpp.

References ossimMapProjection::theDegreesPerPixel, and ossimDpt::y.

314 {
315  return theDegreesPerPixel.y;
316 }
double y
Definition: ossimDpt.h:165
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.

◆ getLonSpacing()

double ossimLlxyProjection::getLonSpacing ( ) const
virtual

METHOD: getLonSpacing() Returns the longitude spacing as a double representing decimal degrees.

Definition at line 318 of file ossimLlxyProjection.cpp.

References ossimMapProjection::theDegreesPerPixel, and ossimDpt::x.

319 {
320  return theDegreesPerPixel.x;
321 }
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164

◆ inverse()

ossimGpt ossimLlxyProjection::inverse ( const ossimDpt projectedPoint) const
virtual

Will take a point in meters and convert it to ground.

Implements ossimMapProjection.

Definition at line 281 of file ossimLlxyProjection.cpp.

References lineSampleToWorld().

282 {
283  ossimGpt result;
284 
285  lineSampleToWorld(projectedPoint, result);
286 
287  return result;
288 }
virtual void lineSampleToWorld(const ossimDpt &lineSampPt, ossimGpt &worldPt) const

◆ isGeographic()

bool ossimLlxyProjection::isGeographic ( ) const
virtual

Reimplemented from ossimMapProjection.

Definition at line 308 of file ossimLlxyProjection.cpp.

309 {
310  return true;
311 }

◆ lineSampleToWorld()

void ossimLlxyProjection::lineSampleToWorld ( const ossimDpt lineSampPt,
ossimGpt worldPt 
) const
virtual

METHOD: lineSampleToWorld() Performs the inverse projection from line, sample to ground (world):

Reimplemented from ossimMapProjection.

Definition at line 147 of file ossimLlxyProjection.cpp.

References ossimGpt::datum(), ossimElevManager::getHeightAboveEllipsoid(), ossimGpt::hgt, ossimElevManager::instance(), ossimGpt::latd(), ossimDpt::line, ossimGpt::lond(), ossimGpt::makeNan(), ossimDpt::samp, ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theElevationLookupFlag, ossimMapProjection::theOrigin, ossimMapProjection::theUlGpt, ossimDpt::x, and ossimDpt::y.

Referenced by inverse().

149 {
150  worldPt.makeNan();
151  // Start with the origin. This will keep the origin's datum.
152  worldPt.datum(theOrigin.datum());
153 
154  double lat = theUlGpt.latd() - (lineSampPt.line * theDegreesPerPixel.y);
155  double lon = theUlGpt.lond() + (lineSampPt.samp * theDegreesPerPixel.x);
156 
157  //---
158  // Assuming the origin had a lon between -180 and 180 and lat between -90
159  // and 90.
160  //---
161 // if (lon > 180.0)
162 // {
163 // lon -= 360.0;
164 // }
165 // else if (lon < -180.0)
166 // {
167 // lon += 360.0;
168 // }
169 // if (lat > 90.0)
170 // {
171 // lat -= 90.0;
172 // }
173 // else if (lat < -90.0)
174 // {
175 // lat = -180.0 - lat;
176 // }
177 
178  worldPt.latd(lat);
179  worldPt.lond(lon);
181  {
183  }
184 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double samp
Definition: ossimDpt.h:164
double y
Definition: ossimDpt.h:165
void makeNan()
Definition: ossimGpt.h:130
ossim_float64 hgt
Height in meters above the ellipsiod.
Definition: ossimGpt.h:274
static ossimElevManager * instance()
METHOD: instance() Implements singelton pattern.
ossimGpt theUlGpt
Hold tie point in decimal degrees.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
double line
Definition: ossimDpt.h:165
virtual double getHeightAboveEllipsoid(const ossimGpt &gpt)
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164

◆ loadState()

bool ossimLlxyProjection::loadState ( const ossimKeywordlist kwl,
const char *  prefix = 0 
)
virtual

Method to the load (recreate) the state of an object from a keyword list. Return true if ok or false on error.

Reimplemented from ossimMapProjection.

Definition at line 216 of file ossimLlxyProjection.cpp.

References ossimMapProjection::computeDegreesPerPixel(), ossimMapProjection::computeMetersPerPixel(), ossimDpt::hasNans(), ossimGpt::hasNans(), ossimMapProjection::loadState(), ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theMetersPerPixel, ossimMapProjection::theOrigin, ossimDpt::x, and ossimDpt::y.

218 {
219  // Base class...
220  ossimMapProjection::loadState(kwl, prefix);
221 
222  if (theOrigin.hasNans() == false)
223  {
224  if ( (theDegreesPerPixel.hasNans() == false) &&
226  {
227  // Compute meters per pixel from origin and decimal degrees.
232  }
233  else if( (theMetersPerPixel.hasNans() == false) &&
235  {
236  // Compute decimal degrees per pixel from origin and meters.
241  }
242  else
243  {
244  // Assign some value.
245  theDegreesPerPixel.y = DEFAULT_DEGREES_PER_PIXEL;
246  theDegreesPerPixel.x = DEFAULT_DEGREES_PER_PIXEL;
251  }
252  }
253 
254  return true;
255 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
virtual void computeMetersPerPixel()
This will go from the ground point and give you an approximate meters per pixel.
double y
Definition: ossimDpt.h:165
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
bool hasNans() const
Definition: ossimDpt.h:67
bool hasNans() const
Definition: ossimGpt.h:135
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164
virtual void computeDegreesPerPixel()
Computes the approximate resolution in degrees/pixel.

◆ operator==()

bool ossimLlxyProjection::operator== ( const ossimProjection projection) const
virtual

Compares this to arg projection and returns TRUE if the same.

NOTE: As currently implemented in OSSIM, map projections also contain image geometry information like tiepoint and scale. This operator is only concerned with the map specification and ignores image geometry differences.

Reimplemented from ossimMapProjection.

Definition at line 257 of file ossimLlxyProjection.cpp.

References ossimMapProjection::theDegreesPerPixel, ossimDpt::x, and ossimDpt::y.

258 {
259  const ossimLlxyProjection* proj = dynamic_cast<const ossimLlxyProjection*>(&projection);
260 
261  if(!proj)
262  {
263  return false;
264  }
265 
266  return ( // (theOrigin == proj->theOrigin) && // tmp... fix gpt!
269 }
double y
Definition: ossimDpt.h:165
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164

◆ print()

std::ostream & ossimLlxyProjection::print ( std::ostream &  out) const
virtual

Prints data members to stream.

Returns stream&.

Reimplemented from ossimMapProjection.

Definition at line 186 of file ossimLlxyProjection.cpp.

References ossimMapProjection::print(), ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theOrigin, ossimDpt::x, and ossimDpt::y.

187 {
188  out << setiosflags(ios::fixed) << setprecision(15)
189  << "ossimLlxyProjection dump:"
190  << "\norigin: " << theOrigin
191  << "\nlatitude spacing in decimal degrees: " << theDegreesPerPixel.y
192  << "\nlongitude spacing in decimal degrees: " << theDegreesPerPixel.x
193  << "\n\nossimMapProjection dump:\n" << endl;
194 
195  return ossimMapProjection::print(out);
196 }
double y
Definition: ossimDpt.h:165
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164
virtual std::ostream & print(std::ostream &out) const
Prints data members to stream.

◆ saveState()

bool ossimLlxyProjection::saveState ( ossimKeywordlist kwl,
const char *  prefix = 0 
) const
virtual

Method to save the state of an object to a keyword list. Return true if ok or false on error.

Reimplemented from ossimMapProjection.

Definition at line 207 of file ossimLlxyProjection.cpp.

References ossimMapProjection::saveState().

Referenced by ossimElevImageSource::getImageGeometry().

209 {
210  // Base class...
211  ossimMapProjection::saveState(kwl, prefix);
212 
213  return true;
214 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ setLatSpacing()

void ossimLlxyProjection::setLatSpacing ( double  spacing)
virtual

METHOD: setLatSpacing(double spacing) Set the latitude spacing as a double representing decimal degrees.

Definition at line 290 of file ossimLlxyProjection.cpp.

References ossimGpt::metersPerDegree(), ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theMetersPerPixel, and ossimDpt::y.

291 {
292  theDegreesPerPixel.y = spacing;
293 
294  // Update the meters per pixel.
295  ossimDpt pt = ossimGpt(0.0, 0.0).metersPerDegree();
297 }
double y
Definition: ossimDpt.h:165
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
ossimDpt metersPerDegree() const
Definition: ossimGpt.cpp:498

◆ setLonSpacing()

void ossimLlxyProjection::setLonSpacing ( double  spacing)
virtual

METHOD: setLonSpacing(double spacing) Set the latitude spacing as a double representing decimal degrees.

Definition at line 299 of file ossimLlxyProjection.cpp.

References ossimGpt::metersPerDegree(), ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theMetersPerPixel, and ossimDpt::x.

300 {
301  theDegreesPerPixel.x = spacing;
302 
303  // Update the meters per pixel.
304  ossimDpt pt = ossimGpt(0.0, 0.0).metersPerDegree();
306 }
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164
ossimDpt metersPerDegree() const
Definition: ossimGpt.cpp:498

◆ setMetersPerPixel()

void ossimLlxyProjection::setMetersPerPixel ( const ossimDpt pt)
virtual

Reimplemented from ossimMapProjection.

Definition at line 198 of file ossimLlxyProjection.cpp.

References ossimMapProjection::computeDegreesPerPixel(), ossimMapProjection::setMetersPerPixel(), ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theMetersPerPixel, ossimMapProjection::theOrigin, ossimDpt::x, and ossimDpt::y.

199 {
205 }
double y
Definition: ossimDpt.h:165
virtual void setMetersPerPixel(const ossimDpt &gsd)
ossimDpt theMetersPerPixel
Holds the number of meters per pixel.
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164
virtual void computeDegreesPerPixel()
Computes the approximate resolution in degrees/pixel.

◆ worldToLineSample()

void ossimLlxyProjection::worldToLineSample ( const ossimGpt worldPoint,
ossimDpt lineSampPt 
) const
virtual

METHOD: worldToLineSample() Performs the forward projection from ground point to line, sample.

Reimplemented from ossimMapProjection.

Definition at line 132 of file ossimLlxyProjection.cpp.

References ossimGpt::changeDatum(), ossimGpt::datum(), ossimGpt::latd(), ossimDpt::line, ossimGpt::lond(), ossimDpt::samp, ossimMapProjection::theDegreesPerPixel, ossimMapProjection::theOrigin, ossimMapProjection::theUlGpt, ossimDpt::x, and ossimDpt::y.

Referenced by forward().

134 {
135  ossimGpt gpt = worldPoint;
136 
137  if (*theOrigin.datum() != *gpt.datum())
138  {
139  // Apply datum shift if it's not the same.
140  gpt.changeDatum(theOrigin.datum());
141  }
142 
143  lineSampPt.line = (theUlGpt.latd() - gpt.latd()) / theDegreesPerPixel.y;
144  lineSampPt.samp = (gpt.lond() - theUlGpt.lond()) / theDegreesPerPixel.x;
145 }
double lond() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:97
double samp
Definition: ossimDpt.h:164
double y
Definition: ossimDpt.h:165
ossimGpt theUlGpt
Hold tie point in decimal degrees.
double latd() const
Will convert the radian measure to degrees.
Definition: ossimGpt.h:87
void changeDatum(const ossimDatum *datum)
This will actually perform a shift.
Definition: ossimGpt.cpp:316
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
double line
Definition: ossimDpt.h:165
ossimDpt theDegreesPerPixel
Hold the decimal degrees per pixel.
double x
Definition: ossimDpt.h:164

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