10#if !defined(GEOGRAPHICLIB_GEOCOORDS_HPP)
11#define GEOGRAPHICLIB_GEOCOORDS_HPP 1
52 real _lat, _long, _easting, _northing, _gamma, _k;
55 mutable real _alt_easting, _alt_northing, _alt_gamma, _alt_k;
56 mutable int _alt_zone;
58 void CopyToAlt()
const {
59 _alt_easting = _easting;
60 _alt_northing = _northing;
65 static void UTMUPSString(
int zone,
bool northp,
66 real easting, real northing,
67 int prec,
bool abbrev, std::string& utm);
80 , _easting(
Math::NaN())
81 , _northing(
Math::NaN())
180 bool centerp =
true,
bool longfirst =
false)
181 { Reset(s, centerp, longfirst); }
194 GeoCoords(real latitude, real longitude,
int zone = UTMUPS::STANDARD) {
195 Reset(latitude, longitude, zone);
208 GeoCoords(
int zone,
bool northp, real easting, real northing) {
209 Reset(zone, northp, easting, northing);
223 void Reset(
const std::string& s,
224 bool centerp =
true,
bool longfirst =
false);
238 void Reset(real latitude, real longitude,
int zone = UTMUPS::STANDARD) {
239 UTMUPS::Forward(latitude, longitude,
240 _zone, _northp, _easting, _northing, _gamma, _k,
243 _long = Math::AngNormalize(longitude);
258 void Reset(
int zone,
bool northp, real easting, real northing) {
259 UTMUPS::Reverse(zone, northp, easting, northing,
260 _lat, _long, _gamma, _k);
264 _northing = northing;
316 int Zone()
const {
return _zone; }
336 if (zone == UTMUPS::MATCH)
338 zone = UTMUPS::StandardZone(_lat, _long, zone);
343 UTMUPS::Forward(_lat, _long,
345 _alt_easting, _alt_northing, _alt_gamma, _alt_k,
394 std::string GeoRepresentation(
int prec = 0,
bool longfirst =
false)
const;
417 std::string DMSRepresentation(
int prec = 0,
bool longfirst =
false,
418 char dmssep =
char(0))
443 std::string MGRSRepresentation(
int prec = 0)
const;
463 std::string UTMUPSRepresentation(
int prec = 0,
bool abbrev =
true)
const;
478 std::string UTMUPSRepresentation(
bool northp,
int prec = 0,
479 bool abbrev =
true)
const;
488 std::string AltMGRSRepresentation(
int prec = 0)
const;
501 std::string AltUTMUPSRepresentation(
int prec = 0,
bool abbrev =
true)
517 std::string AltUTMUPSRepresentation(
bool northp,
int prec = 0,
518 bool abbrev =
true)
const;
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
Header for GeographicLib::UTMUPS class.
Conversion between geographic coordinates.
void Reset(real latitude, real longitude, int zone=UTMUPS::STANDARD)
Math::real Northing() const
Math::real Flattening() const
GeoCoords(const std::string &s, bool centerp=true, bool longfirst=false)
Math::real Convergence() const
Math::real Latitude() const
void SetAltZone(int zone=UTMUPS::STANDARD) const
GeoCoords(real latitude, real longitude, int zone=UTMUPS::STANDARD)
Math::real AltEasting() const
Math::real Easting() const
GeoCoords(int zone, bool northp, real easting, real northing)
Math::real Longitude() const
Math::real AltNorthing() const
void Reset(int zone, bool northp, real easting, real northing)
Math::real AltConvergence() const
Math::real AltScale() const
Math::real EquatorialRadius() const
Mathematical functions needed by GeographicLib.
Convert between geographic coordinates and UTM/UPS.
Namespace for GeographicLib.