GDAL
ogr_spatialref.h
Go to the documentation of this file.
1/******************************************************************************
2 * $Id: ogr_spatialref.h 8b99fd4d3ad3db542705722876fcf484486f46d6 2019-12-17 14:27:30 +0100 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 <memory>
41#include <vector>
42
49/************************************************************************/
50/* OGR_SRSNode */
51/************************************************************************/
52
66class CPL_DLL OGR_SRSNode
67{
68 public:
70 struct Listener
71 {
72 virtual ~Listener();
74 virtual void notifyChange(OGR_SRSNode*) = 0;
75 };
76
77 explicit OGR_SRSNode(const char * = nullptr);
79
81 void RegisterListener(const std::shared_ptr<Listener>& listener);
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
107 OGR_SRSNode *Clone() const;
108
109 OGRErr importFromWkt( char ** )
111 CPL_WARN_DEPRECATED("Use importFromWkt(const char**)")
113 ;
114 OGRErr importFromWkt( const char ** );
115 OGRErr exportToWkt( char ** ) const;
116 OGRErr exportToPrettyWkt( char **, int = 1) const;
117
118 private:
119 char *pszValue;
120
121 OGR_SRSNode **papoChildNodes;
122 OGR_SRSNode *poParent;
123
124 int nChildren;
125
126 int NeedsQuoting() const;
127 OGRErr importFromWkt( const char **, int nRecLevel, int* pnNodes );
128
129 std::weak_ptr<Listener> m_listener{};
130 void notifyChange();
131
133};
134
135/************************************************************************/
136/* OGRSpatialReference */
137/************************************************************************/
138
157{
158 struct Private;
159 std::unique_ptr<Private> d;
160
161 void GetNormInfo() const;
162
163 OGRErr importFromURNPart(const char* pszAuthority,
164 const char* pszCode,
165 const char* pszURN);
166
167 static CPLString lookupInDict( const char *pszDictFile,
168 const char *pszCode );
169
170 public:
172 explicit OGRSpatialReference(const char * = nullptr);
173
174 virtual ~OGRSpatialReference();
175
176 static void DestroySpatialReference(OGRSpatialReference* poSRS);
177
178 OGRSpatialReference &operator=(const OGRSpatialReference&);
179
180 int Reference();
181 int Dereference();
182 int GetReferenceCount() const;
183 void Release();
184
185 const char* GetName() const;
186
187 OGRSpatialReference *Clone() const;
188 OGRSpatialReference *CloneGeogCS() const;
189
190 void dumpReadable();
191 OGRErr exportToWkt( char ** ) const;
192 OGRErr exportToWkt( char ** ppszWKT, const char* const* papszOptions ) const;
193 OGRErr exportToPrettyWkt( char **, int = FALSE) const;
194 OGRErr exportToProj4( char ** ) const;
195 OGRErr exportToPCI( char **, char **, double ** ) const;
196 OGRErr exportToUSGS( long *, long *, double **, long * ) const;
197 OGRErr exportToXML( char **, const char * = nullptr ) const;
198 OGRErr exportToPanorama( long *, long *, long *, long *,
199 double * ) const;
200 OGRErr exportToERM( char *pszProj, char *pszDatum, char *pszUnits );
201 OGRErr exportToMICoordSys( char ** ) const;
202
203
204 OGRErr importFromWkt( char ** )
206 CPL_WARN_DEPRECATED("Use importFromWkt(const char**) or importFromWkt(const char*)")
208 ;
209
210 OGRErr importFromWkt( const char ** );
211 OGRErr importFromWkt( const char* );
212 OGRErr importFromProj4( const char * );
213 OGRErr importFromEPSG( int );
214 OGRErr importFromEPSGA( int );
215 OGRErr importFromESRI( char ** );
216 OGRErr importFromPCI( const char *, const char * = nullptr,
217 double * = nullptr );
218
219#define USGS_ANGLE_DECIMALDEGREES 0
220#define USGS_ANGLE_PACKEDDMS TRUE
221#define USGS_ANGLE_RADIANS 2
222 OGRErr importFromUSGS( long iProjSys, long iZone,
223 double *padfPrjParams, long iDatum,
224 int nUSGSAngleFormat = USGS_ANGLE_PACKEDDMS );
225 OGRErr importFromPanorama( long, long, long, double* );
226 OGRErr importFromOzi( const char * const* papszLines );
227 OGRErr importFromWMSAUTO( const char *pszAutoDef );
228 OGRErr importFromXML( const char * );
229 OGRErr importFromDict( const char *pszDict, const char *pszCode );
230 OGRErr importFromURN( const char * );
231 OGRErr importFromCRSURL( const char * );
232 OGRErr importFromERM( const char *pszProj, const char *pszDatum,
233 const char *pszUnits );
234 OGRErr importFromUrl( const char * );
235 OGRErr importFromMICoordSys( const char * );
236
237 OGRErr morphToESRI();
238 OGRErr morphFromESRI();
239
240 OGRSpatialReference* convertToOtherProjection(
241 const char* pszTargetProjection,
242 const char* const* papszOptions = nullptr ) const;
243
244 OGRErr Validate() const;
245 OGRErr StripVertical();
246
247 int EPSGTreatsAsLatLong() const;
248 int EPSGTreatsAsNorthingEasting() const;
249 int GetAxesCount() const;
250 const char *GetAxis( const char *pszTargetKey, int iAxis,
251 OGRAxisOrientation *peOrientation ) const;
252 OGRErr SetAxes( const char *pszTargetKey,
253 const char *pszXAxisName,
254 OGRAxisOrientation eXAxisOrientation,
255 const char *pszYAxisName,
256 OGRAxisOrientation eYAxisOrientation );
257
258 OSRAxisMappingStrategy GetAxisMappingStrategy() const;
259 void SetAxisMappingStrategy(OSRAxisMappingStrategy);
260 const std::vector<int>& GetDataAxisToSRSAxisMapping() const;
261 OGRErr SetDataAxisToSRSAxisMapping(const std::vector<int>& mapping);
262
263 // Machinery for accessing parse nodes
264
266 OGR_SRSNode *GetRoot();
268 const OGR_SRSNode *GetRoot() const;
269 void SetRoot( OGR_SRSNode * );
270
271 OGR_SRSNode *GetAttrNode(const char *);
272 const OGR_SRSNode *GetAttrNode(const char *) const;
273 const char *GetAttrValue(const char *, int = 0) const;
274
275 OGRErr SetNode( const char *, const char * );
276 OGRErr SetNode( const char *, double );
277
278 OGRErr SetLinearUnitsAndUpdateParameters( const char *pszName,
279 double dfInMeters,
280 const char *pszUnitAuthority = nullptr,
281 const char *pszUnitCode = nullptr );
282 OGRErr SetLinearUnits( const char *pszName, double dfInMeters );
283 OGRErr SetTargetLinearUnits( const char *pszTargetKey,
284 const char *pszName,
285 double dfInMeters,
286 const char *pszUnitAuthority = nullptr,
287 const char *pszUnitCode = nullptr);
288
289 double GetLinearUnits( char ** ) const CPL_WARN_DEPRECATED("Use GetLinearUnits(const char**) instead");
290 double GetLinearUnits( const char ** = nullptr ) const;
292 double GetLinearUnits( std::nullptr_t ) const
293 { return GetLinearUnits( static_cast<const char**>(nullptr) ); }
296 double GetTargetLinearUnits( const char *pszTargetKey,
297 char ** ppszRetName ) const
298 CPL_WARN_DEPRECATED("Use GetTargetLinearUnits(const char*, const char**)");
299 double GetTargetLinearUnits( const char *pszTargetKey,
300 const char ** ppszRetName = nullptr ) const;
302 double GetTargetLinearUnits( const char *pszTargetKey, std::nullptr_t ) const
303 { return GetTargetLinearUnits( pszTargetKey, static_cast<const char**>(nullptr) ); }
306 OGRErr SetAngularUnits( const char *pszName, double dfInRadians );
307 double GetAngularUnits( char ** ) const CPL_WARN_DEPRECATED("Use GetAngularUnits(const char**) instead");
308 double GetAngularUnits( const char ** = nullptr ) const;
310 double GetAngularUnits( std::nullptr_t ) const
311 { return GetAngularUnits( static_cast<const char**>(nullptr) ); }
314 double GetPrimeMeridian( char ** ) const CPL_WARN_DEPRECATED("Use GetPrimeMeridian(const char**) instead");
315 double GetPrimeMeridian( const char ** = nullptr ) const;
317 double GetPrimeMeridian( std::nullptr_t ) const
318 { return GetPrimeMeridian( static_cast<const char**>(nullptr) ); }
321 bool IsEmpty() const;
322 int IsGeographic() const;
323 int IsProjected() const;
324 int IsGeocentric() const;
325 int IsLocal() const;
326 int IsVertical() const;
327 int IsCompound() const;
328 int IsSameGeogCS( const OGRSpatialReference * ) const;
329 int IsSameGeogCS( const OGRSpatialReference *,
330 const char* const * papszOptions ) const;
331 int IsSameVertCS( const OGRSpatialReference * ) const;
332 int IsSame( const OGRSpatialReference * ) const;
333 int IsSame( const OGRSpatialReference *,
334 const char* const * papszOptions ) const;
335
336 void Clear();
337 OGRErr SetLocalCS( const char * );
338 OGRErr SetProjCS( const char * );
339 OGRErr SetProjection( const char * );
340 OGRErr SetGeocCS( const char * pszGeocName );
341 OGRErr SetGeogCS( const char * pszGeogName,
342 const char * pszDatumName,
343 const char * pszEllipsoidName,
344 double dfSemiMajor, double dfInvFlattening,
345 const char * pszPMName = nullptr,
346 double dfPMOffset = 0.0,
347 const char * pszUnits = nullptr,
348 double dfConvertToRadians = 0.0 );
349 OGRErr SetWellKnownGeogCS( const char * );
350 OGRErr CopyGeogCSFrom( const OGRSpatialReference * poSrcSRS );
351 OGRErr SetVertCS( const char *pszVertCSName,
352 const char *pszVertDatumName,
353 int nVertDatumClass = 2005 );
354 OGRErr SetCompoundCS( const char *pszName,
355 const OGRSpatialReference *poHorizSRS,
356 const OGRSpatialReference *poVertSRS );
357
358 OGRErr SetFromUserInput( const char * );
359
360 OGRErr SetTOWGS84( double, double, double,
361 double = 0.0, double = 0.0, double = 0.0,
362 double = 0.0 );
363 OGRErr GetTOWGS84( double *padfCoef, int nCoeff = 7 ) const;
364 OGRErr AddGuessedTOWGS84();
365
366 double GetSemiMajor( OGRErr * = nullptr ) const;
367 double GetSemiMinor( OGRErr * = nullptr ) const;
368 double GetInvFlattening( OGRErr * = nullptr ) const;
369 double GetEccentricity() const;
370 double GetSquaredEccentricity() const;
371
372 OGRErr SetAuthority( const char * pszTargetKey,
373 const char * pszAuthority,
374 int nCode );
375
376 OGRErr AutoIdentifyEPSG();
377 OGRSpatialReferenceH* FindMatches( char** papszOptions,
378 int* pnEntries,
379 int** ppanMatchConfidence ) const;
380
381 int GetEPSGGeogCS() const;
382
383 const char *GetAuthorityCode( const char * pszTargetKey ) const;
384 const char *GetAuthorityName( const char * pszTargetKey ) const;
385
386 bool GetAreaOfUse( double* pdfWestLongitudeDeg,
387 double* pdfSouthLatitudeDeg,
388 double* pdfEastLongitudeDeg,
389 double* pdfNorthLatitudeDeg,
390 const char **ppszAreaName ) const;
391
392 const char *GetExtension( const char *pszTargetKey,
393 const char *pszName,
394 const char *pszDefault = nullptr ) const;
395 OGRErr SetExtension( const char *pszTargetKey,
396 const char *pszName,
397 const char *pszValue );
398
399 int FindProjParm( const char *pszParameter,
400 const OGR_SRSNode *poPROJCS=nullptr ) const;
401 OGRErr SetProjParm( const char *, double );
402 double GetProjParm( const char *, double =0.0, OGRErr* = nullptr ) const;
403
404 OGRErr SetNormProjParm( const char *, double );
405 double GetNormProjParm( const char *, double=0.0, OGRErr* =nullptr)const;
406
407 static int IsAngularParameter( const char * );
408 static int IsLongitudeParameter( const char * );
409 static int IsLinearParameter( const char * );
410
412 OGRErr SetACEA( double dfStdP1, double dfStdP2,
413 double dfCenterLat, double dfCenterLong,
414 double dfFalseEasting, double dfFalseNorthing );
415
417 OGRErr SetAE( double dfCenterLat, double dfCenterLong,
418 double dfFalseEasting, double dfFalseNorthing );
419
421 OGRErr SetBonne( double dfStdP1, double dfCentralMeridian,
422 double dfFalseEasting, double dfFalseNorthing );
423
425 OGRErr SetCEA( double dfStdP1, double dfCentralMeridian,
426 double dfFalseEasting, double dfFalseNorthing );
427
429 OGRErr SetCS( double dfCenterLat, double dfCenterLong,
430 double dfFalseEasting, double dfFalseNorthing );
431
433 OGRErr SetEC( double dfStdP1, double dfStdP2,
434 double dfCenterLat, double dfCenterLong,
435 double dfFalseEasting, double dfFalseNorthing );
436
438 OGRErr SetEckert( int nVariation, double dfCentralMeridian,
439 double dfFalseEasting, double dfFalseNorthing );
440
442 OGRErr SetEckertIV( double dfCentralMeridian,
443 double dfFalseEasting, double dfFalseNorthing );
444
446 OGRErr SetEckertVI( double dfCentralMeridian,
447 double dfFalseEasting, double dfFalseNorthing );
448
450 OGRErr SetEquirectangular(double dfCenterLat, double dfCenterLong,
451 double dfFalseEasting, double dfFalseNorthing );
453 OGRErr SetEquirectangular2( double dfCenterLat, double dfCenterLong,
454 double dfPseudoStdParallel1,
455 double dfFalseEasting, double dfFalseNorthing );
456
458 OGRErr SetGEOS( double dfCentralMeridian, double dfSatelliteHeight,
459 double dfFalseEasting, double dfFalseNorthing );
460
462 OGRErr SetGH( double dfCentralMeridian,
463 double dfFalseEasting, double dfFalseNorthing );
464
466 OGRErr SetIGH();
467
469 OGRErr SetGS( double dfCentralMeridian,
470 double dfFalseEasting, double dfFalseNorthing );
471
473 OGRErr SetGaussSchreiberTMercator(double dfCenterLat, double dfCenterLong,
474 double dfScale,
475 double dfFalseEasting, double dfFalseNorthing );
476
478 OGRErr SetGnomonic(double dfCenterLat, double dfCenterLong,
479 double dfFalseEasting, double dfFalseNorthing );
480
482 OGRErr SetHOM( double dfCenterLat, double dfCenterLong,
483 double dfAzimuth, double dfRectToSkew,
484 double dfScale,
485 double dfFalseEasting, double dfFalseNorthing );
486
488 OGRErr SetHOM2PNO( double dfCenterLat,
489 double dfLat1, double dfLong1,
490 double dfLat2, double dfLong2,
491 double dfScale,
492 double dfFalseEasting, double dfFalseNorthing );
493
495 OGRErr SetHOMAC( double dfCenterLat, double dfCenterLong,
496 double dfAzimuth, double dfRectToSkew,
497 double dfScale,
498 double dfFalseEasting, double dfFalseNorthing );
499
501 OGRErr SetLOM( double dfCenterLat, double dfCenterLong,
502 double dfAzimuth,
503 double dfScale,
504 double dfFalseEasting, double dfFalseNorthing );
505
507 OGRErr SetIWMPolyconic( double dfLat1, double dfLat2,
508 double dfCenterLong,
509 double dfFalseEasting,
510 double dfFalseNorthing );
511
513 OGRErr SetKrovak( double dfCenterLat, double dfCenterLong,
514 double dfAzimuth, double dfPseudoStdParallelLat,
515 double dfScale,
516 double dfFalseEasting, double dfFalseNorthing );
517
519 OGRErr SetLAEA( double dfCenterLat, double dfCenterLong,
520 double dfFalseEasting, double dfFalseNorthing );
521
523 OGRErr SetLCC( double dfStdP1, double dfStdP2,
524 double dfCenterLat, double dfCenterLong,
525 double dfFalseEasting, double dfFalseNorthing );
526
528 OGRErr SetLCC1SP( double dfCenterLat, double dfCenterLong,
529 double dfScale,
530 double dfFalseEasting, double dfFalseNorthing );
531
533 OGRErr SetLCCB( double dfStdP1, double dfStdP2,
534 double dfCenterLat, double dfCenterLong,
535 double dfFalseEasting, double dfFalseNorthing );
536
538 OGRErr SetMC( double dfCenterLat, double dfCenterLong,
539 double dfFalseEasting, double dfFalseNorthing );
540
542 OGRErr SetMercator( double dfCenterLat, double dfCenterLong,
543 double dfScale,
544 double dfFalseEasting, double dfFalseNorthing );
545
547 OGRErr SetMercator2SP( double dfStdP1,
548 double dfCenterLat, double dfCenterLong,
549 double dfFalseEasting, double dfFalseNorthing );
550
552 OGRErr SetMollweide( double dfCentralMeridian,
553 double dfFalseEasting, double dfFalseNorthing );
554
556 OGRErr SetNZMG( double dfCenterLat, double dfCenterLong,
557 double dfFalseEasting, double dfFalseNorthing );
558
560 OGRErr SetOS( double dfOriginLat, double dfCMeridian,
561 double dfScale,
562 double dfFalseEasting,double dfFalseNorthing);
563
565 OGRErr SetOrthographic( double dfCenterLat, double dfCenterLong,
566 double dfFalseEasting,double dfFalseNorthing);
567
569 OGRErr SetPolyconic( double dfCenterLat, double dfCenterLong,
570 double dfFalseEasting, double dfFalseNorthing );
571
573 OGRErr SetPS( double dfCenterLat, double dfCenterLong,
574 double dfScale,
575 double dfFalseEasting, double dfFalseNorthing);
576
578 OGRErr SetRobinson( double dfCenterLong,
579 double dfFalseEasting, double dfFalseNorthing );
580
582 OGRErr SetSinusoidal( double dfCenterLong,
583 double dfFalseEasting, double dfFalseNorthing );
584
586 OGRErr SetStereographic( double dfCenterLat, double dfCenterLong,
587 double dfScale,
588 double dfFalseEasting,double dfFalseNorthing);
589
591 OGRErr SetSOC( double dfLatitudeOfOrigin, double dfCentralMeridian,
592 double dfFalseEasting, double dfFalseNorthing );
593
595 OGRErr SetTM( double dfCenterLat, double dfCenterLong,
596 double dfScale,
597 double dfFalseEasting, double dfFalseNorthing );
598
600 OGRErr SetTMVariant( const char *pszVariantName,
601 double dfCenterLat, double dfCenterLong,
602 double dfScale,
603 double dfFalseEasting, double dfFalseNorthing );
604
606 OGRErr SetTMG( double dfCenterLat, double dfCenterLong,
607 double dfFalseEasting, double dfFalseNorthing );
608
610 OGRErr SetTMSO( double dfCenterLat, double dfCenterLong,
611 double dfScale,
612 double dfFalseEasting, double dfFalseNorthing );
613
615 OGRErr SetTPED( double dfLat1, double dfLong1,
616 double dfLat2, double dfLong2,
617 double dfFalseEasting, double dfFalseNorthing );
618
620 OGRErr SetVDG( double dfCenterLong,
621 double dfFalseEasting, double dfFalseNorthing );
622
624 OGRErr SetUTM( int nZone, int bNorth = TRUE );
625 int GetUTMZone( int *pbNorth = nullptr ) const;
626
628 OGRErr SetWagner( int nVariation, double dfCenterLat,
629 double dfFalseEasting, double dfFalseNorthing );
630
632 OGRErr SetQSC(double dfCenterLat, double dfCenterLong);
633
635 OGRErr SetSCH( double dfPegLat, double dfPegLong,
636 double dfPegHeading, double dfPegHgt);
638 OGRErr SetStatePlane( int nZone, int bNAD83 = TRUE,
639 const char *pszOverrideUnitName = nullptr,
640 double dfOverrideUnit = 0.0 );
641
643 OGRErr ImportFromESRIStatePlaneWKT(
644 int nCode, const char* pszDatumName, const char* pszUnitsName,
645 int nPCSCode, const char* pszCRSName = nullptr );
646
648 OGRErr ImportFromESRIWisconsinWKT(
649 const char* pszPrjName, double dfCentralMeridian, double dfLatOfOrigin,
650 const char* pszUnitsName, const char* pszCRSName = nullptr );
651
652 static OGRSpatialReference* GetWGS84SRS();
653
658 { return reinterpret_cast<OGRSpatialReferenceH>(poSRS); }
659
664 { return reinterpret_cast<OGRSpatialReference*>(hSRS); }
665
666};
667
668/************************************************************************/
669/* OGRCoordinateTransformation */
670/* */
671/* This is really just used as a base class for a private */
672/* implementation. */
673/************************************************************************/
674
685{
686public:
688
689 static void DestroyCT(OGRCoordinateTransformation* poCT);
690
691 // From CT_CoordinateTransformation
692
695
698
700 virtual bool GetEmitErrors() const { return false; }
701
703 virtual void SetEmitErrors(bool /*bEmitErrors*/) {}
704
705 // From CT_MathTransform
706
722 int Transform( int nCount,
723 double *x, double *y, double *z = nullptr,
724 int *pabSuccess = nullptr );
725
742 virtual int Transform( int nCount,
743 double *x, double *y,
744 double *z, double *t,
745 int *pabSuccess ) = 0;
746
751 { return reinterpret_cast<OGRCoordinateTransformationH>(poCT); }
752
757 { return reinterpret_cast<OGRCoordinateTransformation*>(hCT); }
758};
759
762 const OGRSpatialReference *poTarget );
763
764
772{
773private:
774 friend class OGRProjCT;
775 struct Private;
776 std::unique_ptr<Private> d;
777
778public:
781
782 bool SetAreaOfInterest(double dfWestLongitudeDeg,
783 double dfSouthLatitudeDeg,
784 double dfEastLongitudeDeg,
785 double dfNorthLatitudeDeg);
786
787 bool SetCoordinateOperation(const char* pszCT, bool bReverseCT);
789 void SetSourceCenterLong(double dfCenterLong);
790 void SetTargetCenterLong(double dfCenterLong);
792};
793
794
797 const OGRSpatialReference *poTarget,
798 const OGRCoordinateTransformationOptions& options );
799
800#endif /* ndef OGR_SPATIALREF_H_INCLUDED */
Convenient string class based on std::string.
Definition: cpl_string.h:330
Interface for transforming between coordinate systems.
Definition: ogr_spatialref.h:685
virtual OGRSpatialReference * GetSourceCS()=0
Fetch internal source coordinate system.
virtual void SetEmitErrors(bool)
Set if the transformer must emit CPLError.
Definition: ogr_spatialref.h:703
virtual OGRSpatialReference * GetTargetCS()=0
Fetch internal target coordinate system.
virtual bool GetEmitErrors() const
Whether the transformer will emit CPLError.
Definition: ogr_spatialref.h:700
virtual int Transform(int nCount, double *x, double *y, double *z, double *t, int *pabSuccess)=0
Transform points from source to destination space.
static OGRCoordinateTransformation * FromHandle(OGRCoordinateTransformationH hCT)
Convert a OGRCoordinateTransformationH to a OGRCoordinateTransformation*.
Definition: ogr_spatialref.h:756
static OGRCoordinateTransformationH ToHandle(OGRCoordinateTransformation *poCT)
Convert a OGRCoordinateTransformation* to a OGRCoordinateTransformationH.
Definition: ogr_spatialref.h:750
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:157
static OGRSpatialReferenceH ToHandle(OGRSpatialReference *poSRS)
Convert a OGRSpatialReference* to a OGRSpatialReferenceH.
Definition: ogr_spatialref.h:657
static OGRSpatialReference * FromHandle(OGRSpatialReferenceH hSRS)
Convert a OGRSpatialReferenceH to a OGRSpatialReference*.
Definition: ogr_spatialref.h:663
Objects of this class are used to represent value nodes in the parsed representation of the WKT SRS f...
Definition: ogr_spatialref.h:67
int GetChildCount() const
Get number of children nodes.
Definition: ogr_spatialref.h:88
const char * GetValue() const
Fetch value string for this node.
Definition: ogr_spatialref.h:102
int IsLeafNode() const
Return whether this is a leaf node.
Definition: ogr_spatialref.h:86
#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:997
Various convenience functions for working with strings and string lists.
void * OGRCoordinateTransformationH
Opaque type for a coordinate transformation object.
Definition: ogr_api.h:76
void * OGRSpatialReferenceH
Opaque type for a spatial reference system.
Definition: ogr_api.h:74
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:290
#define USGS_ANGLE_PACKEDDMS
Angle is in packed degree minute second.
Definition: ogr_spatialref.h:220
OGRCoordinateTransformation * OGRCreateCoordinateTransformation(const OGRSpatialReference *poSource, const OGRSpatialReference *poTarget)
Create transformation object.
Definition: ogrct.cpp:465
C spatial reference system services and defines.
OSRAxisMappingStrategy
Data axis to CRS axis mapping strategy.
Definition: ogr_srs_api.h:652
OGRAxisOrientation
Axis orientations (corresponds to CS_AxisOrientationEnum).
Definition: ogr_srs_api.h:48
Context for coordinate transformation.
Definition: ogr_spatialref.h:772
Listener that is notified of modification to nodes.
Definition: ogr_spatialref.h:71
virtual void notifyChange(OGR_SRSNode *)=0
Method triggered when a node is modified.

Generated for GDAL by doxygen 1.9.4.