core/vpgl/vpgl_utm.h
Go to the documentation of this file.
00001 // <begin copyright notice>
00002 // ---------------------------------------------------------------------------
00003 //
00004 //                   Copyright (c) 1997 TargetJr Consortium
00005 //               GE Corporate Research and Development (GE CRD)
00006 //                             1 Research Circle
00007 //                            Niskayuna, NY 12309
00008 //                            All Rights Reserved
00009 //              Reproduction rights limited as described below.
00010 //
00011 //      Permission to use, copy, modify, distribute, and sell this software
00012 //      and its documentation for any purpose is hereby granted without fee,
00013 //      provided that (i) the above copyright notice and this permission
00014 //      notice appear in all copies of the software and related documentation,
00015 //      (ii) the name TargetJr Consortium (represented by GE CRD), may not be
00016 //      used in any advertising or publicity relating to the software without
00017 //      the specific, prior written permission of GE CRD, and (iii) any
00018 //      modifications are clearly marked and summarized in a change history
00019 //      log.
00020 //
00021 //      THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTY OF ANY KIND,
00022 //      EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
00023 //      WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
00024 //      IN NO EVENT SHALL THE TARGETJR CONSORTIUM BE LIABLE FOR ANY SPECIAL,
00025 //      INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND OR ANY
00026 //      DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
00027 //      WHETHER OR NOT ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, OR ON
00028 //      ANY THEORY OF LIABILITY ARISING OUT OF OR IN CONNECTION WITH THE
00029 //      USE OR PERFORMANCE OF THIS SOFTWARE.
00030 //
00031 // ---------------------------------------------------------------------------
00032 // <end copyright notice>
00033 
00034 #ifndef vpgl_utm_h
00035 #define vpgl_utm_h
00036 //:
00037 // \file
00038 //  A rip-off of the IUE utm_geodedic and geodetic_utm transform classes
00039 //   which allows the GeoPt to support a constructor in UTM coordinates.
00040 //  The constructor defaults to WGS-84, but there are accessors to
00041 //  set the major and minor axes of other spheroids, e.g. nad-27.
00042 //
00043 //  The latitude and longitude values are expressed in degrees, with
00044 //  negative values representing South and West respectively.
00045 //  The UTM zone is 1 between 180 degrees and 174 degrees West
00046 //  longitude and increases by one every six degrees from West to East.
00047 //  The UTM zone ranges from 10 on the West Coast of the US to 19 on the
00048 //  East Coast.  If the latitude is negative, i.e., below the equator,
00049 //  then the south_flag should be set to true.  I am not sure what the
00050 //  utm_central_meridian variable is for, maybe for the polar caps.
00051 //
00052 // Adapted by:     J. L. Mundy
00053 // \date            May 8, 1999
00054 //
00055 //======================================================================
00056 
00057 class vpgl_utm
00058 {
00059  public:
00060   vpgl_utm();
00061   vpgl_utm (const vpgl_utm &t);
00062   ~vpgl_utm();
00063   void SetSpheroidA(double a) { a_ = a; }
00064   void SetSpheroidB(double b) { b_ = b; }
00065   //UTM to LatLon
00066   void transform(int utm_zone, double x, double y, double z,
00067                  double& lat, double& lon , double& elev,
00068                  bool south_flag = false,
00069                  double utm_central_meridian = 0);
00070 
00071   void transform(int utm_zone, double x, double y,
00072                  double& lat, double& lon,
00073                  bool south_flag = false,
00074                  double utm_central_meridian = 0);
00075   //: LatLon to UTM
00076   void transform(double lat, double lon,
00077                  double& x, double& y, int& utm_zone);
00078 
00079  private:
00080   double a_, b_;
00081 };
00082 
00083 #endif