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

#include <ossimGoogleProjection.h>

Inheritance diagram for ossimGoogleProjection:
ossimMapProjection ossimProjection ossimObject ossimErrorStatusInterface ossimReferenced

Public Member Functions

 ossimGoogleProjection (const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
 
 ossimGoogleProjection (const ossimGoogleProjection &)
 
 ~ossimGoogleProjection ()
 
virtual ossimObjectdup () 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 void update ()
 
virtual bool loadState (const ossimKeywordlist &kwl, const char *prefix=0)
 Method to the load (recreate) the state of an object from a keyword list. More...
 
virtual bool saveState (ossimKeywordlist &kwl, const char *prefix=0) const
 Method to save the state of an object to a keyword list. More...
 
virtual bool operator== (const ossimProjection &projection) const
 Compares this to arg projection and returns TRUE if the same. More...
 
- 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 void worldToLineSample (const ossimGpt &worldPoint, ossimDpt &lineSample) const
 
virtual ossimGpt lineSampleToWorld (const ossimDpt &projectedPoint) const
 
virtual void lineSampleToWorld (const ossimDpt &projectedPoint, ossimGpt &gpt) 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 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 bool isGeographic () 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 setMetersPerPixel (const ossimDpt &gsd)
 
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 std::ostream & print (std::ostream &out) const
 Prints data members to stream. More...
 
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
 

Protected Attributes

 TYPE_DATA
 
- 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
 

Additional Inherited Members

- Protected Member Functions inherited from ossimMapProjection
virtual ~ossimMapProjection ()
 
void updateFromTransform ()
 
- Protected Member Functions inherited from ossimReferenced
virtual ~ossimReferenced ()
 

Detailed Description

Definition at line 13 of file ossimGoogleProjection.h.

Constructor & Destructor Documentation

◆ ossimGoogleProjection() [1/2]

ossimGoogleProjection::ossimGoogleProjection ( const ossimEllipsoid ellipsoid = ossimEllipsoid(),
const ossimGpt origin = ossimGpt() 
)

Definition at line 37 of file ossimGoogleProjection.cpp.

References ossimMapProjection::thePcsCode, and update().

39  :ossimMapProjection(ellipsoid, origin)
40 {
41  thePcsCode = 3857;
42  update();
43 }
virtual ossimGpt origin() const
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
ossim_uint32 thePcsCode
Projection Coordinate System(PCS) code.

◆ ossimGoogleProjection() [2/2]

ossimGoogleProjection::ossimGoogleProjection ( const ossimGoogleProjection src)

Definition at line 44 of file ossimGoogleProjection.cpp.

References ossimMapProjection::thePcsCode, and update().

45  :ossimMapProjection(src)
46 {
47  thePcsCode = 3857;
48  update();
49 }
ossimMapProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())
ossim_uint32 thePcsCode
Projection Coordinate System(PCS) code.

◆ ~ossimGoogleProjection()

ossimGoogleProjection::~ossimGoogleProjection ( )

Definition at line 51 of file ossimGoogleProjection.cpp.

52 {
53 
54 }

Member Function Documentation

◆ dup()

virtual ossimObject* ossimGoogleProjection::dup ( ) const
inlinevirtual

Implements ossimProjection.

Definition at line 20 of file ossimGoogleProjection.h.

20 {return new ossimGoogleProjection(*this);}
ossimGoogleProjection(const ossimEllipsoid &ellipsoid=ossimEllipsoid(), const ossimGpt &origin=ossimGpt())

◆ forward()

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

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

Implements ossimMapProjection.

Definition at line 75 of file ossimGoogleProjection.cpp.

References lat2y_m(), ossimGpt::latd(), lon2x_m(), and ossimGpt::lond().

76 {
77  /*
78  double easting = 0.0;
79  double northing = 0.0;
80  ossimGpt gpt = latLon;
81 
82  if (theDatum)
83  {
84  if (theDatum->code() != latLon.datum()->code())
85  {
86  gpt.changeDatum(theDatum); // Shift to our datum.
87  }
88  }
89  //double y = Math.Log(Math.Tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
90  easting = gpt.lond()*20037508.34/180.0;
91  northing = log(tan((90.0 + gpt.latd())*M_PI/360.0))/(M_PI/180.0);
92  northing *=20037508.34/180.0;
93 
94  return ossimDpt(easting, northing);
95  */
96 
97  return ossimDpt(lon2x_m(latLon.lond()), lat2y_m(latLon.latd()));
98 }
double lat2y_m(double lat)
double lon2x_m(double lon)

◆ inverse()

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

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

Implements ossimMapProjection.

Definition at line 61 of file ossimGoogleProjection.cpp.

References ossimMapProjection::theDatum, ossimDpt::x, x2lon_m(), ossimDpt::y, and y2lat_m().

62 {
63  /*
64  double lon = (eastingNorthing.x / 20037508.34) * 180.0;
65  double lat = (eastingNorthing.y / 20037508.34) * 180.0;
66 
67  lat = 180.0/M_PI * (2.0 * atan(exp(lat * M_PI / 180)) - M_PI / 2.0);
68 
69  return ossimGpt(lat, lon, 0, theDatum);
70  */
71  //return ossimGpt(merc_lat(eastingNorthing.y), merc_lon(eastingNorthing.x), 0, theDatum);
72  return ossimGpt(y2lat_m(eastingNorthing.y), x2lon_m(eastingNorthing.x), 0, theDatum);
73 }
double y2lat_m(double y)
double x2lon_m(double x)
const ossimDatum * theDatum
This is only set if we want to have built in datum shifting.

◆ loadState()

bool ossimGoogleProjection::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 105 of file ossimGoogleProjection.cpp.

References ossimMapProjection::loadState(), ossimMapProjection::thePcsCode, and update().

106 {
107  thePcsCode = 3857;
108  // Must do this first.
109  bool flag = ossimMapProjection::loadState(kwl, prefix);
110 
111  update();
112  return flag;
113 }
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
Method to the load (recreate) the state of an object from a keyword list.
ossim_uint32 thePcsCode
Projection Coordinate System(PCS) code.

◆ operator==()

bool ossimGoogleProjection::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 115 of file ossimGoogleProjection.cpp.

116 {
117  if (!ossimMapProjection::operator==(projection))
118  return false;
119 
120  const ossimGoogleProjection* p = dynamic_cast<const ossimGoogleProjection*>(&projection);
121 
122  return (p != 0);
123 }

◆ saveState()

bool ossimGoogleProjection::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 100 of file ossimGoogleProjection.cpp.

References ossimMapProjection::saveState().

101 {
102  return ossimMapProjection::saveState(kwl, prefix);
103 }
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
Method to save the state of an object to a keyword list.

◆ update()

void ossimGoogleProjection::update ( )
virtual

Reimplemented from ossimMapProjection.

Definition at line 56 of file ossimGoogleProjection.cpp.

References ossimMapProjection::update().

Referenced by loadState(), and ossimGoogleProjection().

57 {
59 }

Member Data Documentation

◆ TYPE_DATA

ossimGoogleProjection::TYPE_DATA
protected

Definition at line 32 of file ossimGoogleProjection.h.


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