OSSIM - Open Source Software Image Map  Version 1.9.0 (20180803)
ossimUtmpt.cpp
Go to the documentation of this file.
1 //*******************************************************************
2 // Copyright (C) 2000 ImageLinks Inc.
3 //
4 // License: LGPL
5 //
6 // See LICENSE.txt file in the top level directory for more details.
7 //
8 // Author: Garrett Potts
9 //
10 // Description:
11 //
12 // This is the Universal Transverse Mercator (UTM) point. Allows
13 // easy onversion between different coordinates.
14 //*******************************************************************
15 // $Id: ossimUtmpt.cpp 10058 2006-12-08 20:04:23Z mlucas $
16 
18 #include <ossim/base/ossimGpt.h>
20 #include <ossim/base/ossimDatum.h>
23 
25 {
26  convertFromGround(aPt);
27 }
28 
30 {
32 }
33 
35  char hemisphere, // N or S
36  double easting,
37  double northing,
38  const ossimDatum* datum)
39  :
40  theZone (zone),
41  theHemisphere (hemisphere),
42  theEasting (easting),
43  theNorthing (northing),
44  theDatum (datum)
45 {}
46 
48 {
49  const ossimDatum *aDatum = aPt.datum();
50 
51  if(aDatum)
52  {
53  //call Geotrans init code
54  Set_UTM_Parameters(aDatum->ellipsoid()->a(), aDatum->ellipsoid()->flattening(), 0);
56  aPt.lonr(),
57  &theZone,
59  &theEasting,
60  &theNorthing);
61  theDatum = aDatum;
62  }
63  else
64  {
65  //ERROR: Should never happen
66  }
67 }
68 
70 {
73  0 );
74 
75  double latitude = 0.0;
76  double longitude = 0.0;
77 
79  hemisphere(),
80  easting(),
81  northing(),
82  &latitude,
83  &longitude );
84 
85  aPt.latr(latitude);
86  aPt.lonr(longitude);
87  aPt.datum(theDatum);
88 }
ossimUtmpt(const ossimGpt &aPt)
Definition: ossimUtmpt.cpp:24
const ossimDatum * theDatum
Definition: ossimUtmpt.h:86
double flattening() const
long OSSIM_DLL Set_UTM_Parameters(double a, double f, long override)
long OSSIM_DLL Convert_UTM_To_Geodetic(long Zone, char Hemisphere, double Easting, double Northing, double *Latitude, double *Longitude)
double theEasting
Definition: ossimUtmpt.h:84
double theNorthing
Definition: ossimUtmpt.h:85
const ossimDatum * datum() const
datum().
Definition: ossimGpt.h:196
const double & a() const
ossim_int32 zone() const
Return the zone for this utm point.
Definition: ossimUtmpt.h:42
void convertFromGround(const ossimGpt &aPt)
Initializes this point to utm coordinates for the ground point.
Definition: ossimUtmpt.cpp:47
double lonr() const
Returns the longitude in radian measure.
Definition: ossimGpt.h:76
virtual const ossimEllipsoid * ellipsoid() const
Definition: ossimDatum.h:60
char theHemisphere
Definition: ossimUtmpt.h:83
long theZone
Definition: ossimUtmpt.h:82
double northing() const
return the northing value in meters.
Definition: ossimUtmpt.h:60
double easting() const
return the easting value in meters.
Definition: ossimUtmpt.h:55
char hemisphere() const
Return the hemisphere ( Northern or Southern).
Definition: ossimUtmpt.h:50
double latr() const
latr().
Definition: ossimGpt.h:66
long OSSIM_DLL Convert_Geodetic_To_UTM(double Latitude, double Longitude, long *Zone, char *Hemisphere, double *Easting, double *Northing)
void convertToGround(ossimGpt &aPt)
Initializes the ground point from the utm coordinates of this point.
Definition: ossimUtmpt.cpp:69