GDAL
ogr_spatialref.h
Go to the documentation of this file.
1 /******************************************************************************
2  * $Id: ogr_spatialref.h e37e476c4cf8f4b0df8995e0d95d5d672fca1a9b 2018-05-05 16:54:18 +0200 Even 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  * Copyright (c) 2008-2013, Even Rouault <even dot rouault at mines-paris dot org>
12  *
13  * Permission is hereby granted, free of charge, to any person obtaining a
14  * copy of this software and associated documentation files (the "Software"),
15  * to deal in the Software without restriction, including without limitation
16  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17  * and/or sell copies of the Software, and to permit persons to whom the
18  * Software is furnished to do so, subject to the following conditions:
19  *
20  * The above copyright notice and this permission notice shall be included
21  * in all copies or substantial portions of the Software.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29  * DEALINGS IN THE SOFTWARE.
30  ****************************************************************************/
31 
32 #ifndef OGR_SPATIALREF_H_INCLUDED
33 #define OGR_SPATIALREF_H_INCLUDED
34 
35 #include "cpl_string.h"
36 #include "ogr_srs_api.h"
37 
38 #include <cstddef>
39 #include <map>
40 #include <vector>
41 
48 /************************************************************************/
49 /* OGR_SRSNode */
50 /************************************************************************/
51 
65 class CPL_DLL OGR_SRSNode
66 {
67  char *pszValue;
68 
69  OGR_SRSNode **papoChildNodes;
70  OGR_SRSNode *poParent;
71 
72  int nChildren;
73 
74  int NeedsQuoting() const;
75  OGRErr importFromWkt( const char **, int nRecLevel, int* pnNodes );
76 
78 
79  public:
80  explicit OGR_SRSNode(const char * = nullptr);
81  ~OGR_SRSNode();
82 
86  int IsLeafNode() const { return nChildren == 0; }
87 
88  int GetChildCount() const { return nChildren; }
89  OGR_SRSNode *GetChild( int );
90  const OGR_SRSNode *GetChild( int ) const;
91 
92  OGR_SRSNode *GetNode( const char * );
93  const OGR_SRSNode *GetNode( const char * ) const;
94 
95  void InsertChild( OGR_SRSNode *, int );
96  void AddChild( OGR_SRSNode * );
97  int FindChild( const char * ) const;
98  void DestroyChild( int );
99  void ClearChildren();
100  void StripNodes( const char * );
101 
102  const char *GetValue() const { return pszValue; }
103  void SetValue( const char * );
104 
105  void MakeValueSafe();
106  OGRErr FixupOrdering();
107 
108  OGR_SRSNode *Clone() const;
109 
110  OGRErr importFromWkt( char ** )
112  CPL_WARN_DEPRECATED("Use importFromWkt(const char**)")
114  ;
115  OGRErr importFromWkt( const char ** );
116  OGRErr exportToWkt( char ** ) const;
117  OGRErr exportToPrettyWkt( char **, int = 1) const;
118 
119  OGRErr applyRemapper( const char *pszNode,
120  const char * const *papszSrcValues,
121  const char * const *papszDstValues,
122  int nStepSize = 1,
123  int bChildOfHit = FALSE );
124 };
125 
126 /************************************************************************/
127 /* OGRSpatialReference */
128 /************************************************************************/
129 
147 class CPL_DLL OGRSpatialReference
148 {
149  mutable double dfFromGreenwich;
150  mutable double dfToMeter;
151  mutable double dfToDegrees;
152 
153  OGR_SRSNode *poRoot;
154 
155  int nRefCount;
156  mutable int bNormInfoSet;
157 
158  static OGRErr Validate(OGR_SRSNode *poRoot);
159  static OGRErr ValidateAuthority(OGR_SRSNode *poRoot);
160  static OGRErr ValidateAxis(OGR_SRSNode *poRoot);
161  static OGRErr ValidateUnit(OGR_SRSNode *poRoot);
162  static OGRErr ValidateVertDatum(OGR_SRSNode *poRoot);
163  static OGRErr ValidateProjection( OGR_SRSNode* poRoot );
164  static int IsAliasFor( const char *, const char * );
165  void GetNormInfo() const;
166 
167  OGRErr importFromURNPart(const char* pszAuthority,
168  const char* pszCode,
169  const char* pszURN);
170 
171  OGRErr importFromEPSGAInternal(int nCode,
172  const char* pszSRSType);
173 
174  static const std::vector<OGRSpatialReference*>* GetSRSCache(
175  const char* pszSRSType,
176  const std::map<CPLString, int>*& poMapESRICSNameToCodeOut);
177 
178  public:
180  explicit OGRSpatialReference(const char * = nullptr);
181 
182  virtual ~OGRSpatialReference();
183 
184  static void DestroySpatialReference(OGRSpatialReference* poSRS);
185 
186  OGRSpatialReference &operator=(const OGRSpatialReference&);
187 
188  int Reference();
189  int Dereference();
190  int GetReferenceCount() const { return nRefCount; }
191  void Release();
192 
193  OGRSpatialReference *Clone() const;
194  OGRSpatialReference *CloneGeogCS() const;
195 
196  void dumpReadable();
197  OGRErr exportToWkt( char ** ) const;
198  OGRErr exportToPrettyWkt( char **, int = FALSE) const;
199  OGRErr exportToProj4( char ** ) const;
200  OGRErr exportToPCI( char **, char **, double ** ) const;
201  OGRErr exportToUSGS( long *, long *, double **, long * ) const;
202  OGRErr exportToXML( char **, const char * = nullptr ) const;
203  OGRErr exportToPanorama( long *, long *, long *, long *,
204  double * ) const;
205  OGRErr exportToERM( char *pszProj, char *pszDatum, char *pszUnits );
206  OGRErr exportToMICoordSys( char ** ) const;
207 
208 
209  OGRErr importFromWkt( char ** )
211  CPL_WARN_DEPRECATED("Use importFromWkt(const char**) or importFromWkt(const char*)")
213  ;
214 
215  OGRErr importFromWkt( const char ** );
216  OGRErr importFromWkt( const char* );
217  OGRErr importFromProj4( const char * );
218  OGRErr importFromEPSG( int );
219  OGRErr importFromEPSGA( int );
220  OGRErr importFromESRI( char ** );
221  OGRErr importFromPCI( const char *, const char * = nullptr,
222  double * = nullptr );
223 
224 #define USGS_ANGLE_DECIMALDEGREES 0
225 #define USGS_ANGLE_PACKEDDMS TRUE
226 #define USGS_ANGLE_RADIANS 2
227  OGRErr importFromUSGS( long iProjSys, long iZone,
228  double *padfPrjParams, long iDatum,
229  int nUSGSAngleFormat = USGS_ANGLE_PACKEDDMS );
230  OGRErr importFromPanorama( long, long, long, double* );
231  OGRErr importFromOzi( const char * const* papszLines );
232  OGRErr importFromWMSAUTO( const char *pszAutoDef );
233  OGRErr importFromXML( const char * );
234  OGRErr importFromDict( const char *pszDict, const char *pszCode );
235  OGRErr importFromURN( const char * );
236  OGRErr importFromCRSURL( const char * );
237  OGRErr importFromERM( const char *pszProj, const char *pszDatum,
238  const char *pszUnits );
239  OGRErr importFromUrl( const char * );
240  OGRErr importFromMICoordSys( const char * );
241 
242  OGRErr morphToESRI();
243  OGRErr morphFromESRI();
244 
245  OGRSpatialReference* convertToOtherProjection(
246  const char* pszTargetProjection,
247  const char* const* papszOptions = nullptr ) const;
248 
249  OGRErr Validate() const;
250  OGRErr StripCTParms( OGR_SRSNode * = nullptr );
251  OGRErr StripVertical();
252  OGRErr FixupOrdering();
253  OGRErr Fixup();
254 
255  int EPSGTreatsAsLatLong() const;
256  int EPSGTreatsAsNorthingEasting() const;
257  const char *GetAxis( const char *pszTargetKey, int iAxis,
258  OGRAxisOrientation *peOrientation ) const;
259  OGRErr SetAxes( const char *pszTargetKey,
260  const char *pszXAxisName,
261  OGRAxisOrientation eXAxisOrientation,
262  const char *pszYAxisName,
263  OGRAxisOrientation eYAxisOrientation );
264 
265  // Machinery for accessing parse nodes
266 
268  OGR_SRSNode *GetRoot() { return poRoot; }
270  const OGR_SRSNode *GetRoot() const { return poRoot; }
271  void SetRoot( OGR_SRSNode * );
272 
273  OGR_SRSNode *GetAttrNode(const char *);
274  const OGR_SRSNode *GetAttrNode(const char *) const;
275  const char *GetAttrValue(const char *, int = 0) const;
276 
277  OGRErr SetNode( const char *, const char * );
278  OGRErr SetNode( const char *, double );
279 
280  OGRErr SetLinearUnitsAndUpdateParameters( const char *pszName,
281  double dfInMeters );
282  OGRErr SetLinearUnits( const char *pszName, double dfInMeters );
283  OGRErr SetTargetLinearUnits( const char *pszTargetKey,
284  const char *pszName, double dfInMeters );
285 
286  double GetLinearUnits( char ** ) const CPL_WARN_DEPRECATED("Use GetLinearUnits(const char**) instead");
287  double GetLinearUnits( const char ** = nullptr ) const;
289  double GetLinearUnits( std::nullptr_t ) const
290  { return GetLinearUnits( static_cast<const char**>(nullptr) ); }
293  double GetTargetLinearUnits( const char *pszTargetKey,
294  char ** ppszRetName ) const
295  CPL_WARN_DEPRECATED("Use GetTargetLinearUnits(const char*, const char**)");
296  double GetTargetLinearUnits( const char *pszTargetKey,
297  const char ** ppszRetName = nullptr ) const;
299  double GetTargetLinearUnits( const char *pszTargetKey, std::nullptr_t ) const
300  { return GetTargetLinearUnits( pszTargetKey, static_cast<const char**>(nullptr) ); }
303  OGRErr SetAngularUnits( const char *pszName, double dfInRadians );
304  double GetAngularUnits( char ** ) const CPL_WARN_DEPRECATED("Use GetAngularUnits(const char**) instead");
305  double GetAngularUnits( const char ** = nullptr ) const;
307  double GetAngularUnits( std::nullptr_t ) const
308  { return GetAngularUnits( static_cast<const char**>(nullptr) ); }
311  double GetPrimeMeridian( char ** ) const CPL_WARN_DEPRECATED("Use GetPrimeMeridian(const char**) instead");
312  double GetPrimeMeridian( const char ** = nullptr ) const;
314  double GetPrimeMeridian( std::nullptr_t ) const
315  { return GetPrimeMeridian( static_cast<const char**>(nullptr) ); }
318  int IsGeographic() const;
319  int IsProjected() const;
320  int IsGeocentric() const;
321  int IsLocal() const;
322  int IsVertical() const;
323  int IsCompound() const;
324  int IsSameGeogCS( const OGRSpatialReference * ) const;
325  int IsSameGeogCS( const OGRSpatialReference *,
326  const char* const * papszOptions ) const;
327  int IsSameVertCS( const OGRSpatialReference * ) const;
328  int IsSame( const OGRSpatialReference * ) const;
329  int IsSame( const OGRSpatialReference *,
330  const char* const * papszOptions ) const;
331 
332  void Clear();
333  OGRErr SetLocalCS( const char * );
334  OGRErr SetProjCS( const char * );
335  OGRErr SetProjection( const char * );
336  OGRErr SetGeocCS( const char * pszGeocName );
337  OGRErr SetGeogCS( const char * pszGeogName,
338  const char * pszDatumName,
339  const char * pszEllipsoidName,
340  double dfSemiMajor, double dfInvFlattening,
341  const char * pszPMName = nullptr,
342  double dfPMOffset = 0.0,
343  const char * pszUnits = nullptr,
344  double dfConvertToRadians = 0.0 );
345  OGRErr SetWellKnownGeogCS( const char * );
346  OGRErr CopyGeogCSFrom( const OGRSpatialReference * poSrcSRS );
347  OGRErr SetVertCS( const char *pszVertCSName,
348  const char *pszVertDatumName,
349  int nVertDatumClass = 2005 );
350  OGRErr SetCompoundCS( const char *pszName,
351  const OGRSpatialReference *poHorizSRS,
352  const OGRSpatialReference *poVertSRS );
353 
354  OGRErr SetFromUserInput( const char * );
355 
356  OGRErr SetTOWGS84( double, double, double,
357  double = 0.0, double = 0.0, double = 0.0,
358  double = 0.0 );
359  OGRErr GetTOWGS84( double *padfCoef, int nCoeff = 7 ) const;
360 
361  double GetSemiMajor( OGRErr * = nullptr ) const;
362  double GetSemiMinor( OGRErr * = nullptr ) const;
363  double GetInvFlattening( OGRErr * = nullptr ) const;
364  double GetEccentricity() const;
365  double GetSquaredEccentricity() const;
366 
367  OGRErr SetAuthority( const char * pszTargetKey,
368  const char * pszAuthority,
369  int nCode );
370 
371  OGRErr AutoIdentifyEPSG();
372  OGRSpatialReferenceH* FindMatches( char** papszOptions,
373  int* pnEntries,
374  int** ppanMatchConfidence ) const;
375 
376  int GetEPSGGeogCS() const;
377 
378  const char *GetAuthorityCode( const char * pszTargetKey ) const;
379  const char *GetAuthorityName( const char * pszTargetKey ) const;
380 
381  const char *GetExtension( const char *pszTargetKey,
382  const char *pszName,
383  const char *pszDefault = nullptr ) const;
384  OGRErr SetExtension( const char *pszTargetKey,
385  const char *pszName,
386  const char *pszValue );
387 
388  int FindProjParm( const char *pszParameter,
389  const OGR_SRSNode *poPROJCS=nullptr ) const;
390  OGRErr SetProjParm( const char *, double );
391  double GetProjParm( const char *, double =0.0, OGRErr* = nullptr ) const;
392 
393  OGRErr SetNormProjParm( const char *, double );
394  double GetNormProjParm( const char *, double=0.0, OGRErr* =nullptr)const;
395 
396  static int IsAngularParameter( const char * );
397  static int IsLongitudeParameter( const char * );
398  static int IsLinearParameter( const char * );
399 
401  OGRErr SetACEA( double dfStdP1, double dfStdP2,
402  double dfCenterLat, double dfCenterLong,
403  double dfFalseEasting, double dfFalseNorthing );
404 
406  OGRErr SetAE( double dfCenterLat, double dfCenterLong,
407  double dfFalseEasting, double dfFalseNorthing );
408 
410  OGRErr SetBonne( double dfStdP1, double dfCentralMeridian,
411  double dfFalseEasting, double dfFalseNorthing );
412 
414  OGRErr SetCEA( double dfStdP1, double dfCentralMeridian,
415  double dfFalseEasting, double dfFalseNorthing );
416 
418  OGRErr SetCS( double dfCenterLat, double dfCenterLong,
419  double dfFalseEasting, double dfFalseNorthing );
420 
422  OGRErr SetEC( double dfStdP1, double dfStdP2,
423  double dfCenterLat, double dfCenterLong,
424  double dfFalseEasting, double dfFalseNorthing );
425 
427  OGRErr SetEckert( int nVariation, double dfCentralMeridian,
428  double dfFalseEasting, double dfFalseNorthing );
429 
431  OGRErr SetEckertIV( double dfCentralMeridian,
432  double dfFalseEasting, double dfFalseNorthing );
433 
435  OGRErr SetEckertVI( double dfCentralMeridian,
436  double dfFalseEasting, double dfFalseNorthing );
437 
439  OGRErr SetEquirectangular(double dfCenterLat, double dfCenterLong,
440  double dfFalseEasting, double dfFalseNorthing );
442  OGRErr SetEquirectangular2( double dfCenterLat, double dfCenterLong,
443  double dfPseudoStdParallel1,
444  double dfFalseEasting, double dfFalseNorthing );
445 
447  OGRErr SetGEOS( double dfCentralMeridian, double dfSatelliteHeight,
448  double dfFalseEasting, double dfFalseNorthing );
449 
451  OGRErr SetGH( double dfCentralMeridian,
452  double dfFalseEasting, double dfFalseNorthing );
453 
455  OGRErr SetIGH();
456 
458  OGRErr SetGS( double dfCentralMeridian,
459  double dfFalseEasting, double dfFalseNorthing );
460 
462  OGRErr SetGaussSchreiberTMercator(double dfCenterLat, double dfCenterLong,
463  double dfScale,
464  double dfFalseEasting, double dfFalseNorthing );
465 
467  OGRErr SetGnomonic(double dfCenterLat, double dfCenterLong,
468  double dfFalseEasting, double dfFalseNorthing );
469 
471  OGRErr SetHOM( double dfCenterLat, double dfCenterLong,
472  double dfAzimuth, double dfRectToSkew,
473  double dfScale,
474  double dfFalseEasting, double dfFalseNorthing );
475 
477  OGRErr SetHOM2PNO( double dfCenterLat,
478  double dfLat1, double dfLong1,
479  double dfLat2, double dfLong2,
480  double dfScale,
481  double dfFalseEasting, double dfFalseNorthing );
482 
483 #ifdef undef
484 
485  OGRErr SetOM( double dfCenterLat, double dfCenterLong,
486  double dfAzimuth, double dfRectToSkew,
487  double dfScale,
488  double dfFalseEasting, double dfFalseNorthing );
489 #endif
490 
492  OGRErr SetHOMAC( double dfCenterLat, double dfCenterLong,
493  double dfAzimuth, double dfRectToSkew,
494  double dfScale,
495  double dfFalseEasting, double dfFalseNorthing );
496 
498  OGRErr SetIWMPolyconic( double dfLat1, double dfLat2,
499  double dfCenterLong,
500  double dfFalseEasting,
501  double dfFalseNorthing );
502 
504  OGRErr SetKrovak( double dfCenterLat, double dfCenterLong,
505  double dfAzimuth, double dfPseudoStdParallelLat,
506  double dfScale,
507  double dfFalseEasting, double dfFalseNorthing );
508 
510  OGRErr SetLAEA( double dfCenterLat, double dfCenterLong,
511  double dfFalseEasting, double dfFalseNorthing );
512 
514  OGRErr SetLCC( double dfStdP1, double dfStdP2,
515  double dfCenterLat, double dfCenterLong,
516  double dfFalseEasting, double dfFalseNorthing );
517 
519  OGRErr SetLCC1SP( double dfCenterLat, double dfCenterLong,
520  double dfScale,
521  double dfFalseEasting, double dfFalseNorthing );
522 
524  OGRErr SetLCCB( double dfStdP1, double dfStdP2,
525  double dfCenterLat, double dfCenterLong,
526  double dfFalseEasting, double dfFalseNorthing );
527 
529  OGRErr SetMC( double dfCenterLat, double dfCenterLong,
530  double dfFalseEasting, double dfFalseNorthing );
531 
533  OGRErr SetMercator( double dfCenterLat, double dfCenterLong,
534  double dfScale,
535  double dfFalseEasting, double dfFalseNorthing );
536 
538  OGRErr SetMercator2SP( double dfStdP1,
539  double dfCenterLat, double dfCenterLong,
540  double dfFalseEasting, double dfFalseNorthing );
541 
543  OGRErr SetMollweide( double dfCentralMeridian,
544  double dfFalseEasting, double dfFalseNorthing );
545 
547  OGRErr SetNZMG( double dfCenterLat, double dfCenterLong,
548  double dfFalseEasting, double dfFalseNorthing );
549 
551  OGRErr SetOS( double dfOriginLat, double dfCMeridian,
552  double dfScale,
553  double dfFalseEasting,double dfFalseNorthing);
554 
556  OGRErr SetOrthographic( double dfCenterLat, double dfCenterLong,
557  double dfFalseEasting,double dfFalseNorthing);
558 
560  OGRErr SetPolyconic( double dfCenterLat, double dfCenterLong,
561  double dfFalseEasting, double dfFalseNorthing );
562 
564  OGRErr SetPS( double dfCenterLat, double dfCenterLong,
565  double dfScale,
566  double dfFalseEasting, double dfFalseNorthing);
567 
569  OGRErr SetRobinson( double dfCenterLong,
570  double dfFalseEasting, double dfFalseNorthing );
571 
573  OGRErr SetSinusoidal( double dfCenterLong,
574  double dfFalseEasting, double dfFalseNorthing );
575 
577  OGRErr SetStereographic( double dfCenterLat, double dfCenterLong,
578  double dfScale,
579  double dfFalseEasting,double dfFalseNorthing);
580 
582  OGRErr SetSOC( double dfLatitudeOfOrigin, double dfCentralMeridian,
583  double dfFalseEasting, double dfFalseNorthing );
584 
586  OGRErr SetTM( double dfCenterLat, double dfCenterLong,
587  double dfScale,
588  double dfFalseEasting, double dfFalseNorthing );
589 
591  OGRErr SetTMVariant( const char *pszVariantName,
592  double dfCenterLat, double dfCenterLong,
593  double dfScale,
594  double dfFalseEasting, double dfFalseNorthing );
595 
597  OGRErr SetTMG( double dfCenterLat, double dfCenterLong,
598  double dfFalseEasting, double dfFalseNorthing );
599 
601  OGRErr SetTMSO( double dfCenterLat, double dfCenterLong,
602  double dfScale,
603  double dfFalseEasting, double dfFalseNorthing );
604 
606  OGRErr SetTPED( double dfLat1, double dfLong1,
607  double dfLat2, double dfLong2,
608  double dfFalseEasting, double dfFalseNorthing );
609 
611  OGRErr SetVDG( double dfCenterLong,
612  double dfFalseEasting, double dfFalseNorthing );
613 
615  OGRErr SetUTM( int nZone, int bNorth = TRUE );
616  int GetUTMZone( int *pbNorth = nullptr ) const;
617 
619  OGRErr SetWagner( int nVariation, double dfCenterLat,
620  double dfFalseEasting, double dfFalseNorthing );
621 
623  OGRErr SetQSC(double dfCenterLat, double dfCenterLong);
624 
626  OGRErr SetSCH( double dfPegLat, double dfPegLong,
627  double dfPegHeading, double dfPegHgt);
629  OGRErr SetStatePlane( int nZone, int bNAD83 = TRUE,
630  const char *pszOverrideUnitName = nullptr,
631  double dfOverrideUnit = 0.0 );
632 
634  OGRErr ImportFromESRIStatePlaneWKT(
635  int nCode, const char* pszDatumName, const char* pszUnitsName,
636  int nPCSCode, const char* pszCSName = nullptr );
637 
639  OGRErr ImportFromESRIWisconsinWKT(
640  const char* pszPrjName, double dfCentralMeridian, double dfLatOfOrigin,
641  const char* pszUnitsName, const char* pszCSName = nullptr );
642 
643  static OGRSpatialReference* GetWGS84SRS();
644 
649  { return reinterpret_cast<OGRSpatialReferenceH>(poSRS); }
650 
655  { return reinterpret_cast<OGRSpatialReference*>(hSRS); }
656 
657 };
658 
659 /************************************************************************/
660 /* OGRCoordinateTransformation */
661 /* */
662 /* This is really just used as a base class for a private */
663 /* implementation. */
664 /************************************************************************/
665 
676 {
677 public:
678  virtual ~OGRCoordinateTransformation() {}
679 
680  static void DestroyCT(OGRCoordinateTransformation* poCT);
681 
682  // From CT_CoordinateTransformation
683 
685  virtual OGRSpatialReference *GetSourceCS() = 0;
686 
688  virtual OGRSpatialReference *GetTargetCS() = 0;
689 
691  virtual bool GetEmitErrors() { return false; }
692 
694  virtual void SetEmitErrors(bool /*bEmitErrors*/) {}
695 
696  // From CT_MathTransform
697 
713  virtual int Transform( int nCount,
714  double *x, double *y, double *z = nullptr ) = 0;
715 
731  virtual int TransformEx( int nCount,
732  double *x, double *y, double *z = nullptr,
733  int *pabSuccess = nullptr ) = 0;
734 
739  { return reinterpret_cast<OGRCoordinateTransformationH>(poCT); }
740 
745  { return reinterpret_cast<OGRCoordinateTransformation*>(hCT); }
746 };
747 
750  OGRSpatialReference *poTarget );
751 
752 #endif /* ndef OGR_SPATIALREF_H_INCLUDED */
int GetReferenceCount() const
Fetch current reference count.
Definition: ogr_spatialref.h:190
int IsLeafNode() const
Return whether this is a leaf node.
Definition: ogr_spatialref.h:86
static OGRCoordinateTransformationH ToHandle(OGRCoordinateTransformation *poCT)
Convert a OGRCoordinateTransformation* to a OGRCoordinateTransformationH.
Definition: ogr_spatialref.h:738
virtual void SetEmitErrors(bool)
Set if the transformer must emit CPLError.
Definition: ogr_spatialref.h:694
OGRCoordinateTransformation * OGRCreateCoordinateTransformation(OGRSpatialReference *poSource, OGRSpatialReference *poTarget)
Create transformation object.
Definition: ogrct.cpp:495
Objects of this class are used to represent value nodes in the parsed representation of the WKT SRS f...
Definition: ogr_spatialref.h:65
const char * GetValue() const
Fetch value string for this node.
Definition: ogr_spatialref.h:102
Various convenience functions for working with strings and string lists.
int GetChildCount() const
Get number of children nodes.
Definition: ogr_spatialref.h:88
void * OGRCoordinateTransformationH
Opaque type for a coordinate transformation object.
Definition: ogr_api.h:76
#define USGS_ANGLE_PACKEDDMS
Angle is in packed degree minute second.
Definition: ogr_spatialref.h:225
OGR_SRSNode * GetRoot()
Return root node.
Definition: ogr_spatialref.h:268
void * OGRSpatialReferenceH
Opaque type for a spatial reference system.
Definition: ogr_api.h:74
C spatial reference system services and defines.
OGRAxisOrientation
Axis orientations (corresponds to CS_AxisOrientationEnum).
Definition: ogr_srs_api.h:48
virtual bool GetEmitErrors()
Whether the transformer will emit CPLError.
Definition: ogr_spatialref.h:691
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:147
static OGRSpatialReferenceH ToHandle(OGRSpatialReference *poSRS)
Convert a OGRSpatialReference* to a OGRSpatialReferenceH.
Definition: ogr_spatialref.h:648
static OGRSpatialReference * FromHandle(OGRSpatialReferenceH hSRS)
Convert a OGRSpatialReferenceH to a OGRSpatialReference*.
Definition: ogr_spatialref.h:654
static OGRCoordinateTransformation * FromHandle(OGRCoordinateTransformationH hCT)
Convert a OGRCoordinateTransformationH to a OGRCoordinateTransformation*.
Definition: ogr_spatialref.h:744
Interface for transforming between coordinate systems.
Definition: ogr_spatialref.h:675
const OGR_SRSNode * GetRoot() const
Return root node.
Definition: ogr_spatialref.h:270
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:290
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:989

Generated for GDAL by doxygen 1.8.13.