108 using namespace MSP::CCS;
116 #define EPSILON 1.75e-7
118 const double PI = 3.14159265358979323e0;
137 UPS::UPS(
double ellipsoidSemiMajorAxis,
double ellipsoidFlattening ) :
150 double inv_f = 1 / ellipsoidFlattening;
152 if (ellipsoidSemiMajorAxis <= 0.0)
156 if ((inv_f < 250) || (inv_f > 350))
173 std::map< char, PolarStereographic* > tempPolarStereographicMap = u.polarStereographicMap;
174 polarStereographicMap[
'N'] =
new PolarStereographic( *tempPolarStereographicMap[
'N'] );
175 polarStereographicMap[
'S'] =
new PolarStereographic( *tempPolarStereographicMap[
'S'] );
178 UPS_Origin_Latitude = u.UPS_Origin_Latitude;
184 while( polarStereographicMap.begin() != polarStereographicMap.end() )
186 delete ( ( *polarStereographicMap.begin() ).second );
187 polarStereographicMap.erase( polarStereographicMap.begin() );
196 std::map< char, PolarStereographic* > tempPolarStereographicMap = u.polarStereographicMap;
197 polarStereographicMap[
'N']->operator=( *tempPolarStereographicMap[
'N'] );
198 polarStereographicMap[
'S']->operator=( *tempPolarStereographicMap[
'S'] );
201 UPS_Origin_Latitude = u.UPS_Origin_Latitude;
226 double longitude = geodeticCoordinates->
longitude();
227 double latitude = geodeticCoordinates->
latitude();
237 if ((longitude < -
PI) || (longitude > (2 *
PI)))
256 double easting = polarStereographicCoordinates->
easting();
257 double northing = polarStereographicCoordinates->
northing();
258 delete polarStereographicCoordinates;
279 char hemisphere = upsCoordinates->
hemisphere();
280 double easting = upsCoordinates->
easting();
281 double northing = upsCoordinates->
northing();
283 if ((hemisphere !=
'N') && (hemisphere !=
'S'))
290 if (hemisphere ==
'N')
294 else if (hemisphere ==
'S')
305 double latitude = geodeticCoordinates->
latitude();
309 delete geodeticCoordinates;
314 delete geodeticCoordinates;
318 return geodeticCoordinates;
static const char * ellipsoidFlattening
MSP::CCS::GeodeticCoordinates * convertToGeodetic(MSP::CCS::UPSCoordinates *upsCoordinates)
const double UPS_False_Northing
UPS(double ellipsoidSemiMajorAxis, double ellipsoidFlattening)
static const char * longitude
const double UPS_False_Easting
const double MAX_ORIGIN_LAT
static const char * semiMajorAxis
static const char * latitude
MSP::CCS::UPSCoordinates * convertFromGeodetic(MSP::CCS::GeodeticCoordinates *geodeticCoordinates)
static const char * northing
static const char * easting
const double MIN_NORTH_LAT
const double MAX_SOUTH_LAT
MSP::CCS::MapProjectionCoordinates * convertFromGeodetic(MSP::CCS::GeodeticCoordinates *geodeticCoordinates)
MSP::CCS::GeodeticCoordinates * convertToGeodetic(MSP::CCS::MapProjectionCoordinates *mapProjectionCoordinates)
const double UPS_Origin_Longitude
UPS & operator=(const UPS &u)
static const char * hemisphere