LCOV - code coverage report
Current view: directory - ogr - ogr_spatialref.h (source / functions) Found Hit Coverage
Test: gdal_filtered.info Lines: 6 6 100.0 %
Date: 2011-12-18 Functions: 8 6 75.0 %

       1                 : /******************************************************************************
       2                 :  * $Id: ogr_spatialref.h 22952 2011-08-19 21:08:31Z rouault $
       3                 :  *
       4                 :  * Project:  OpenGIS Simple Features Reference Implementation
       5                 :  * Purpose:  Classes for manipulating spatial reference systems in a
       6                 :  *           platform non-specific manner.
       7                 :  * Author:   Frank Warmerdam, warmerdam@pobox.com
       8                 :  *
       9                 :  ******************************************************************************
      10                 :  * Copyright (c) 1999,  Les Technologies SoftMap Inc.
      11                 :  *
      12                 :  * Permission is hereby granted, free of charge, to any person obtaining a
      13                 :  * copy of this software and associated documentation files (the "Software"),
      14                 :  * to deal in the Software without restriction, including without limitation
      15                 :  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
      16                 :  * and/or sell copies of the Software, and to permit persons to whom the
      17                 :  * Software is furnished to do so, subject to the following conditions:
      18                 :  *
      19                 :  * The above copyright notice and this permission notice shall be included
      20                 :  * in all copies or substantial portions of the Software.
      21                 :  *
      22                 :  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
      23                 :  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
      24                 :  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
      25                 :  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
      26                 :  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
      27                 :  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
      28                 :  * DEALINGS IN THE SOFTWARE.
      29                 :  ****************************************************************************/
      30                 : 
      31                 : #ifndef _OGR_SPATIALREF_H_INCLUDED
      32                 : #define _OGR_SPATIALREF_H_INCLUDED
      33                 : 
      34                 : #include "ogr_srs_api.h"
      35                 : 
      36                 : /**
      37                 :  * \file ogr_spatialref.h
      38                 :  *
      39                 :  * Coordinate systems services.
      40                 :  */
      41                 : 
      42                 : /************************************************************************/
      43                 : /*                             OGR_SRSNode                              */
      44                 : /************************************************************************/
      45                 : 
      46                 : /**
      47                 :  * Objects of this class are used to represent value nodes in the parsed
      48                 :  * representation of the WKT SRS format.  For instance UNIT["METER",1]
      49                 :  * would be rendered into three OGR_SRSNodes.  The root node would have a
      50                 :  * value of UNIT, and two children, the first with a value of METER, and the
      51                 :  * second with a value of 1.
      52                 :  *
      53                 :  * Normally application code just interacts with the OGRSpatialReference
      54                 :  * object, which uses the OGR_SRSNode to implement it's data structure;
      55                 :  * however, this class is user accessable for detailed access to components
      56                 :  * of an SRS definition.
      57                 :  */
      58                 : 
      59                 : class CPL_DLL OGR_SRSNode
      60                 : {
      61                 :     char        *pszValue;
      62                 : 
      63                 :     OGR_SRSNode **papoChildNodes;
      64                 :     OGR_SRSNode *poParent;
      65                 : 
      66                 :     int         nChildren;
      67                 : 
      68                 :     int         NeedsQuoting() const;
      69                 :     
      70                 :   public:
      71                 :                 OGR_SRSNode(const char * = NULL);
      72                 :                 ~OGR_SRSNode();
      73                 : 
      74                 :     int         IsLeafNode() const { return nChildren == 0; }
      75                 :     
      76        37483773 :     int         GetChildCount() const { return nChildren; }
      77                 :     OGR_SRSNode *GetChild( int );
      78                 :     const OGR_SRSNode *GetChild( int ) const;
      79                 : 
      80                 :     OGR_SRSNode *GetNode( const char * );
      81                 :     const OGR_SRSNode *GetNode( const char * ) const;
      82                 : 
      83                 :     void        InsertChild( OGR_SRSNode *, int );
      84                 :     void        AddChild( OGR_SRSNode * );
      85                 :     int         FindChild( const char * ) const;
      86                 :     void        DestroyChild( int );
      87                 :     void        ClearChildren();
      88                 :     void        StripNodes( const char * );
      89                 : 
      90         9145803 :     const char  *GetValue() const { return pszValue; }
      91                 :     void        SetValue( const char * );
      92                 : 
      93                 :     void        MakeValueSafe();
      94                 :     OGRErr      FixupOrdering();
      95                 : 
      96                 :     OGR_SRSNode *Clone() const;
      97                 : 
      98                 :     OGRErr      importFromWkt( char ** );
      99                 :     OGRErr      exportToWkt( char ** ) const;
     100                 :     OGRErr      exportToPrettyWkt( char **, int = 1) const;
     101                 :     
     102                 :     OGRErr      applyRemapper( const char *pszNode, 
     103                 :                                char **papszSrcValues, 
     104                 :                                char **papszDstValues, 
     105                 :                                int nStepSize = 1,
     106                 :                                int bChildOfHit = FALSE );
     107                 : };
     108                 : 
     109                 : /************************************************************************/
     110                 : /*                         OGRSpatialReference                          */
     111                 : /************************************************************************/
     112                 : 
     113                 : /**
     114                 :  * This class respresents a OpenGIS Spatial Reference System, and contains
     115                 :  * methods for converting between this object organization and well known
     116                 :  * text (WKT) format.  This object is reference counted as one instance of
     117                 :  * the object is normally shared between many OGRGeometry objects.
     118                 :  *
     119                 :  * Normally application code can fetch needed parameter values for this
     120                 :  * SRS using GetAttrValue(), but in special cases the underlying parse tree
     121                 :  * (or OGR_SRSNode objects) can be accessed more directly.
     122                 :  *
     123                 :  * See <a href="osr_tutorial.html">the tutorial</a> for more information on
     124                 :  * how to use this class.
     125                 :  */
     126                 : 
     127                 : class CPL_DLL OGRSpatialReference
     128                 : {
     129                 :     double      dfFromGreenwich;
     130                 :     double      dfToMeter;
     131                 :     double      dfToDegrees;
     132                 : 
     133                 :     OGR_SRSNode *poRoot;
     134                 : 
     135                 :     int         nRefCount;
     136                 :     int         bNormInfoSet;
     137                 : 
     138                 :     static OGRErr Validate(OGR_SRSNode *poRoot);
     139                 :     static OGRErr ValidateAuthority(OGR_SRSNode *poRoot);
     140                 :     static OGRErr ValidateAxis(OGR_SRSNode *poRoot);
     141                 :     static OGRErr ValidateUnit(OGR_SRSNode *poRoot);
     142                 :     static OGRErr ValidateVertDatum(OGR_SRSNode *poRoot);
     143                 :     static OGRErr ValidateProjection( OGR_SRSNode* poRoot );
     144                 :     static int  IsAliasFor( const char *, const char * );
     145                 :     void        GetNormInfo() const;
     146                 : 
     147                 :     OGRErr      importFromURNPart(const char* pszAuthority,
     148                 :                                   const char* pszCode,
     149                 :                                   const char* pszURN);
     150                 :   public:
     151                 :                 OGRSpatialReference(const OGRSpatialReference&);
     152                 :                 OGRSpatialReference(const char * = NULL);
     153                 :                 
     154                 :     virtual    ~OGRSpatialReference();
     155                 :     
     156                 :     static void DestroySpatialReference(OGRSpatialReference* poSRS);
     157                 :                 
     158                 :     OGRSpatialReference &operator=(const OGRSpatialReference&);
     159                 : 
     160                 :     int         Reference();
     161                 :     int         Dereference();
     162                 :     int         GetReferenceCount() const { return nRefCount; }
     163                 :     void        Release();
     164                 : 
     165                 :     OGRSpatialReference *Clone() const;
     166                 :     OGRSpatialReference *CloneGeogCS() const;
     167                 : 
     168                 :     OGRErr      exportToWkt( char ** ) const;
     169                 :     OGRErr      exportToPrettyWkt( char **, int = FALSE) const;
     170                 :     OGRErr      exportToProj4( char ** ) const;
     171                 :     OGRErr      exportToPCI( char **, char **, double ** ) const;
     172                 :     OGRErr      exportToUSGS( long *, long *, double **, long * ) const;
     173                 :     OGRErr      exportToXML( char **, const char * = NULL ) const;
     174                 :     OGRErr      exportToPanorama( long *, long *, long *, long *,
     175                 :                                   double * ) const;
     176                 :     OGRErr      exportToERM( char *pszProj, char *pszDatum, char *pszUnits );
     177                 :     OGRErr      exportToMICoordSys( char ** ) const;
     178                 :     
     179                 :     OGRErr      importFromWkt( char ** );
     180                 :     OGRErr      importFromProj4( const char * );
     181                 :     OGRErr      importFromEPSG( int );
     182                 :     OGRErr      importFromEPSGA( int );
     183                 :     OGRErr      importFromESRI( char ** );
     184                 :     OGRErr      importFromPCI( const char *, const char * = NULL,
     185                 :                                double * = NULL );
     186                 :     OGRErr      importFromUSGS( long iProjSys, long iZone,
     187                 :                                 double *padfPrjParams,
     188                 :                                 long iDatum, int bAnglesInPackedDMSFormat = TRUE );
     189                 :     OGRErr      importFromPanorama( long, long, long, double* );
     190                 :     OGRErr      importFromOzi( const char *, const char *, const char * );
     191                 :     OGRErr      importFromWMSAUTO( const char *pszAutoDef );
     192                 :     OGRErr      importFromXML( const char * );
     193                 :     OGRErr      importFromDict( const char *pszDict, const char *pszCode );
     194                 :     OGRErr      importFromURN( const char * );
     195                 :     OGRErr      importFromERM( const char *pszProj, const char *pszDatum,
     196                 :                                const char *pszUnits );
     197                 :     OGRErr      importFromUrl( const char * );
     198                 :     OGRErr      importFromMICoordSys( const char * );
     199                 :     
     200                 :     OGRErr      morphToESRI();
     201                 :     OGRErr      morphFromESRI();
     202                 : 
     203                 :     OGRErr      Validate();
     204                 :     OGRErr      StripCTParms( OGR_SRSNode * = NULL );
     205                 :     OGRErr      StripVertical();
     206                 :     OGRErr      FixupOrdering();
     207                 :     OGRErr      Fixup();
     208                 : 
     209                 :     int         EPSGTreatsAsLatLong();
     210                 :     const char *GetAxis( const char *pszTargetKey, int iAxis, 
     211                 :                          OGRAxisOrientation *peOrientation ) const;
     212                 :     OGRErr      SetAxes( const char *pszTargetKey, 
     213                 :                          const char *pszXAxisName, 
     214                 :                          OGRAxisOrientation eXAxisOrientation,
     215                 :                          const char *pszYAxisName, 
     216                 :                          OGRAxisOrientation eYAxisOrientation );
     217                 : 
     218                 :     // Machinary for accessing parse nodes
     219         1908587 :     OGR_SRSNode *GetRoot() { return poRoot; }
     220          109187 :     const OGR_SRSNode *GetRoot() const { return poRoot; }
     221                 :     void        SetRoot( OGR_SRSNode * );
     222                 :     
     223                 :     OGR_SRSNode *GetAttrNode(const char *);
     224                 :     const OGR_SRSNode *GetAttrNode(const char *) const;
     225                 :     const char  *GetAttrValue(const char *, int = 0) const;
     226                 : 
     227                 :     OGRErr      SetNode( const char *, const char * );
     228                 :     OGRErr      SetNode( const char *, double );
     229                 : 
     230                 :     OGRErr      SetLinearUnitsAndUpdateParameters( const char *pszName, 
     231                 :                                                    double dfInMeters );
     232                 :     OGRErr      SetLinearUnits( const char *pszName, double dfInMeters );
     233                 :     OGRErr      SetTargetLinearUnits( const char *pszTargetKey,
     234                 :                                       const char *pszName, double dfInMeters );
     235                 :     double      GetLinearUnits( char ** = NULL ) const;
     236                 :     double      GetTargetLinearUnits( const char *pszTargetKey,
     237                 :                                       char ** ppszRetName = NULL ) const;
     238                 : 
     239                 :     OGRErr      SetAngularUnits( const char *pszName, double dfInRadians );
     240                 :     double      GetAngularUnits( char ** = NULL ) const;
     241                 : 
     242                 :     double      GetPrimeMeridian( char ** = NULL ) const;
     243                 : 
     244                 :     int         IsGeographic() const;
     245                 :     int         IsProjected() const;
     246                 :     int         IsGeocentric() const;
     247                 :     int         IsLocal() const;
     248                 :     int         IsVertical() const;
     249                 :     int         IsCompound() const;
     250                 :     int         IsSameGeogCS( const OGRSpatialReference * ) const;
     251                 :     int         IsSameVertCS( const OGRSpatialReference * ) const;
     252                 :     int         IsSame( const OGRSpatialReference * ) const;
     253                 : 
     254                 :     void        Clear();
     255                 :     OGRErr      SetLocalCS( const char * );
     256                 :     OGRErr      SetProjCS( const char * );
     257                 :     OGRErr      SetProjection( const char * );
     258                 :     OGRErr      SetGeocCS( const char * pszGeocName );
     259                 :     OGRErr      SetGeogCS( const char * pszGeogName,
     260                 :                            const char * pszDatumName,
     261                 :                            const char * pszEllipsoidName,
     262                 :                            double dfSemiMajor, double dfInvFlattening,
     263                 :                            const char * pszPMName = NULL,
     264                 :                            double dfPMOffset = 0.0,
     265                 :                            const char * pszUnits = NULL,
     266                 :                            double dfConvertToRadians = 0.0 );
     267                 :     OGRErr      SetWellKnownGeogCS( const char * );
     268                 :     OGRErr      CopyGeogCSFrom( const OGRSpatialReference * poSrcSRS );
     269                 :     OGRErr      SetVertCS( const char *pszVertCSName,
     270                 :                            const char *pszVertDatumName, 
     271                 :                            int nVertDatumClass = 2005 );
     272                 :     OGRErr      SetCompoundCS( const char *pszName, 
     273                 :                                const OGRSpatialReference *poHorizSRS,
     274                 :                                const OGRSpatialReference *poVertSRS );
     275                 : 
     276                 :     OGRErr      SetFromUserInput( const char * );
     277                 : 
     278                 :     OGRErr      SetTOWGS84( double, double, double,
     279                 :                             double = 0.0, double = 0.0, double = 0.0,
     280                 :                             double = 0.0 );
     281                 :     OGRErr      GetTOWGS84( double *padfCoef, int nCoeff = 7 ) const;
     282                 :     
     283                 :     double      GetSemiMajor( OGRErr * = NULL ) const;
     284                 :     double      GetSemiMinor( OGRErr * = NULL ) const;
     285                 :     double      GetInvFlattening( OGRErr * = NULL ) const;
     286                 : 
     287                 :     OGRErr      SetAuthority( const char * pszTargetKey, 
     288                 :                               const char * pszAuthority, 
     289                 :                               int nCode );
     290                 : 
     291                 :     OGRErr      AutoIdentifyEPSG();
     292                 :     int         GetEPSGGeogCS();
     293                 : 
     294                 :     const char *GetAuthorityCode( const char * pszTargetKey ) const;
     295                 :     const char *GetAuthorityName( const char * pszTargetKey ) const;
     296                 : 
     297                 :     const char *GetExtension( const char *pszTargetKey, 
     298                 :                               const char *pszName,
     299                 :                               const char *pszDefault = NULL ) const;
     300                 :     OGRErr      SetExtension( const char *pszTargetKey, 
     301                 :                               const char *pszName, 
     302                 :                               const char *pszValue );
     303                 :     
     304                 :     int         FindProjParm( const char *pszParameter,
     305                 :                               const OGR_SRSNode *poPROJCS=NULL ) const;
     306                 :     OGRErr      SetProjParm( const char *, double );
     307                 :     double      GetProjParm( const char *, double =0.0, OGRErr* = NULL ) const;
     308                 : 
     309                 :     OGRErr      SetNormProjParm( const char *, double );
     310                 :     double      GetNormProjParm( const char *, double=0.0, OGRErr* =NULL)const;
     311                 : 
     312                 :     static int  IsAngularParameter( const char * );
     313                 :     static int  IsLongitudeParameter( const char * );
     314                 :     static int  IsLinearParameter( const char * );
     315                 : 
     316                 :     /** Albers Conic Equal Area */
     317                 :     OGRErr      SetACEA( double dfStdP1, double dfStdP2,
     318                 :                          double dfCenterLat, double dfCenterLong,
     319                 :                          double dfFalseEasting, double dfFalseNorthing );
     320                 :     
     321                 :     /** Azimuthal Equidistant */
     322                 :     OGRErr      SetAE( double dfCenterLat, double dfCenterLong,
     323                 :                        double dfFalseEasting, double dfFalseNorthing );
     324                 : 
     325                 :     /** Bonne */
     326                 :     OGRErr      SetBonne( double dfStdP1, double dfCentralMeridian,
     327                 :                           double dfFalseEasting, double dfFalseNorthing );
     328                 :     
     329                 :     /** Cylindrical Equal Area */
     330                 :     OGRErr      SetCEA( double dfStdP1, double dfCentralMeridian,
     331                 :                         double dfFalseEasting, double dfFalseNorthing );
     332                 : 
     333                 :     /** Cassini-Soldner */
     334                 :     OGRErr      SetCS( double dfCenterLat, double dfCenterLong,
     335                 :                        double dfFalseEasting, double dfFalseNorthing );
     336                 : 
     337                 :     /** Equidistant Conic */
     338                 :     OGRErr      SetEC( double dfStdP1, double dfStdP2,
     339                 :                        double dfCenterLat, double dfCenterLong,
     340                 :                        double dfFalseEasting, double dfFalseNorthing );
     341                 : 
     342                 :     /** Eckert I-VI */
     343                 :     OGRErr      SetEckert( int nVariation, double dfCentralMeridian,
     344                 :                            double dfFalseEasting, double dfFalseNorthing );
     345                 : 
     346                 :     OGRErr      SetEckertIV( double dfCentralMeridian,
     347                 :                              double dfFalseEasting, double dfFalseNorthing );
     348                 : 
     349                 :     OGRErr      SetEckertVI( double dfCentralMeridian,
     350                 :                              double dfFalseEasting, double dfFalseNorthing );
     351                 : 
     352                 :     /** Equirectangular */
     353                 :     OGRErr      SetEquirectangular(double dfCenterLat, double dfCenterLong,
     354                 :                             double dfFalseEasting, double dfFalseNorthing );
     355                 :     /** Equirectangular generalized form : */
     356                 :     OGRErr      SetEquirectangular2( double dfCenterLat, double dfCenterLong,
     357                 :                                      double dfPseudoStdParallel1,
     358                 :                                      double dfFalseEasting, double dfFalseNorthing );
     359                 : 
     360                 :     /** Geostationary Satellite */
     361                 :     OGRErr      SetGEOS( double dfCentralMeridian, double dfSatelliteHeight, 
     362                 :                          double dfFalseEasting, double dfFalseNorthing );
     363                 : 
     364                 :     /** Goode Homolosine */
     365                 :     OGRErr      SetGH( double dfCentralMeridian, 
     366                 :                        double dfFalseEasting, double dfFalseNorthing );
     367                 : 
     368                 :     /** Interrupted Goode Homolosine */
     369                 :     OGRErr      SetIGH();
     370                 : 
     371                 :     /** Gall Stereograpic */
     372                 :     OGRErr      SetGS( double dfCentralMeridian,
     373                 :                        double dfFalseEasting, double dfFalseNorthing );
     374                 :  
     375                 :     /** Gauss Schreiber Transverse Mercator */
     376                 :     OGRErr      SetGaussSchreiberTMercator(double dfCenterLat, double dfCenterLong,
     377                 :                                            double dfScale,
     378                 :                                            double dfFalseEasting, double dfFalseNorthing );
     379                 : 
     380                 :     /** Gnomonic */
     381                 :     OGRErr      SetGnomonic(double dfCenterLat, double dfCenterLong,
     382                 :                             double dfFalseEasting, double dfFalseNorthing );
     383                 : 
     384                 :     /** Hotine Oblique Mercator */
     385                 :     OGRErr      SetHOM( double dfCenterLat, double dfCenterLong,
     386                 :                         double dfAzimuth, double dfRectToSkew,
     387                 :                         double dfScale,
     388                 :                         double dfFalseEasting, double dfFalseNorthing );
     389                 : 
     390                 :     OGRErr      SetHOM2PNO( double dfCenterLat,
     391                 :                             double dfLat1, double dfLong1,
     392                 :                             double dfLat2, double dfLong2,
     393                 :                             double dfScale,
     394                 :                             double dfFalseEasting, double dfFalseNorthing );
     395                 : 
     396                 :     /** International Map of the World Polyconic */
     397                 :     OGRErr      SetIWMPolyconic( double dfLat1, double dfLat2,
     398                 :                                  double dfCenterLong,
     399                 :                                  double dfFalseEasting,
     400                 :                                  double dfFalseNorthing );
     401                 : 
     402                 :     /** Krovak Oblique Conic Conformal */
     403                 :     OGRErr      SetKrovak( double dfCenterLat, double dfCenterLong,
     404                 :                            double dfAzimuth, double dfPseudoStdParallelLat,
     405                 :                            double dfScale, 
     406                 :                            double dfFalseEasting, double dfFalseNorthing );
     407                 : 
     408                 :     /** Lambert Azimuthal Equal-Area */
     409                 :     OGRErr      SetLAEA( double dfCenterLat, double dfCenterLong,
     410                 :                          double dfFalseEasting, double dfFalseNorthing );
     411                 : 
     412                 :     /** Lambert Conformal Conic */
     413                 :     OGRErr      SetLCC( double dfStdP1, double dfStdP2,
     414                 :                         double dfCenterLat, double dfCenterLong,
     415                 :                         double dfFalseEasting, double dfFalseNorthing );
     416                 : 
     417                 :     /** Lambert Conformal Conic 1SP */
     418                 :     OGRErr      SetLCC1SP( double dfCenterLat, double dfCenterLong,
     419                 :                            double dfScale,
     420                 :                            double dfFalseEasting, double dfFalseNorthing );
     421                 : 
     422                 :     /** Lambert Conformal Conic (Belgium) */
     423                 :     OGRErr      SetLCCB( double dfStdP1, double dfStdP2,
     424                 :                          double dfCenterLat, double dfCenterLong,
     425                 :                          double dfFalseEasting, double dfFalseNorthing );
     426                 :     
     427                 :     /** Miller Cylindrical */
     428                 :     OGRErr      SetMC( double dfCenterLat, double dfCenterLong,
     429                 :                        double dfFalseEasting, double dfFalseNorthing );
     430                 : 
     431                 :     /** Mercator */
     432                 :     OGRErr      SetMercator( double dfCenterLat, double dfCenterLong,
     433                 :                              double dfScale, 
     434                 :                              double dfFalseEasting, double dfFalseNorthing );
     435                 : 
     436                 :     OGRErr      SetMercator2SP( double dfStdP1,
     437                 :                                 double dfCenterLat, double dfCenterLong,
     438                 :                                 double dfFalseEasting, double dfFalseNorthing );
     439                 : 
     440                 :     /** Mollweide */
     441                 :     OGRErr      SetMollweide( double dfCentralMeridian,
     442                 :                               double dfFalseEasting, double dfFalseNorthing );
     443                 : 
     444                 :     /** New Zealand Map Grid */
     445                 :     OGRErr      SetNZMG( double dfCenterLat, double dfCenterLong,
     446                 :                          double dfFalseEasting, double dfFalseNorthing );
     447                 : 
     448                 :     /** Oblique Stereographic */
     449                 :     OGRErr      SetOS( double dfOriginLat, double dfCMeridian,
     450                 :                        double dfScale,
     451                 :                        double dfFalseEasting,double dfFalseNorthing);
     452                 :     
     453                 :     /** Orthographic */
     454                 :     OGRErr      SetOrthographic( double dfCenterLat, double dfCenterLong,
     455                 :                                  double dfFalseEasting,double dfFalseNorthing);
     456                 : 
     457                 :     /** Polyconic */
     458                 :     OGRErr      SetPolyconic( double dfCenterLat, double dfCenterLong,
     459                 :                               double dfFalseEasting, double dfFalseNorthing );
     460                 : 
     461                 :     /** Polar Stereographic */
     462                 :     OGRErr      SetPS( double dfCenterLat, double dfCenterLong,
     463                 :                        double dfScale,
     464                 :                        double dfFalseEasting, double dfFalseNorthing);
     465                 :     
     466                 :     /** Robinson */
     467                 :     OGRErr      SetRobinson( double dfCenterLong, 
     468                 :                              double dfFalseEasting, double dfFalseNorthing );
     469                 :     
     470                 :     /** Sinusoidal */
     471                 :     OGRErr      SetSinusoidal( double dfCenterLong, 
     472                 :                                double dfFalseEasting, double dfFalseNorthing );
     473                 :     
     474                 :     /** Stereographic */
     475                 :     OGRErr      SetStereographic( double dfCenterLat, double dfCenterLong,
     476                 :                                   double dfScale,
     477                 :                                  double dfFalseEasting,double dfFalseNorthing);
     478                 : 
     479                 :     /** Swiss Oblique Cylindrical */
     480                 :     OGRErr      SetSOC( double dfLatitudeOfOrigin, double dfCentralMeridian,
     481                 :                         double dfFalseEasting, double dfFalseNorthing );
     482                 :     
     483                 :     /** Transverse Mercator */
     484                 :     OGRErr      SetTM( double dfCenterLat, double dfCenterLong,
     485                 :                        double dfScale,
     486                 :                        double dfFalseEasting, double dfFalseNorthing );
     487                 : 
     488                 :     /** Transverse Mercator variants. */
     489                 :     OGRErr      SetTMVariant( const char *pszVariantName, 
     490                 :                               double dfCenterLat, double dfCenterLong,
     491                 :                               double dfScale,
     492                 :                               double dfFalseEasting, double dfFalseNorthing );
     493                 : 
     494                 :     /** Tunesia Mining Grid  */
     495                 :     OGRErr      SetTMG( double dfCenterLat, double dfCenterLong, 
     496                 :                         double dfFalseEasting, double dfFalseNorthing );
     497                 : 
     498                 :     /** Transverse Mercator (South Oriented) */
     499                 :     OGRErr      SetTMSO( double dfCenterLat, double dfCenterLong,
     500                 :                          double dfScale,
     501                 :                          double dfFalseEasting, double dfFalseNorthing );
     502                 : 
     503                 :     /** Two Point Equidistant */
     504                 :     OGRErr      SetTPED( double dfLat1, double dfLong1, 
     505                 :                          double dfLat2, double dfLong2, 
     506                 :                          double dfFalseEasting, double dfFalseNorthing );
     507                 :     
     508                 :     /** VanDerGrinten */
     509                 :     OGRErr      SetVDG( double dfCenterLong,
     510                 :                         double dfFalseEasting, double dfFalseNorthing );
     511                 : 
     512                 :     /** Universal Transverse Mercator */
     513                 :     OGRErr      SetUTM( int nZone, int bNorth = TRUE );
     514                 :     int         GetUTMZone( int *pbNorth = NULL ) const;
     515                 : 
     516                 :     /** Wagner I -- VII */
     517                 :     OGRErr      SetWagner( int nVariation, double dfCenterLat,
     518                 :                            double dfFalseEasting, double dfFalseNorthing );
     519                 : 
     520                 :     /** State Plane */
     521                 :     OGRErr      SetStatePlane( int nZone, int bNAD83 = TRUE,
     522                 :                                const char *pszOverrideUnitName = NULL,
     523                 :                                double dfOverrideUnit = 0.0 );
     524                 : 
     525                 :     OGRErr      ImportFromESRIStatePlaneWKT( 
     526                 :         int nCode, const char* pszDatumName, const char* pszUnitsName, 
     527                 :         int nPCSCode, const char* pszCSName = 0 );
     528                 :     OGRErr      ImportFromESRIWisconsinWKT( 
     529                 :         const char* pszPrjName, double dfCentralMeridian, double dfLatOfOrigin, 
     530                 :         const char* pszUnitsName, const char* pszCSName = 0 );
     531                 : };
     532                 : 
     533                 : /************************************************************************/
     534                 : /*                     OGRCoordinateTransformation                      */
     535                 : /*                                                                      */
     536                 : /*      This is really just used as a base class for a private          */
     537                 : /*      implementation.                                                 */
     538                 : /************************************************************************/
     539                 : 
     540                 : /**
     541                 :  * Interface for transforming between coordinate systems.
     542                 :  *
     543                 :  * Currently, the only implementation within OGR is OGRProj4CT, which
     544                 :  * requires the PROJ.4 library to be available at run-time.
     545                 :  *
     546                 :  * Also, see OGRCreateCoordinateTransformation() for creating transformations.
     547                 :  */
     548                 :  
     549                 : class CPL_DLL OGRCoordinateTransformation
     550             247 : {
     551                 : public:
     552             247 :     virtual ~OGRCoordinateTransformation() {}
     553                 :     
     554                 :     static void DestroyCT(OGRCoordinateTransformation* poCT);
     555                 : 
     556                 :     // From CT_CoordinateTransformation
     557                 : 
     558                 :     /** Fetch internal source coordinate system. */
     559                 :     virtual OGRSpatialReference *GetSourceCS() = 0;
     560                 : 
     561                 :     /** Fetch internal target coordinate system. */
     562                 :     virtual OGRSpatialReference *GetTargetCS() = 0;
     563                 : 
     564                 :     // From CT_MathTransform
     565                 : 
     566                 :     /**
     567                 :      * Transform points from source to destination space.
     568                 :      *
     569                 :      * This method is the same as the C function OCTTransform().
     570                 :      *
     571                 :      * The method TransformEx() allows extended success information to 
     572                 :      * be captured indicating which points failed to transform. 
     573                 :      *
     574                 :      * @param nCount number of points to transform.
     575                 :      * @param x array of nCount X vertices, modified in place.
     576                 :      * @param y array of nCount Y vertices, modified in place.
     577                 :      * @param z array of nCount Z vertices, modified in place.
     578                 :      * @return TRUE on success, or FALSE if some or all points fail to
     579                 :      * transform.
     580                 :      */
     581                 :     virtual int Transform( int nCount, 
     582                 :                            double *x, double *y, double *z = NULL ) = 0;
     583                 : 
     584                 :     /**
     585                 :      * Transform points from source to destination space.
     586                 :      *
     587                 :      * This method is the same as the C function OCTTransformEx().
     588                 :      *
     589                 :      * @param nCount number of points to transform.
     590                 :      * @param x array of nCount X vertices, modified in place.
     591                 :      * @param y array of nCount Y vertices, modified in place.
     592                 :      * @param z array of nCount Z vertices, modified in place.
     593                 :      * @param pabSuccess array of per-point flags set to TRUE if that point 
     594                 :      * transforms, or FALSE if it does not.
     595                 :      *
     596                 :      * @return TRUE if some or all points transform successfully, or FALSE if 
     597                 :      * if none transform.
     598                 :      */
     599                 :     virtual int TransformEx( int nCount, 
     600                 :                              double *x, double *y, double *z = NULL,
     601                 :                              int *pabSuccess = NULL ) = 0;
     602                 : 
     603                 : };
     604                 : 
     605                 : OGRCoordinateTransformation CPL_DLL *
     606                 : OGRCreateCoordinateTransformation( OGRSpatialReference *poSource, 
     607                 :                                    OGRSpatialReference *poTarget );
     608                 : 
     609                 : #endif /* ndef _OGR_SPATIALREF_H_INCLUDED */

Generated by: LCOV version 1.7