17 #include "../../Lib/geotrans/dt_cc/utm/utm.h"
18 #include "../../Lib/geotrans/dt_cc/tranmerc/tranmerc.h"
21 static const double UTM_ZONE_WIDTH = M_PI / 30.;
49 static long UtmToLatLon(
const double northings,
const double eastings,
50 const unsigned int zone,
const bool northernHemi,
51 double &lat,
double &lon )
53 double myLat = 0.0, myLon = 0.0;
55 long error = Convert_UTM_To_Geodetic( myZone, northernHemi ?
'N' :
'S',
56 eastings, northings, &myLat, &myLon );
67 double &northings,
double &eastings,
68 unsigned int &zone,
bool &northernHemi )
71 double myNorthings = 0.0, myEastings = 0.0;
73 long error = Convert_Geodetic_To_UTM( lat, lon,
75 &myEastings, &myNorthings );
77 eastings = myEastings;
78 northings = myNorthings;
79 northernHemi = ( myHemi ==
'N' );
88 return "UTM_NO_ERROR";
90 return "UTM_LAT_ERROR";
92 return "UTM_LON_ERROR";
93 case UTM_EASTING_ERROR:
94 return "UTM_EASTING_ERROR";
95 case UTM_NORTHING_ERROR:
96 return "UTM_NORTHING_ERROR";
98 return "UTM_ZONE_ERROR";
99 case UTM_HEMISPHERE_ERROR:
100 return "UTM_HEMISPHERE_ERROR";
101 case UTM_ZONE_OVERRIDE_ERROR:
102 return "UTM_ZONE_OVERRIDE_ERROR";
104 return "UTM_A_ERROR";
105 case UTM_INV_F_ERROR:
106 return "UTM_INV_F_ERROR";
Wgs84()
Definition: Datum.h:114
Contains the AuvMath class declaration.
static long LatLonToUtm(const double lat, const double lon, double &northings, double &eastings, unsigned int &zone, bool &northernHemi)
Converts a lat and lon (in radians!) to northings/eastings/zone.
Definition: Datum.h:66
static const char * UtmErrorToString(long error)
Definition: Datum.h:83
static long UtmToLatLon(const double northings, const double eastings, const unsigned int zone, const bool northernHemi, double &lat, double &lon)
Converts a UTM and zone to lat/lon (in radians!).
Definition: Datum.h:49
Provides Datum information, for only WGS84.
Definition: Datum.h:40