mapproj.h

Go to the documentation of this file.
00001 /**
00002  * \file mi32/mapproj.h
00003  * \brief Definitions for map projection transformations
00004  *
00005  * \if NODOC
00006  * $Id: mapproj.h_v 1.141 2004/10/15 15:44:23 mju Exp $
00007  *
00008  * $Log: mapproj.h_v $
00009  * Revision 1.141  2004/10/15 15:44:23  mju
00010  * Remove unused latlonScaleToMeters.
00011  *
00012  * Revision 1.140  2004/08/23 17:33:36  mju
00013  * Define deprecated stuff when compiling DLL.
00014  *
00015  * Revision 1.139  2004/08/23 16:34:00  mju
00016  * Remove legacy projsys, ogcwkt, etc stuff.
00017  *
00018  * Revision 1.138  2004/07/20 20:58:33  mju
00019  * Accidentally removed OGC fns when still in use.
00020  *
00021  * Revision 1.137  2004/07/20 17:57:26  mju
00022  * Remove some obsolete methods.
00023  *
00024  * Revision 1.136  2004/07/19 17:12:29  mju
00025  * Remove epsg fns.
00026  *
00027  * Revision 1.135  2004/07/13 13:08:07  mju
00028  * Remove another obsolete prototype.
00029  *
00030  * Revision 1.134  2004/07/13 13:05:49  mju
00031  * Remove computeObjProjTransAffine.
00032  *
00033  * Revision 1.133  2004/04/28 16:35:17  mju
00034  * Add projsys_Colombia.
00035  *
00036  * Revision 1.132  2004/01/28 22:12:25  scowan
00037  * Moved and exported map info georeference functions.
00038  *
00039  * Revision 1.131  2003/10/01 22:13:27  dwilliss
00040  * doxygen
00041  *
00042  * Revision 1.130  2003/09/25 21:29:07  dwilliss
00043  * Don't capitalize enum any more. Genitor needed it, doxygen doesn't like it.
00044  *
00045  * Revision 1.129  2003/09/15 13:49:56  fileserver!dwilliss
00046  * Doxygen
00047  *
00048  * Revision 1.128  2003/09/08 21:04:47  dwilliss
00049  * Added doxygen start/end tags for functions gruops
00050  *
00051  * Revision 1.126  2003/02/28 17:33:59  mju
00052  * Add methods to test if two MPPs are equivalent
00053  *
00054  * Revision 1.125  2003/02/27 22:08:06  mju
00055  * Add Goode projection.
00056  *
00057  * Revision 1.123  2003/02/26 18:07:43  mju
00058  * Add getProjNameFull.
00059  *
00060  * Revision 1.122  2003/02/24 17:15:20  mju
00061  * Add datum_tokyo_grid.
00062  *
00063  * Revision 1.121  2003/02/20 18:25:53  mju
00064  * Add DATUM_TRANS_Grid.
00065  *
00066  * Revision 1.120  2003/02/04 18:42:17  mju
00067  * Add dealulpiscului datum.
00068  *
00069  * Revision 1.119  2003/02/03 20:17:01  mju
00070  * Add projection_ObliqueStereographic.
00071  * Add projsys_Italy.
00072  *
00073  * Revision 1.117  2003/01/21 14:40:37  mju
00074  * Add PROJSYS_Romania.
00075  *
00076  * Revision 1.116  2002/11/13 15:54:19  mju
00077  * When set parms for equidistant conic set both std parallels in single case.
00078  *
00079  * Revision 1.115  2002/11/05 17:46:37  mju
00080  * Add SetProjectionSwissConformal.
00081  *
00082  * Revision 1.114  2002/09/09 14:11:06  mju
00083  * Change comments re rvcobjname.
00084  *
00085  * Revision 1.113  2002/08/28 16:09:04  mju
00086  * In SetSystemLatLon don't change datum.
00087  *
00088  * Revision 1.112  2002/08/12 13:22:46  mju
00089  * Remove retired stuff.
00090  *
00091  * Revision 1.111  2002/07/15 14:57:20  mju
00092  * Add datum/projsys for NZGD2000/NZTM.
00093  *
00094  * Revision 1.110  2002/05/17 15:38:15  dwilliss
00095  * Don't leave dangling commas at the end of enums.
00096  *
00097  * Revision 1.109  2002/03/08 15:48:57  mju
00098  * Use differet memcpy defn for where 'amemcpy' used.
00099  *
00100  * Revision 1.108  2002/03/08 15:16:46  mju
00101  * Disallow memset/memcpy on MAPPROJPARM.
00102  *
00103  * Revision 1.107  2002/02/19 17:44:18  mju
00104  * Add PROJECTION enum.
00105  *
00106  * Revision 1.106  2002/02/18 15:31:25  mju
00107  * Use normal numbering for SJTSK datum.
00108  *
00109  * Revision 1.105  2002/02/18 15:28:39  mju
00110  * Add DATUM_SJTSK95.
00111  *
00112  * Revision 1.104  2002/02/06 18:47:49  mju
00113  * Add PROJ_RoyalDutch.
00114  *
00115  * Revision 1.103  2002/02/06 15:34:20  mju
00116  * Add PROJSYS_Dutch.
00117  *
00118  * Revision 1.102  2002/01/24 22:50:59  mju
00119  * Fix typo.
00120  *
00121  * Revision 1.101  2002/01/24 22:50:12  mju
00122  * Add PROJSYS_MichiganGeoRef.
00123  *
00124  * Revision 1.100  2001/12/20 21:43:22  mju
00125  * Enum docs.
00126  *
00127  * Revision 1.99  2001/12/19 14:16:52  mju
00128  * Attempt to get Genitor to provide proper link to nested class definitions.
00129  *
00130  * Revision 1.97  2001/11/16 14:35:39  mju
00131  * Add PROJSYS_Swiss.
00132  *
00133  * Revision 1.96  2001/11/15 23:28:37  mju
00134  * Add DATUM_Tokyo_Japan.
00135  *
00136  * Revision 1.95  2001/11/15 23:08:47  mju
00137  * Add PROJSYS_Japan19.
00138  *
00139  * Revision 1.94  2001/11/01 18:48:59  mju
00140  * Remove 'NUMPROJS' defn as obsolete.
00141  *
00142  * Revision 1.93  2001/10/30 19:14:23  mju
00143  * Add DATUM enums used by MapInfo.
00144  *
00145  * Revision 1.92  2001/10/19 17:56:53  mju
00146  * Add PROJSYS_GaussKruger3deg & Austria.
00147  * Add DATUM_MGI.
00148  *
00149  * Revision 1.91  2001/08/27 21:02:53  mju
00150  * Add PROJSYS_GhanaNational.
00151  *
00152  * Revision 1.90  2001/08/14 21:18:30  mju
00153  * Add SetSystemGaussKruger.
00154  *
00155  * Revision 1.89  2001/07/10 17:52:32  scowan
00156  * Changed function names to fit naming convension.
00157  *
00158  * Revision 1.88  2001/07/10 17:40:00  scowan
00159  * Added more exported functions.
00160  *
00161  * Revision 1.85  2001/06/21 17:37:26  mju
00162  * Add PROJSYS_AMG/MGA.
00163  *
00164  * Revision 1.84  2001/06/21 15:26:58  mju
00165  * Add more DATUM enums.
00166  *
00167  * Revision 1.83  2001/06/20 13:18:00  mju
00168  * Add ProjGetERMapper().
00169  *
00170  * Revision 1.82  2001/06/19 20:36:34  mju
00171  * Add new enums for datums used in ER-Mapper.
00172  *
00173  * Revision 1.80  2000/11/27 15:37:10  mju
00174  * Rename 'proj name' as 'oldprojname'.
00175  *
00176  * Revision 1.79  2000/11/22 17:02:05  mju
00177  * "Remove" setprojparmname().
00178  *
00179  * Revision 1.74  2000/09/22 15:04:29  mju
00180  * Add DATUM_Schwarzeck.
00181  *
00182  * Revision 1.73  2000/09/20 14:50:07  mju
00183  * Add op==/op!= for MAPPROJPARM.
00184  *
00185  * Revision 1.72  2000/07/18 21:36:58  mju
00186  * Add mapprojparm::SetSystemUPS.
00187  *
00188  * Revision 1.71  2000/07/06 17:06:17  mju
00189  * Define enum operators for GETPROJPARMFLAGS.
00190  *
00191  * Revision 1.70  2000/06/28 20:22:30  mju
00192  * Add new datum enums used in er-mapper import.
00193  *
00194  * Revision 1.63  2000/05/25 13:07:28  mju
00195  * Include stdlib.h if not already so hopefully will have abs() defined on the Mac.
00196  *
00197  * Revision 1.62  2000/05/24 22:56:17  dwilliss
00198  * use ::abs
00199  *
00200  * Revision 1.61  2000/05/12 15:18:54  mju
00201  * Include string.h for memset() defn.
00202  *
00203  * Revision 1.60  2000/05/11 22:12:19  mju
00204  * Add MAPPROJPARM ctor.
00205  *
00206  * Revision 1.55  2000/05/10 16:06:15  mju
00207  * Make DATUM and PROJSYS enums.
00208  * Add lots of inline methods to MAPPROJPARM, including methods for setting projection-specific parameters.
00209  *
00210  * Revision 1.53  2000/03/01 20:32:34  dwilliss
00211  * Named some parms in prototypes to make include file more self documenting.
00212  * (Useful for those of use who use VisualStudio to edit instead of CodeWrite)
00213  *
00214  * Revision 1.52  2000/02/29 17:01:54  mju
00215  * Add ELLIPSOID constants and TPARM constants.
00216  *
00217  * Revision 1.50  1999/07/21  16:48:49  mju
00218  * Add PROJSYS_Finnish & DATUM_KKJ.
00219  *
00220  * Revision 1.49  1999/07/21  16:32:38  mju
00221  * Add additional PROJSYS defns.
00222  *
00223  * Revision 1.48  1999/07/16  21:57:58  mju
00224  * Add DATUM_TRANS_ defns for Similarity and BursaWolfe.
00225  *
00226  * Revision 1.47  1999/07/15  21:56:57  mju
00227  * Add NZMG.
00228  *
00229  * Revision 1.46  1999/07/14  17:34:46  mju
00230  * Change PointZone to use UNICODE.
00231  *
00232  * Revision 1.45  1999/07/09  21:31:39  mju
00233  * Add auto-zone features.
00234  * Add MGRS system.
00235  * \endif
00236 **/
00237 
00238 #ifndef  INC_MI32_MAPPROJ_H
00239 #define  INC_MI32_MAPPROJ_H
00240 #define  INC_MI32_MAPPROJ_H
00241 
00242 #ifndef  INC_MI32_STDDEFNS_H
00243 #include <mi32/stddefns.h>
00244 #endif
00245 
00246 #ifndef  INC_MI32_ERRCODES_H
00247 #include <mi32/errcodes.h>
00248 #endif
00249 
00250 #ifndef  INC_MI32_SIMPLEAR_H
00251 #include <mi32/simplear.h>
00252 #endif
00253 
00254 #ifndef  INC_COORD_H
00255 #include <mi32/point.h>
00256 #endif
00257 
00258 #ifndef  INC_MI32_MISTRING_H
00259    #include <mi32/mistring.h>
00260 #endif
00261 
00262 #ifndef  INC_STRING_H
00263 #include <string.h>     // Includes defn for memset()
00264 #define  INC_STRING_H
00265 #endif
00266 
00267 #ifndef  INC_STDLIB_H
00268 #include <stdlib.h>
00269 #define  INC_STDLIB_H
00270 #endif
00271 
00272 #ifdef GEOMDLL
00273    #define GEOMLIBEXPORT MI_DLLEXPORT
00274 #else
00275    #define GEOMLIBEXPORT MI_DLLIMPORT
00276 #endif
00277 
00278 //! Forward declarations
00279 
00280 struct CTRLPOINT3;
00281 struct MAPPROJPARM;
00282 class FILEPATH;
00283 
00284 enum PROJECTION {
00285    PROJECTION_Undefined =                       -3,   //!< Unknown or undefined projection
00286    PROJECTION_None =                            -2,   //!< No projection
00287    PROJECTION_Arbitrary =                       -1,   //!< Arbitrary local coordinates
00288    PROJECTION_LatLon =                           0,   //!< Latitude/longitude
00289    PROJECTION_Geographic =                       0,   //!< Latitude/longitude
00290    PROJECTION_UTM =                              1,   //!< Universal Transverse Mercator
00291    PROJECTION_StatePlane =                       2,   //!< State plane
00292    PROJECTION_AlbersEqualAreaConic =             3,   //!< Albers Equal-Area Conic
00293    PROJECTION_AEAC =                             3,   //!< Albers Equal-Area Conic
00294    PROJECTION_LambertConformalConic =            4,   //!< Lambert Conformal Conic
00295    PROJECTION_LCC =                              4,   //!< Lambert Conformal Conic
00296    PROJECTION_Mercator =                         5,   //!< Mercator
00297    PROJECTION_PolarStereographic =               6,   //!< Polar Stereographic
00298    PROJECTION_Polyconic =                        7,   //!< Polyconic
00299    PROJECTION_EquidistantConic =                 8,   //!< Equidistant Conic
00300    PROJECTION_TransverseMercator =               9,   //!< Transverse Mercator
00301    PROJECTION_Stereographic =                   10,   //!< Stereographic
00302    PROJECTION_LambertAzimuthalEqualArea =       11,   //!< Lambert Azimuthal Equal-Area
00303    PROJECTION_LAEA =                            11,   //!< Lambert Azimuthal Equal-Area
00304    PROJECTION_AzimuthalEquidistant =            12,   //!< Azimuthal Equidistant
00305    PROJECTION_Gnomonic =                        13,   //!< Gnomonic
00306    PROJECTION_Orthographic =                    14,   //!< Orthographic
00307    PROJECTION_GeneralVertNearSidePerspective =  15,   //!< General Vertical Near-Side Perspective
00308    PROJECTION_GVNSP =                           15,   //!< General Vertical Near-Side Perspective
00309    PROJECTION_Sinusoidal =                      16,   //!< Sinusoidal
00310    PROJECTION_Equirectangular =                 17,   //!< Equirectangular
00311    PROJECTION_MillerCylindrical =               18,   //!< Miller Cylindrical
00312    PROJECTION_VanDerGrintenI =                  19,   //!< Van Der Grinten I
00313    PROJECTION_ObliqueMercator =                 20,   //!< Oblique Mercator (Hotine)
00314    PROJECTION_Robinson =                        21,   //!< Robinson
00315    PROJECTION_BipolarObliqueConformalConic =    22,   //!< Bipolar Oblique Conformal Conic
00316    PROJECTION_BOCC =                            22,   //!< Bipolar Oblique Conformal Conic
00317    PROJECTION_LandsatSpaceObliqueMercator =     23,   //!< Space Oblique Mercator for Landsat
00318    PROJECTION_LandsatSOM =                      23,   //!< Space Oblique Mercator for Landsat
00319    PROJECTION_Cassini =                         24,   //!< Cassini
00320    PROJECTION_NewZealandMapGrid =               25,   //!< New Zealand Map Grid
00321    PROJECTION_NZMG =                            25,   //!< New Zealand Map Grid
00322    PROJECTION_SwissConformalCylindrical =       26,   //!< Swiss Conformal Cylindrical
00323    PROJECTION_RoyalDutch =                      27,   //!< Dutch National Grid (RD)
00324    PROJECTION_ObliqueStereographic =            28,   //!< Oblique Stereographic
00325    PROJECTION_InterruptedGoodeHomolosine =      29,   //!< Interrupted Goode Homolosine
00326    PROJECTION_Goode =                           29,   //!< Interrupted Goode Homolosine
00327    };
00328 
00329 
00330 #define  MAXPROJ  29
00331 
00332 #define  PROJ_Undefined    PROJECTION_Undefined
00333 #define  PROJ_None         PROJECTION_None
00334 #define  PROJ_Arbitrary    PROJECTION_Arbitrary
00335 #define  PROJ_LatLon       PROJECTION_LatLon
00336 #define  PROJ_UTM          PROJECTION_UTM
00337 #define  PROJ_StatePlane   PROJECTION_StatePlane
00338 #define  PROJ_AlbersConic  PROJECTION_AlbersEqualAreaConic
00339 #define  PROJ_LambertConf  PROJECTION_LambertConformalConic
00340 #define  PROJ_Mercator     PROJECTION_Mercator
00341 #define  PROJ_PolarStereo  PROJECTION_PolarStereographic
00342 #define  PROJ_Polyconic    PROJECTION_Polyconic
00343 #define  PROJ_EquidistCon  PROJECTION_EquidistantConic
00344 #define  PROJ_TransMercat  PROJECTION_TransverseMercator
00345 #define  PROJ_StereoGraph  PROJECTION_Stereographic
00346 #define  PROJ_LambertAzim  PROJECTION_LambertAzimuthalEqualArea
00347 #define  PROJ_AzimEquidis  PROJECTION_AzimuthalEquidistant
00348 #define  PROJ_Gnomonic     PROJECTION_Gnomonic
00349 #define  PROJ_Orthograph   PROJECTION_Orthographic
00350 #define  PROJ_GenVertPers  PROJECTION_GVNSP
00351 #define  PROJ_Sinusoidal   PROJECTION_Sinusoidal
00352 #define  PROJ_Equirectang  PROJECTION_Equirectangular
00353 #define  PROJ_MillerCylin  PROJECTION_MillerCylindrical
00354 #define  PROJ_VanDerGrint  PROJECTION_VanDerGrintenI
00355 #define  PROJ_ObliqueMerc  PROJECTION_ObliqueMercator
00356 #define  PROJ_Robinson     PROJECTION_Robinson
00357 #define  PROJ_BipolarConic PROJECTION_BOCC
00358 #define  PROJ_LandsatSOM   PROJECTION_LandsatSOM
00359 #define  PROJ_Cassini      PROJECTION_Cassini
00360 #define  PROJ_NZMG         PROJECTION_NZMG
00361 #define  PROJ_SwissConCyl  PROJECTION_SwissConformalCylindrical
00362 #define  PROJ_RoyalDutch   PROJECTION_RoyalDutch
00363 
00364 #define  TPARM_SemiMajorAxis  0
00365 #define  TPARM_SemiMinorAxis  1
00366 #define  TPARM_FalseEasting   6
00367 #define  TPARM_FalseNorthing  7
00368 
00369 #define  DATUM_TRANS_BuiltIn     0     //!< Built-in transformation
00370 #define  DATUM_TRANS_Molodensky  1     //!< Molodensky 3-parameter transformation
00371 #define  DATUM_TRANS_Similarity  2     //!< 7-parameter similarity transformation
00372 #define  DATUM_TRANS_BursaWolfe  3     //!< 7-parameter Bursa-Wolfe transformation
00373 #define  DATUM_TRANS_Grid        4     //!< Grid offsets
00374 
00375 //! Geodetic datum IDs.
00376 enum DATUM {
00377 
00378    DATUM_Unspecified =           0,          //!< Unspecified or unknown
00379    DATUM_WGS84 =                 1,          //!< World Geodetic System 1984
00380    DATUM_WGS72 =                 2,          //!< World Geodetic System 1972
00381    DATUM_NAD27 =                 1927,       //!< North American Datum 1927
00382    DATUM_NAD83 =                 1983,       //!< North American Datum 1983
00383 
00384    DATUM_Adindan =               101,
00385    DATUM_Adindan_Sudan =         107,
00386    DATUM_Afgooye =               108,
00387    DATUM_AGD66 =                 128,
00388    DATUM_AGD84 =                 289,
00389    DATUM_AinElAbd_Bahrain =      109,
00390    DATUM_Amersfoort =            290,
00391    DATUM_Anna1Astro =            111,
00392    DATUM_Arc1950 =               113,
00393    DATUM_Arc1960 =               122,
00394    DATUM_AscensionIsland1968 =   123,
00395    DATUM_AstroBeaconE =          124,
00396    DATUM_AstroDOS_71_4 =         125,
00397    DATUM_AstroTernIsland1961 =   126,
00398    DATUM_AstroStation1952 =      127,
00399    DATUM_Bahrain =               109,
00400    DATUM_Beijing =               324,
00401    DATUM_BellevueIGN =           131,
00402    DATUM_Bermuda1957 =           132,
00403    DATUM_Bogota =                134,
00404    DATUM_Camacupa =              291,
00405    DATUM_CampoInchauspe =        137,
00406    DATUM_CantonAstro1966 =       138,
00407    DATUM_Cape =                  139,
00408    DATUM_CapeBursaWolfe =        329,
00409    DATUM_CapeBursaMod =          334,
00410    DATUM_CapeCanaveral =         140,
00411    DATUM_Carthage =              141,
00412    DATUM_CH1903 =                331,
00413    DATUM_ChathamIsland1971 =     142,
00414    DATUM_Chua =                  143,
00415    DATUM_CorregoAlegre =         144,
00416    DATUM_DealulPiscului1970 =    417,
00417    DATUM_Djakarta =              146,
00418    DATUM_DOS1968 =               147,
00419    DATUM_EasterIsland1967 =      148,
00420    DATUM_ED50 =                  149,
00421    DATUM_ED50_Egypt =            153,
00422    DATUM_ED79 =                  162,
00423    DATUM_EgyptOld =              223,
00424    DATUM_Fahud =                 229,
00425    DATUM_GandajikaBase1970 =     164,
00426    DATUM_GDA94 =                 288,
00427    DATUM_GraciosaBaseSW1948 =    166,
00428    DATUM_Guam1963 =              167,
00429    DATUM_GUX1Astro =             169,
00430    DATUM_HitoXVIII1963 =         249,
00431    DATUM_Hjorsey1955 =           171,
00432    DATUM_HongKong1963 =          172,
00433    DATUM_HuTzuShan =             173,
00434    DATUM_Ind54 =                 154,
00435    DATUM_Ind60 =                 335,
00436    DATUM_Ind75 =                 177,
00437    DATUM_Indian_Bangladesh =     174,
00438    DATUM_Indian_India_Nepal =    175,
00439    DATUM_Ireland1965 =           178,
00440    DATUM_ISTS073Astro1969 =      180,
00441    DATUM_JohnstonIsland1961 =    181,
00442    DATUM_Kalianpur_India =       306,
00443    DATUM_Kandawala =             182,
00444    DATUM_KerguelenIsland1949 =   183,
00445    DATUM_Kertau =                184,
00446    DATUM_KKJ =                   326,
00447    DATUM_LC5Astro1961 =          186,
00448    DATUM_Leigon =                187,
00449    DATUM_Liberia1954 =           188,
00450    DATUM_Luzon =                 189,
00451    DATUM_Luzon_Mindanao =        190,
00452    DATUM_Mahe =                  191,
00453    DATUM_Manoca =                309,
00454    DATUM_Massawa =               192,
00455    DATUM_Merchich =              193,
00456    DATUM_MidwayAstro1961 =       194,
00457    DATUM_MGI =                   339,
00458    DATUM_Minna_Cameroon =        195,
00459    DATUM_Minna_Nigeria =         196,
00460    DATUM_Mporo =                 198,
00461    DATUM_NAD27_Alaska =          210,
00462    DATUM_NAD27_Bahamas =         211,
00463    DATUM_NAD27_Canada =          206,
00464    DATUM_NAD27_CanalZone =       218,
00465    DATUM_NAD27_Caribbean =       204,
00466    DATUM_NAD27_CentralAmerica =  205,
00467    DATUM_NAD27_Cuba =            219,
00468    DATUM_NAD27_Greenland =       220,
00469    DATUM_NAD27_Mexico =          221,
00470    DATUM_NAD27_SanSalvador =     212,
00471    DATUM_Nahrwan =               199,
00472    DATUM_Nahrwan_SaudiArabia =   201,
00473    DATUM_Nahrwan_UAE =           202,
00474    DATUM_NaparimaBWI =           203,
00475    DATUM_NewZealand1949 =        347,
00476    DATUM_NZGD2000 =              348,
00477    DATUM_NTF =                   312,
00478    DATUM_NWL9D =                 337,
00479    DATUM_ObservatorioMet1939 =   222,
00480    DATUM_OSGB36 =                294,
00481    DATUM_OldHawaii =             224,        //!< Old Hawaiian - Mean for Hawaii, Kauuai, Maui, Oahu
00482    DATUM_PicoDeLasNieves =       235,
00483    DATUM_PitcairnAstro1967 =     236,
00484    DATUM_PointeNoire =           238,
00485    DATUM_PortoSanto1936 =        239,
00486    DATUM_Potsdam =               325,
00487    DATUM_PRS92 =                 336,
00488    DATUM_PSAD56 =                240,
00489    DATUM_PuertoRico =            250,        //!< Puerto Rico datum
00490    DATUM_Pulkovo_Romania =       319,
00491    DATUM_Pulkovo_Russia =        287,
00492    DATUM_Qatar =                 251,
00493    DATUM_Qornoq =                252,
00494    DATUM_Reunion =               253,
00495    DATUM_Rome1940 =              389,
00496    DATUM_Rome1940_Sardinia =     387,
00497    DATUM_Rome1940_Sicily =       388,
00498    DATUM_SAD69 =                 261,
00499    DATUM_SantoDOS1965 =          255,
00500    DATUM_SaoBraz =               256,
00501    DATUM_SapperHill1943 =        257,
00502    DATUM_SelvagemGrande =        159,
00503    DATUM_Schwarzeck =            258,
00504    DATUM_SJTSK95 =               343,
00505    DATUM_SouthAsia =             274,
00506    DATUM_Tananarive =            275,
00507    DATUM_Timbalai =              276,
00508    DATUM_Tokyo_Mean =            277,
00509    DATUM_Tokyo_Japan =           278,
00510    DATUM_Tokyo_Grid =            474,
00511    DATUM_TristanAstro1968 =      281,
00512    DATUM_VitiLevu1916 =          282,
00513    DATUM_WakeEniwetok1960 =      283,
00514    DATUM_Yacare =                285,
00515    DATUM_Zanderij =              286,
00516 
00517    // The following datums have multiple regression transformations
00518    DATUM_MRE_AGD66 =    1001,          //!< Australian Geodetic Datum 1966
00519    DATUM_MRE_AGD84 =    1002,          //!< Australian Geodetic Datum 1984
00520    DATUM_MRE_CAI =      1003,          //!< Campo Inchauspe Datum (Argentina)
00521    DATUM_MRE_COA =      1004,          //!< Corrego Alegro Datum (Brazil)
00522    DATUM_MRE_ED50 =     1005,          //!< European Datum 1950 (Western Europe)
00523    DATUM_MRE_NAD27_C =  1006,          //!< North American Datum 1927 (Canada)
00524    DATUM_MRE_NAD27_U =  1007,          //!< North American Datum 1927 (Contental U.S.)
00525    DATUM_MRE_SAD69 =    1008           //!< South American Datum 1969
00526 
00527    };
00528 
00529 #define  DATUM_MRE_First   1001
00530 #define  DATUM_MRE_Last    1008
00531 
00532 //! Commonly-used ellipsoids
00533 #define  ELLIPSOID_GRS_1980         1
00534 #define  ELLIPSOID_Clarke_1866      2
00535 #define  ELLIPSOID_WGS_1972         7
00536 #define  ELLIPSOID_WGS_1984         51
00537 
00538 //! Projection system IDs.
00539 enum PROJSYS {
00540    PROJSYS_UserDefined =      0,
00541    PROJSYS_LatLon =           1,       //!< Latitude-Longitude
00542    PROJSYS_Geographic =       2,       //!< Same as latitude-longitude
00543    PROJSYS_StatePlane1927 =   3,       //!< United States State Plane 1927
00544    PROJSYS_StatePlane1983 =   4,       //!< United States State Plane 1983
00545    PROJSYS_UTM =              5,       //!< Universal Transverse Mercator
00546    PROJSYS_UPS =              6,       //!< Universal Polar Stereographic
00547    PROJSYS_GaussKruger =      7,       //!< Gauss-Kruger (6-degree zones)
00548    PROJSYS_MGRS =             8,       //!< Military Grid Reference System
00549    PROJSYS_NZMG =             9,       //!< New Zealand Map Grid
00550    PROJSYS_BritishNational =  10,      //!< British National Grid
00551    PROJSYS_German =           11,      //!< Germany
00552    PROJSYS_Finnish =          12,      //!< Finnish National Grid
00553    PROJSYS_Namibian =         13,      //!< Namibian Map System
00554    PROJSYS_AMG =              14,      //!< Australian Map Grid
00555    PROJSYS_MGA =              15,      //!< Map Grid of Australia
00556    PROJSYS_GhanaNational =    16,      //!< Ghana National Grid
00557    PROJSYS_GaussKruger3deg =  17,      //!< Gauss-Kruger (3-degree zones)
00558    PROJSYS_Austria =          18,      //!< Austria
00559    PROJSYS_Japan19 =          19,      //!< Japan-19
00560    PROJSYS_Swiss =            20,      //!< Swiss
00561    PROJSYS_MichiganGeoRef =   21,      //!< Michigan GeoRef
00562    PROJSYS_Dutch =            22,      //!< Dutch National Grid
00563    PROJSYS_NZTM =             23,      //!< New Zealand Transverse Mercator
00564    PROJSYS_Romania =          24,      //!< Romania
00565    PROJSYS_Italy =            25,      //!< Italy
00566    PROJSYS_Colombia =         26,      //!< Colombia
00567    PROJSYS_WisconsinCounty =  101,     //!< Wisconsin County Coordinate System
00568 
00569    PROJSYS_COUNT
00570    };
00571 
00572 //----------------------------------------------------------------------------
00573 //    Function Prototypes                                                     
00574 //----------------------------------------------------------------------------
00575 
00576 //!:Associate with "Map Projection Functions"
00577 //!\addtogroup mapproj Map Projection Functions
00578 //!@{
00579 
00580 GEOMLIBEXPORT ERRVALUE MapInfoReadTabGeoreference (
00581    const FILEPATH& filepath, 
00582    MAPPROJPARM& projparm, 
00583    SIMPLE_ARRAY<CTRLPOINT3>& points
00584    );
00585    
00586 GEOMLIBEXPORT ERRVALUE MapInfoExportGeoreference (
00587    const MAPPROJPARM& projparm, 
00588    int xyunits, 
00589    int& MapInfoProj, 
00590    int& MapInfoDatum, 
00591    double MapInfoProjParm[6], 
00592    char ProjStr[256]
00593    );
00594 
00595 extern "C" {
00596 
00597 #if !defined(NO_DEPRECATED) || defined(GEOMDLL)
00598 //! Compute distance in meters between two points in specified projection.
00599 //! \deprecated Use SPATREF classes.
00600 //! @return Distance between points in meters.
00601 //! If the coordinate system is Latitude-Longitude the distance along a geodetic
00602 //! is returned (actual distance over curved surface).
00603 GEOMLIBEXPORT double ProjDistToMeters (
00604    const MAPPROJPARM* proj,            //!< Projection parameters, will use GRS-1980 ellipsoid if NULL
00605    double x1,                          //!< X coordinate of first point (in meters or degrees)
00606    double y1,                          //!< Y coordinate of first point
00607    double x2,                          //!< X coordinate of second point
00608    double y2                           //!< Y coordinate of second point
00609    );
00610 #endif
00611 
00612 //! Set ER-Mapper projection and datum names from MAPPROJPARM.
00613 GEOMLIBEXPORT ERRVALUE ProjGetERMapper (
00614    const MAPPROJPARM& projparm,        //!< Projection parameters
00615    char *ProjectionName,               //!< ER-Mapper projection name returned, must be at least 16 characters
00616    char *DatumName                     //!< ER-Mapper datum name returned, must be at least 16 characters
00617    );
00618 
00619 //! Set projection parameters from ER-Mapper Projection and Datum names.
00620 GEOMLIBEXPORT ERRVALUE ProjSetERMapper (
00621    MAPPROJPARM& projparm,              //!< Projection parameters to fill in
00622    const char *ProjectionName,         //!< ER-Mapper projection name
00623    const char *DatumName               //!< ER-Mapper datum name
00624    );
00625 
00626 }  // Extern "C"
00627 
00628 GEOMLIBEXPORT void ProjGetArcPrj (
00629    const MAPPROJPARM& ProjParm,
00630    MISTRINGLIST& PrjList
00631    );
00632 
00633 GEOMLIBEXPORT bool ProjSetArcPrj (
00634    MAPPROJPARM& ProjParm,
00635    const MISTRINGLIST& PrjList,
00636    double& xshift,
00637    double& yshift,
00638    double& scale
00639    );
00640 
00641 //!@}
00642 
00643 //----------------------------------------------------------------------------
00644 //!      Map projection parameter structure                                      
00645 //----------------------------------------------------------------------------
00646 
00647 #define  PROJZ_ZONE     0
00648 #define  PROJZ_SYSTEM   1
00649 #define  PROJZ_DATUM    2
00650 #define  PROJZ_ALTPROJ  3
00651 
00652 //! Parameters for a specific map projection, coordinate system and geodetic datum.
00653 struct MAPPROJPARM {
00654    // This structure is used extensively within other structure and in DLLs.
00655    // Therefore, members may not be added or removed, nor may virtual methods be added.
00656 
00657    #ifndef GENERATING_DOXYGEN_OUTPUT
00658 
00659    INT16 mapproj;
00660    UNICODE oldprojname[35];      //!< No longer valid, use GetName() instead
00661    INT16 zone[4];
00662    double tparm[15];
00663 
00664    #endif // GENERATING_DOXYGEN_OUTPUT
00665 
00666    //! Default constructor.
00667    MAPPROJPARM (
00668       ) { Clear(); }
00669 
00670    //! Clear all parameters and reset to Arbitrary Local coordinates.
00671    void Clear (
00672       ) { memset(static_cast<void*>(this),0,sizeof(*this)); mapproj = PROJECTION_Arbitrary; }
00673 
00674    //! Get datum ID.
00675    DATUM GetDatum (
00676       ) const { return (static_cast<DATUM>(zone[PROJZ_DATUM])); }
00677 
00678 #ifndef NO_DEPRECATED
00679    //! Compute distance in meters between specified points.
00680    //! \deprecated Use SPATREF classes.
00681    //! @return Distance in meters.
00682    //! If the coordinate system is Latitude-Longitude the distance along a geodetic
00683    //! is returned (actual distance over curved surface).
00684    DEPRECATED double GetDistanceInMeters (
00685       double x1,
00686       double y1,
00687       double x2,
00688       double y2
00689       ) const { return (ProjDistToMeters(this,x1,y1,x2,y2)); }
00690 #endif
00691 
00692 #ifndef NO_DEPRECATED
00693    //! Determine distance in meters between specified points.
00694    //! \deprecated Use SPATREF classes.
00695    //! @return Distance in meters.
00696    //! If the coordinate system is Latitude-Longitude the distance along a geodetic
00697    //! is returned (actual distance over curved surface).
00698    DEPRECATED double GetDistanceInMeters (
00699       const DPOINT2D& point1,
00700       const DPOINT2D& point2
00701       ) const { return (ProjDistToMeters(this,point1.x,point1.y,point2.x,point2.y)); }
00702 #endif
00703 
00704    //! Get projection ID.
00705    PROJECTION GetProjection (
00706       ) const { return (static_cast<PROJECTION>(mapproj)); }
00707 
00708    //! Get sub-projection ID.
00709    INT16 GetProjSub (
00710       ) const { return (zone[PROJZ_ALTPROJ]); }
00711 
00712    //! Get system ID.
00713    PROJSYS GetSystem (
00714       ) const { return (static_cast<PROJSYS>(zone[PROJZ_SYSTEM])); }
00715 
00716    //! Get zone ID.
00717    INT16 GetZone (
00718       ) const { return (zone[PROJZ_ZONE]); }
00719 
00720    //! Set datum ID.
00721    void SetDatum (
00722       DATUM datum
00723       ) { zone[PROJZ_DATUM] = static_cast<INT16>(datum); }
00724 
00725    //! Set projection to Albers Equal-Area Conic.
00726    ERRVALUE SetProjectionAEAC (
00727       double LatStdParallel1,          //!< Latitude of first standard parallel (degrees)
00728       double LatStdParallel2,          //!< Latitude of second standard parallel (degrees)
00729       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
00730       double LatOrigin = 0.0,          //!< Latitude of origin (degrees)
00731       double FalseEasting = 0.0,       //!< False easting (meters)
00732       double FalseNorthing = 0.0       //!< False northing (meters)
00733       ) {
00734       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00735       zone[PROJZ_ZONE] = 0;
00736       mapproj = PROJECTION_AEAC;
00737       tparm[2] = LatStdParallel1;
00738       tparm[3] = LatStdParallel2;
00739       tparm[4] = LonCentralMeridian;
00740       tparm[5] = LatOrigin;
00741       tparm[TPARM_FalseEasting] = FalseEasting;
00742       tparm[TPARM_FalseNorthing] = FalseNorthing;
00743       return (0);
00744       }
00745 
00746    //! Set projection to arbitrary.
00747    void SetProjectionArbitrary (
00748       ) {
00749       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00750       mapproj = PROJECTION_Arbitrary;
00751       return;
00752       }
00753 
00754    //! Set projection to Azimuthal Equidistant.
00755    ERRVALUE SetProjectionAzimuthalEquidistant (
00756       double LonCenter,                //!< Longitude of center of projection (degrees)
00757       double LatCenter,                //!< Latitude of center of projection (degrees)
00758       double FalseEasting = 0.0,       //!< False easting (meters)
00759       double FalseNorthing = 0.0       //!< False northing (meters)
00760       ) {
00761       return (SetProj4567(PROJECTION_AzimuthalEquidistant,LonCenter,LatCenter,FalseEasting,FalseNorthing));
00762       }
00763 
00764    //! Set projection to Bipolar Oblique Conformal Conic.
00765    ERRVALUE SetProjectionBOCC (
00766       bool skewed = true               //!< true if skewed, false if not
00767       ) {
00768       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00769       zone[PROJZ_ZONE] = 0;
00770       mapproj = PROJECTION_BOCC;
00771       tparm[2] = !skewed;
00772       return (0);
00773       }
00774 
00775    //! Set projection to Cassini.
00776    ERRVALUE SetProjectionCassini (
00777       double LonCenter,                //!< Longitude of center of projection (degrees)
00778       double LatCenter,                //!< Latitude of center of projection (degrees)
00779       double FalseEasting = 0.0,       //!< False easting (meters)
00780       double FalseNorthing = 0.0       //!< False northing (meters)
00781       ) {
00782       return (SetProj4567(PROJECTION_Cassini,LonCenter,LatCenter,FalseEasting,FalseNorthing));
00783       }
00784 
00785    //! Set projection to Equidistant Conic with single standard parallel.
00786    ERRVALUE SetProjectionEquidistantConic1SP (
00787       double LatStdParallel,           //!< Latitude of standard parallel (degrees)
00788       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
00789       double LatOrigin = 0.0,          //!< Latitude of origin (degrees)
00790       double FalseEasting = 0.0,       //!< False easting (meters)
00791       double FalseNorthing = 0.0       //!< False northing (meters)
00792       ) {
00793       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00794       zone[PROJZ_ZONE] = 0;
00795       mapproj = PROJECTION_EquidistantConic;
00796       tparm[2] = tparm[3] = LatStdParallel;
00797       tparm[4] = LonCentralMeridian;
00798       tparm[5] = LatOrigin;
00799       tparm[TPARM_FalseEasting] = FalseEasting;
00800       tparm[TPARM_FalseNorthing] = FalseNorthing;
00801       tparm[8] = 0.0;
00802       return (0);
00803       }
00804 
00805    //! Set projection to Equidistant Conic with two standard parallels.
00806    ERRVALUE SetProjectionEquidistantConic2SP (
00807       double LatStdParallel1,          //!< Latitude of first standard parallel (degrees)
00808       double LatStdParallel2,          //!< Latitude of second standard parallel (degrees)
00809       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
00810       double LatOrigin = 0.0,          //!< Latitude of origin (degrees)
00811       double FalseEasting = 0.0,       //!< False easting (meters)
00812       double FalseNorthing = 0.0       //!< False northing (meters)
00813       ) {
00814       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00815       zone[PROJZ_ZONE] = 0;
00816       mapproj = PROJECTION_EquidistantConic;
00817       tparm[2] = LatStdParallel1;
00818       tparm[3] = LatStdParallel2;
00819       tparm[4] = LonCentralMeridian;
00820       tparm[5] = LatOrigin;
00821       tparm[TPARM_FalseEasting] = FalseEasting;
00822       tparm[TPARM_FalseNorthing] = FalseNorthing;
00823       tparm[8] = 1.0;
00824       return (0);
00825       }
00826 
00827    //! Set projection to Equirectangular.
00828    ERRVALUE SetProjectionEquirectangular (
00829       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
00830       double LatTrueScale,             //!< Latitude of true scale (degrees)
00831       double FalseEasting = 0.0,       //!< False easting (meters)
00832       double FalseNorthing = 0.0       //!< False northing (meters)
00833       ) {
00834       return (SetProj4567(PROJECTION_Equirectangular,LonCentralMeridian,LatTrueScale,FalseEasting,FalseNorthing));
00835       }
00836 
00837    //! Set projection to Gnomonic.
00838    ERRVALUE SetProjectionGnomonic (
00839       double LonCenter,                //!< Longitude of center of projection (degrees)
00840       double LatCenter,                //!< Latitude of center of projection (degrees)
00841       double FalseEasting = 0.0,       //!< False easting (meters)
00842       double FalseNorthing = 0.0       //!< False northing (meters)
00843       ) {
00844       return (SetProj4567(PROJECTION_Gnomonic,LonCenter,LatCenter,FalseEasting,FalseNorthing));
00845       }
00846 
00847    //! Set projection to General Vertical Near-Side Perspective.
00848    ERRVALUE SetProjectionGVNSP (
00849       double Height,                   //!< Height above sphere of reference (meters)
00850       double LonCenter,                //!< Longitude of center of projection (degrees)
00851       double LatCenter,                //!< Latitude of center of projection (degrees)
00852       double FalseEasting = 0.0,       //!< False easting (meters)
00853       double FalseNorthing = 0.0       //!< False northing (meters)
00854       ) {
00855       return (SetProj24567(PROJECTION_GVNSP,Height,LonCenter,LatCenter,FalseEasting,FalseNorthing));
00856       }
00857 
00858    //! Set projection to Lambert Azimuthal Equal-Area.
00859    ERRVALUE SetProjectionLAEA (
00860       double LonCenter,                //!< Longitude of center of projection (degrees)
00861       double LatCenter,                //!< Latitude of center of projection (degrees)
00862       double FalseEasting = 0.0,       //!< False easting (meters)
00863       double FalseNorthing = 0.0       //!< False northing (meters)
00864       ) {
00865       return (SetProj4567(PROJECTION_LAEA,LonCenter,LatCenter,FalseEasting,FalseNorthing));
00866       }
00867 
00868    //! Set projection to Lambert Conformal Conic.
00869    ERRVALUE SetProjectionLCC (
00870       double LatStdParallel1,          //!< Latitude of first standard parallel (degrees)
00871       double LatStdParallel2,          //!< Latitude of second standard parallel (degrees)
00872       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
00873       double LatOrigin = 0.0,          //!< Latitude of origin (degrees)
00874       double FalseEasting = 0.0,       //!< False easting (meters)
00875       double FalseNorthing = 0.0,      //!< False northing (meters)
00876       double ScaleFactor = 1.0         //!< Scale factor
00877       ) {
00878       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00879       zone[PROJZ_ZONE] = 0;
00880       mapproj = PROJECTION_LCC;
00881       tparm[2] = LatStdParallel1;
00882       tparm[3] = LatStdParallel2;
00883       tparm[4] = LonCentralMeridian;
00884       tparm[5] = LatOrigin;
00885       tparm[TPARM_FalseEasting] = FalseEasting;
00886       tparm[TPARM_FalseNorthing] = FalseNorthing;
00887       tparm[8] = ScaleFactor;
00888       return (0);
00889       }
00890 
00891    //! Set projection to Landsat Space Oblique Mercator.
00892    ERRVALUE SetProjectionLandsatSOM (
00893       int satellite,                   //!< Satellite (1-5)
00894       int path                         //!< Satellite path (1-251)
00895       ) {
00896       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00897       zone[PROJZ_ZONE] = 0;
00898       mapproj = PROJECTION_LandsatSOM;
00899       tparm[2] = satellite;
00900       tparm[3] = path;
00901       return (0);
00902       }
00903 
00904    //! Set projection to Mercator.
00905    ERRVALUE SetProjectionMercator (
00906       double ScaleFactor,              //!< Scale factor at central meridian
00907       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
00908       double LatTrueScale,             //!< Latitude of true scale (degrees)
00909       double FalseEasting = 0.0,       //!< False easting (meters)
00910       double FalseNorthing = 0.0       //!< False northing (meters)
00911       ) {
00912       return (SetProj24567(PROJECTION_Mercator,ScaleFactor,LonCentralMeridian,LatTrueScale,FalseEasting,FalseNorthing));
00913       }
00914 
00915    //! Set projection to MillerCylindrical.
00916    ERRVALUE SetProjectionMillerCylindrical (
00917       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
00918       double FalseEasting = 0.0,       //!< False easting (meters)
00919       double FalseNorthing = 0.0       //!< False northing (meters)
00920       ) {
00921       return (SetProj467(PROJECTION_MillerCylindrical,LonCentralMeridian,FalseEasting,FalseNorthing));
00922       }
00923 
00924    //! Set projection to Oblique Mercator (format A).
00925    ERRVALUE SetProjectionObliqueMercatorA (
00926       double ScaleFactor,              //!< Scale factor at center
00927       double LatOrigin,                //!< Latitude of origin (degrees)
00928       double LonGeodeticPoint1,        //!< Longitude of first point defining central geodetic line of projection
00929       double LatGeodeticPoint1,        //!< Latitude of first point defining central geodetic line of projection
00930       double LonGeodeticPoint2,        //!< Longitude of second point defining central geodetic line of projection
00931       double LatGeodeticPoint2,        //!< Latitude of second point defining central geodetic line of projection
00932       double FalseEasting = 0.0,       //!< False easting (meters)
00933       double FalseNorthing = 0.0       //!< False northing (meters)
00934       ) {
00935       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00936       zone[PROJZ_ZONE] = 0;
00937       mapproj = PROJECTION_ObliqueMercator;
00938       tparm[2] = ScaleFactor;
00939       tparm[5] = LatOrigin;
00940       tparm[TPARM_FalseEasting] = FalseEasting;
00941       tparm[TPARM_FalseNorthing] = FalseNorthing;
00942       tparm[8] = LonGeodeticPoint1;
00943       tparm[9] = LatGeodeticPoint1;
00944       tparm[10] = LonGeodeticPoint2;
00945       tparm[11] = LatGeodeticPoint2;
00946       return (0);
00947       }
00948 
00949    //! Set projection to Oblique Mercator (format B).
00950    ERRVALUE SetProjectionObliqueMercatorB (
00951       double ScaleFactor,              //!< Scale factor at center
00952       double AzimuthAngle,             //!< Angle of azimuth east of north for central line of projection
00953       double LonAzimuthPoint,          //!< Longitude of point along central line of projection where azimuth is measured (degrees)
00954       double LatOrigin,                //!< Latitude of origin (degrees)
00955       double FalseEasting = 0.0,       //!< False easting (meters)
00956       double FalseNorthing = 0.0       //!< False northing (meters)
00957       ) {
00958       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
00959       zone[PROJZ_ZONE] = 0;
00960       mapproj = PROJECTION_ObliqueMercator;
00961       tparm[2] = ScaleFactor;
00962       tparm[3] = AzimuthAngle;
00963       tparm[4] = LonAzimuthPoint;
00964       tparm[5] = LatOrigin;
00965       tparm[TPARM_FalseEasting] = FalseEasting;
00966       tparm[TPARM_FalseNorthing] = FalseNorthing;
00967       return (0);
00968       }
00969 
00970    //! Set projection to Orthographic.
00971    ERRVALUE SetProjectionOrthographic (
00972       double LonCenter,                //!< Longitude of center of projection (degrees)
00973       double LatCenter,                //!< Latitude of center of projection (degrees)
00974       double FalseEasting = 0.0,       //!< False easting (meters)
00975       double FalseNorthing = 0.0       //!< False northing (meters)
00976       ) {
00977       return (SetProj4567(PROJECTION_Orthographic,LonCenter,LatCenter,FalseEasting,FalseNorthing));
00978       }
00979 
00980    //! Set projection to Polar Stereographic.
00981    ERRVALUE SetProjectionPolarStereo (
00982       double ScaleFactor,              //!< Scale factor at center
00983       double LonDownward,              //!< Longitude directed straight down from pole
00984       double LatTrueScale,             //!< Latitude of true scale (degrees)
00985       double FalseEasting = 0.0,       //!< False easting (meters)
00986       double FalseNorthing = 0.0       //!< False northing (meters)
00987       ) {
00988       return (SetProj24567(PROJECTION_PolarStereographic,ScaleFactor,LonDownward,LatTrueScale,FalseEasting,FalseNorthing));
00989       }
00990 
00991    //! Set projection to Polyconic.
00992    ERRVALUE SetProjectionPolyconic (
00993       double ScaleFactor,              //!< Scale factor at center of projection
00994       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
00995       double LatOrigin = 0.0,          //!< Latitude of origin (degrees)
00996       double FalseEasting = 0.0,       //!< False easting (meters)
00997       double FalseNorthing = 0.0       //!< False northing (meters)
00998       ) {
00999       return (SetProj24567(PROJECTION_Polyconic,ScaleFactor,LonCentralMeridian,LatOrigin,FalseEasting,FalseNorthing));
01000       }
01001 
01002    //! Set projection to Robinson.
01003    ERRVALUE SetProjectionRobinson (
01004       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
01005       double FalseEasting = 0.0,       //!< False easting (meters)
01006       double FalseNorthing = 0.0       //!< False northing (meters)
01007       ) {
01008       return (SetProj467(PROJECTION_Robinson,LonCentralMeridian,FalseEasting,FalseNorthing));
01009       }
01010 
01011    //! Set projection to Sinusoidal.
01012    ERRVALUE SetProjectionSinusoidal (
01013       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
01014       double FalseEasting = 0.0,       //!< False easting (meters)
01015       double FalseNorthing = 0.0       //!< False northing (meters)
01016       ) {
01017       return (SetProj467(PROJECTION_Sinusoidal,LonCentralMeridian,FalseEasting,FalseNorthing));
01018       }
01019 
01020    //! Set projection to Stereographic.
01021    ERRVALUE SetProjectionStereographic (
01022       double ScaleFactor,              //!< Scale factor at center of projection
01023       double LonCenter,                //!< Longitude of center of projection (degrees)
01024       double LatCenter,                //!< Latitude of center of projection (degrees)
01025       double FalseEasting = 0.0,       //!< False easting (meters)
01026       double FalseNorthing = 0.0       //!< False northing (meters)
01027       ) {
01028       return (SetProj24567(PROJECTION_Stereographic,ScaleFactor,LonCenter,LatCenter,FalseEasting,FalseNorthing));
01029       }
01030 
01031    //! Set projection to Swiss Conformal.
01032    void SetProjectionSwissConformal (
01033       double FalseEasting = 0.0,       //!< False easting (meters)
01034       double FalseNorthing = 0.0       //!< False northing (meters)
01035       ) {
01036       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
01037       zone[PROJZ_ZONE] = 0;
01038       mapproj = PROJECTION_SwissConformalCylindrical;
01039       tparm[6] = FalseEasting;
01040       tparm[7] = FalseNorthing;
01041       }
01042       
01043 
01044    //! Set projection to Transverse Mercator.
01045    ERRVALUE SetProjectionTransverseMercator (
01046       double ScaleFactor,              //!< Scale factor at center of projection
01047       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
01048       double LatOrigin = 0.0,          //!< Latitude of origin (degrees)
01049       double FalseEasting = 0.0,       //!< False easting (meters)
01050       double FalseNorthing = 0.0       //!< False northing (meters)
01051       ) {
01052       return (SetProj24567(PROJECTION_TransverseMercator,ScaleFactor,LonCentralMeridian,LatOrigin,FalseEasting,FalseNorthing));
01053       }
01054 
01055    //! Set projection to Van der Grinten I.
01056    ERRVALUE SetProjectionVanDerGrintenI (
01057       double LonCentralMeridian,       //!< Longitude of central meridian (degrees)
01058       double FalseEasting = 0.0,       //!< False easting (meters)
01059       double FalseNorthing = 0.0       //!< False northing (meters)
01060       ) {
01061       return (SetProj467(PROJECTION_VanDerGrintenI,LonCentralMeridian,FalseEasting,FalseNorthing));
01062       }
01063 
01064    //! Set coordinate system to Gauss-Kruger.
01065    ERRVALUE SetSystemGaussKruger (
01066       INT16 gkzone,                    //!< Zone (1-60, or -1 - -60 as alternative for South zones)
01067       bool southzone = false           //!< South zones
01068       ) {
01069       if (gkzone < -60 || gkzone == 0 || gkzone > 60) return (EBadFuncParm);
01070       zone[PROJZ_SYSTEM] = PROJSYS_GaussKruger;
01071       zone[PROJZ_ZONE] = static_cast<INT16>(abs(gkzone));
01072       zone[PROJZ_ALTPROJ] = 1;
01073       mapproj = PROJECTION_TransverseMercator;
01074       tparm[2] = 1.0;
01075       tparm[4] = (zone[PROJZ_ZONE] <= 30) ? 6 * zone[PROJZ_ZONE] - 3 : 6 * zone[PROJZ_ZONE] - 363;
01076       tparm[5] = 0.0;
01077       tparm[TPARM_FalseEasting] = 500000.0;
01078       if (gkzone < 0 || southzone) {
01079          tparm[TPARM_FalseNorthing] = 10000000.0;
01080          }
01081       else {
01082          tparm[TPARM_FalseNorthing] = 0.0;
01083          }
01084       return (0);
01085       }
01086 
01087    //! Set coordinate system to Latitude-Longitude.
01088    void SetSystemLatLon (
01089       ) {
01090       memset(tparm,0,sizeof(tparm));
01091       zone[PROJZ_SYSTEM] = PROJSYS_LatLon;
01092       zone[PROJZ_ZONE] = 0;
01093       zone[PROJZ_ALTPROJ] = 0;
01094       mapproj = PROJECTION_LatLon;
01095       }
01096 
01097    //! Set parameters for Universal Transverse Mercator projection system.
01098    void SetSystemNZMG (
01099       ) {
01100       memset(static_cast<void*>(this),0,sizeof(*this));
01101       zone[PROJZ_SYSTEM] = PROJSYS_NZMG;
01102       zone[PROJZ_DATUM] = DATUM_NewZealand1949;
01103       mapproj = PROJECTION_NZMG;
01104       }
01105 
01106    //! Set parameters for Universal Polar Stereographic projection system.
01107    void SetSystemUPS (
01108       bool southpole = false
01109       ) {
01110       zone[PROJZ_SYSTEM] = PROJSYS_UPS;
01111       SetProjectionPolarStereo(0.994,0.0,(southpole)?-90.0:90.0,2000000.0,2000000.0);
01112       return;
01113       }
01114 
01115    //! Set parameters for Universal Transverse Mercator projection system.
01116    ERRVALUE SetSystemUTM (
01117       INT16 utmzone,                   //!< Zone (1-60, or -1 - -60 as alternative for South zones)
01118       bool southzone = false           //!< South zones
01119       ) {
01120       if (utmzone < -60 || utmzone == 0 || utmzone > 60) return (EBadFuncParm);
01121       zone[PROJZ_SYSTEM] = PROJSYS_UTM;
01122       zone[PROJZ_ZONE] = static_cast<INT16>(abs(utmzone));
01123       mapproj = PROJECTION_TransverseMercator;
01124       tparm[2] = .9996;
01125       tparm[4] = 6 * zone[PROJZ_ZONE] - 183;
01126       tparm[5] = 0.0;
01127       tparm[TPARM_FalseEasting] = 500000.0;
01128       if (utmzone < 0 || southzone) {
01129          tparm[TPARM_FalseNorthing] = 10000000.0;
01130          }
01131       else {
01132          tparm[TPARM_FalseNorthing] = 0.0;
01133          }
01134       return (0);
01135       }
01136 
01137 private:
01138    #ifndef GENERATING_DOXYGEN_OUTPUT
01139    ERRVALUE SetProj24567 (
01140       INT16 proj,
01141       double parm2,
01142       double parm4,
01143       double parm5,
01144       double parm6,
01145       double parm7
01146       ) {
01147       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
01148       zone[PROJZ_ZONE] = 0;
01149       mapproj = proj;
01150       tparm[2] = parm2;
01151       tparm[4] = parm4;
01152       tparm[5] = parm5;
01153       tparm[6] = parm6;
01154       tparm[7] = parm7;
01155       return (0);
01156       }
01157 
01158    ERRVALUE SetProj4567 (
01159       INT16 proj,
01160       double parm4,
01161       double parm5,
01162       double parm6,
01163       double parm7
01164       ) {
01165       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
01166       zone[PROJZ_ZONE] = 0;
01167       mapproj = proj;
01168       tparm[4] = parm4;
01169       tparm[5] = parm5;
01170       tparm[6] = parm6;
01171       tparm[7] = parm7;
01172       return (0);
01173       }
01174 
01175    ERRVALUE SetProj467 (
01176       INT16 proj,
01177       double parm4,
01178       double parm6,
01179       double parm7
01180       ) {
01181       zone[PROJZ_SYSTEM] = PROJSYS_UserDefined;
01182       zone[PROJZ_ZONE] = 0;
01183       mapproj = proj;
01184       tparm[4] = parm4;
01185       tparm[6] = parm6;
01186       tparm[7] = parm7;
01187       return (0);
01188       }
01189 
01190    CHECKSIZE(80+15*8);                 //! Make compiler validate structure size
01191    #endif // GENERATING_DOXYGEN_OUTPUT
01192    };
01193 
01194 //! Comparison for equality.
01195 inline bool operator== (
01196    const MAPPROJPARM& lhs,
01197    const MAPPROJPARM& rhs
01198    ) {
01199    return (lhs.mapproj == rhs.mapproj && !memcmp(lhs.zone,rhs.zone,3*sizeof(lhs.zone[0])) && !memcmp(lhs.tparm,rhs.tparm,sizeof(lhs.tparm)));
01200    }
01201 
01202 //! Comparison for inequality.
01203 inline bool operator!= (
01204    const MAPPROJPARM& lhs,
01205    const MAPPROJPARM& rhs
01206    ) {
01207    return (!operator==(lhs,rhs));
01208    }
01209 
01210 #ifndef GENERATING_DOXYGEN_OUTPUT
01211 //! Prevent unsafe usage.
01212 #ifdef memcpy
01213 //! Assume defined as 'amemcpy' so need definition to match.
01214 extern void * (*amemcpy)(MAPPROJPARM*, MAPPROJPARM*, int);
01215 extern void * (*amemcpy)(MAPPROJPARM*, const MAPPROJPARM*, int);
01216 #else
01217 void memcpy(MAPPROJPARM*, MAPPROJPARM*, int);
01218 void memcpy(MAPPROJPARM*, const MAPPROJPARM*, int);
01219 #endif
01220 void memset(MAPPROJPARM*, int, int);
01221 #endif // GENERATING_DOXYGEN_OUTPUT
01222 
01223 
01224 /*----------------------------------------------------------------------------*/
01225 
01226 #ifdef GEOMLIBEXPORT
01227 #undef GEOMLIBEXPORT
01228 #endif
01229 
01230 #endif   // INC_MI32_MAPPROJ_H
01231 

Generated on Tue Dec 14 13:18:25 2004 for TNTsdk by  doxygen 1.3.8-20040913