GDAL

- Main Page
- Related Pages
- Classes
- Files
- Download
- Issue Tracker

- File List
- File Members

ogr_spatialref.h
Go to the documentation of this file.
1 /******************************************************************************
2 * $Id$
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
66 class 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);
78 ~OGR_SRSNode();
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
132 CPL_DISALLOW_COPY_ASSIGN(OGR_SRSNode)
133 };
134
135 /************************************************************************/
136 /* OGRSpatialReference */
137 /************************************************************************/
138
156 class CPL_DLL OGRSpatialReference
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:
171 OGRSpatialReference(const OGRSpatialReference&);
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
365 double GetSemiMajor( OGRErr * = nullptr ) const;
366 double GetSemiMinor( OGRErr * = nullptr ) const;
367 double GetInvFlattening( OGRErr * = nullptr ) const;
368 double GetEccentricity() const;
369 double GetSquaredEccentricity() const;
370
371 OGRErr SetAuthority( const char * pszTargetKey,
372 const char * pszAuthority,
373 int nCode );
374
375 OGRErr AutoIdentifyEPSG();
376 OGRSpatialReferenceH* FindMatches( char** papszOptions,
377 int* pnEntries,
378 int** ppanMatchConfidence ) const;
379
380 int GetEPSGGeogCS() const;
381
382 const char *GetAuthorityCode( const char * pszTargetKey ) const;
383 const char *GetAuthorityName( const char * pszTargetKey ) const;
384
385 bool GetAreaOfUse( double* pdfWestLongitudeDeg,
386 double* pdfSouthLatitudeDeg,
387 double* pdfEastLongitudeDeg,
388 double* pdfNorthLatitudeDeg,
389 const char **ppszAreaName ) const;
390
391 const char *GetExtension( const char *pszTargetKey,
392 const char *pszName,
393 const char *pszDefault = nullptr ) const;
394 OGRErr SetExtension( const char *pszTargetKey,
395 const char *pszName,
396 const char *pszValue );
397
398 int FindProjParm( const char *pszParameter,
399 const OGR_SRSNode *poPROJCS=nullptr ) const;
400 OGRErr SetProjParm( const char *, double );
401 double GetProjParm( const char *, double =0.0, OGRErr* = nullptr ) const;
402
403 OGRErr SetNormProjParm( const char *, double );
404 double GetNormProjParm( const char *, double=0.0, OGRErr* =nullptr)const;
405
406 static int IsAngularParameter( const char * );
407 static int IsLongitudeParameter( const char * );
408 static int IsLinearParameter( const char * );
409
411 OGRErr SetACEA( double dfStdP1, double dfStdP2,
412 double dfCenterLat, double dfCenterLong,
413 double dfFalseEasting, double dfFalseNorthing );
414
416 OGRErr SetAE( double dfCenterLat, double dfCenterLong,
417 double dfFalseEasting, double dfFalseNorthing );
418
420 OGRErr SetBonne( double dfStdP1, double dfCentralMeridian,
421 double dfFalseEasting, double dfFalseNorthing );
422
424 OGRErr SetCEA( double dfStdP1, double dfCentralMeridian,
425 double dfFalseEasting, double dfFalseNorthing );
426
428 OGRErr SetCS( double dfCenterLat, double dfCenterLong,
429 double dfFalseEasting, double dfFalseNorthing );
430
432 OGRErr SetEC( double dfStdP1, double dfStdP2,
433 double dfCenterLat, double dfCenterLong,
434 double dfFalseEasting, double dfFalseNorthing );
435
437 OGRErr SetEckert( int nVariation, double dfCentralMeridian,
438 double dfFalseEasting, double dfFalseNorthing );
439
441 OGRErr SetEckertIV( double dfCentralMeridian,
442 double dfFalseEasting, double dfFalseNorthing );
443
445 OGRErr SetEckertVI( double dfCentralMeridian,
446 double dfFalseEasting, double dfFalseNorthing );
447
449 OGRErr SetEquirectangular(double dfCenterLat, double dfCenterLong,
450 double dfFalseEasting, double dfFalseNorthing );
452 OGRErr SetEquirectangular2( double dfCenterLat, double dfCenterLong,
453 double dfPseudoStdParallel1,
454 double dfFalseEasting, double dfFalseNorthing );
455
457 OGRErr SetGEOS( double dfCentralMeridian, double dfSatelliteHeight,
458 double dfFalseEasting, double dfFalseNorthing );
459
461 OGRErr SetGH( double dfCentralMeridian,
462 double dfFalseEasting, double dfFalseNorthing );
463
465 OGRErr SetIGH();
466
468 OGRErr SetGS( double dfCentralMeridian,
469 double dfFalseEasting, double dfFalseNorthing );
470
472 OGRErr SetGaussSchreiberTMercator(double dfCenterLat, double dfCenterLong,
473 double dfScale,
474 double dfFalseEasting, double dfFalseNorthing );
475
477 OGRErr SetGnomonic(double dfCenterLat, double dfCenterLong,
478 double dfFalseEasting, double dfFalseNorthing );
479
481 OGRErr SetHOM( double dfCenterLat, double dfCenterLong,
482 double dfAzimuth, double dfRectToSkew,
483 double dfScale,
484 double dfFalseEasting, double dfFalseNorthing );
485
487 OGRErr SetHOM2PNO( double dfCenterLat,
488 double dfLat1, double dfLong1,
489 double dfLat2, double dfLong2,
490 double dfScale,
491 double dfFalseEasting, double dfFalseNorthing );
492
494 OGRErr SetHOMAC( double dfCenterLat, double dfCenterLong,
495 double dfAzimuth, double dfRectToSkew,
496 double dfScale,
497 double dfFalseEasting, double dfFalseNorthing );
498
500 OGRErr SetLOM( double dfCenterLat, double dfCenterLong,
501 double dfAzimuth,
502 double dfScale,
503 double dfFalseEasting, double dfFalseNorthing );
504
506 OGRErr SetIWMPolyconic( double dfLat1, double dfLat2,
507 double dfCenterLong,
508 double dfFalseEasting,
509 double dfFalseNorthing );
510
512 OGRErr SetKrovak( double dfCenterLat, double dfCenterLong,
513 double dfAzimuth, double dfPseudoStdParallelLat,
514 double dfScale,
515 double dfFalseEasting, double dfFalseNorthing );
516
518 OGRErr SetLAEA( double dfCenterLat, double dfCenterLong,
519 double dfFalseEasting, double dfFalseNorthing );
520
522 OGRErr SetLCC( double dfStdP1, double dfStdP2,
523 double dfCenterLat, double dfCenterLong,
524 double dfFalseEasting, double dfFalseNorthing );
525
527 OGRErr SetLCC1SP( double dfCenterLat, double dfCenterLong,
528 double dfScale,
529 double dfFalseEasting, double dfFalseNorthing );
530
532 OGRErr SetLCCB( double dfStdP1, double dfStdP2,
533 double dfCenterLat, double dfCenterLong,
534 double dfFalseEasting, double dfFalseNorthing );
535
537 OGRErr SetMC( double dfCenterLat, double dfCenterLong,
538 double dfFalseEasting, double dfFalseNorthing );
539
541 OGRErr SetMercator( double dfCenterLat, double dfCenterLong,
542 double dfScale,
543 double dfFalseEasting, double dfFalseNorthing );
544
546 OGRErr SetMercator2SP( double dfStdP1,
547 double dfCenterLat, double dfCenterLong,
548 double dfFalseEasting, double dfFalseNorthing );
549
551 OGRErr SetMollweide( double dfCentralMeridian,
552 double dfFalseEasting, double dfFalseNorthing );
553
555 OGRErr SetNZMG( double dfCenterLat, double dfCenterLong,
556 double dfFalseEasting, double dfFalseNorthing );
557
559 OGRErr SetOS( double dfOriginLat, double dfCMeridian,
560 double dfScale,
561 double dfFalseEasting,double dfFalseNorthing);
562
564 OGRErr SetOrthographic( double dfCenterLat, double dfCenterLong,
565 double dfFalseEasting,double dfFalseNorthing);
566
568 OGRErr SetPolyconic( double dfCenterLat, double dfCenterLong,
569 double dfFalseEasting, double dfFalseNorthing );
570
572 OGRErr SetPS( double dfCenterLat, double dfCenterLong,
573 double dfScale,
574 double dfFalseEasting, double dfFalseNorthing);
575
577 OGRErr SetRobinson( double dfCenterLong,
578 double dfFalseEasting, double dfFalseNorthing );
579
581 OGRErr SetSinusoidal( double dfCenterLong,
582 double dfFalseEasting, double dfFalseNorthing );
583
585 OGRErr SetStereographic( double dfCenterLat, double dfCenterLong,
586 double dfScale,
587 double dfFalseEasting,double dfFalseNorthing);
588
590 OGRErr SetSOC( double dfLatitudeOfOrigin, double dfCentralMeridian,
591 double dfFalseEasting, double dfFalseNorthing );
592
594 OGRErr SetTM( double dfCenterLat, double dfCenterLong,
595 double dfScale,
596 double dfFalseEasting, double dfFalseNorthing );
597
599 OGRErr SetTMVariant( const char *pszVariantName,
600 double dfCenterLat, double dfCenterLong,
601 double dfScale,
602 double dfFalseEasting, double dfFalseNorthing );
603
605 OGRErr SetTMG( double dfCenterLat, double dfCenterLong,
606 double dfFalseEasting, double dfFalseNorthing );
607
609 OGRErr SetTMSO( double dfCenterLat, double dfCenterLong,
610 double dfScale,
611 double dfFalseEasting, double dfFalseNorthing );
612
614 OGRErr SetTPED( double dfLat1, double dfLong1,
615 double dfLat2, double dfLong2,
616 double dfFalseEasting, double dfFalseNorthing );
617
619 OGRErr SetVDG( double dfCenterLong,
620 double dfFalseEasting, double dfFalseNorthing );
621
623 OGRErr SetUTM( int nZone, int bNorth = TRUE );
624 int GetUTMZone( int *pbNorth = nullptr ) const;
625
627 OGRErr SetWagner( int nVariation, double dfCenterLat,
628 double dfFalseEasting, double dfFalseNorthing );
629
631 OGRErr SetQSC(double dfCenterLat, double dfCenterLong);
632
634 OGRErr SetSCH( double dfPegLat, double dfPegLong,
635 double dfPegHeading, double dfPegHgt);
637 OGRErr SetStatePlane( int nZone, int bNAD83 = TRUE,
638 const char *pszOverrideUnitName = nullptr,
639 double dfOverrideUnit = 0.0 );
640
642 OGRErr ImportFromESRIStatePlaneWKT(
643 int nCode, const char* pszDatumName, const char* pszUnitsName,
644 int nPCSCode, const char* pszCRSName = nullptr );
645
647 OGRErr ImportFromESRIWisconsinWKT(
648 const char* pszPrjName, double dfCentralMeridian, double dfLatOfOrigin,
649 const char* pszUnitsName, const char* pszCRSName = nullptr );
650
651 static OGRSpatialReference* GetWGS84SRS();
652
656 static inline OGRSpatialReferenceH ToHandle(OGRSpatialReference* poSRS)
657 { return reinterpret_cast<OGRSpatialReferenceH>(poSRS); }
658
662 static inline OGRSpatialReference* FromHandle(OGRSpatialReferenceH hSRS)
663 { return reinterpret_cast<OGRSpatialReference*>(hSRS); }
664
665 };
666
667 /************************************************************************/
668 /* OGRCoordinateTransformation */
669 /* */
670 /* This is really just used as a base class for a private */
671 /* implementation. */
672 /************************************************************************/
673
683 class CPL_DLL OGRCoordinateTransformation
684 {
685 public:
686 virtual ~OGRCoordinateTransformation() {}
687
688 static void DestroyCT(OGRCoordinateTransformation* poCT);
689
690 // From CT_CoordinateTransformation
691
693 virtual OGRSpatialReference *GetSourceCS() = 0;
694
696 virtual OGRSpatialReference *GetTargetCS() = 0;
697
699 virtual bool GetEmitErrors() const { return false; }
700
702 virtual void SetEmitErrors(bool /*bEmitErrors*/) {}
703
704 // From CT_MathTransform
705
721 int Transform( int nCount,
722 double *x, double *y, double *z = nullptr,
723 int *pabSuccess = nullptr );
724
741 virtual int Transform( int nCount,
742 double *x, double *y,
743 double *z, double *t,
744 int *pabSuccess ) = 0;
745
749 static inline OGRCoordinateTransformationH ToHandle(OGRCoordinateTransformation* poCT)
750 { return reinterpret_cast<OGRCoordinateTransformationH>(poCT); }
751
755 static inline OGRCoordinateTransformation* FromHandle(OGRCoordinateTransformationH hCT)
756 { return reinterpret_cast<OGRCoordinateTransformation*>(hCT); }
757 };
758
759 OGRCoordinateTransformation CPL_DLL *
760 OGRCreateCoordinateTransformation( const OGRSpatialReference *poSource,
761 const OGRSpatialReference *poTarget );
762
763
770 struct CPL_DLL OGRCoordinateTransformationOptions
771 {
772 private:
773 friend class OGRProjCT;
774 struct Private;
775 std::unique_ptr<Private> d;
776
777 public:
778 OGRCoordinateTransformationOptions();
779 ~OGRCoordinateTransformationOptions();
780
781 bool SetAreaOfInterest(double dfWestLongitudeDeg,
782 double dfSouthLatitudeDeg,
783 double dfEastLongitudeDeg,
784 double dfNorthLatitudeDeg);
785
786 bool SetCoordinateOperation(const char* pszCT, bool bReverseCT);
787 };
788
789
790 OGRCoordinateTransformation CPL_DLL *
791 OGRCreateCoordinateTransformation( const OGRSpatialReference *poSource,
792 const OGRSpatialReference *poTarget,
793 const OGRCoordinateTransformationOptions& options );
794
795 #endif /* ndef OGR_SPATIALREF_H_INCLUDED */
OGRCoordinateTransformation::ToHandle
static OGRCoordinateTransformationH ToHandle(OGRCoordinateTransformation *poCT)
Convert a OGRCoordinateTransformation* to a OGRCoordinateTransformationH.
Definition: ogr_spatialref.h:749
OGRCoordinateTransformation::SetEmitErrors
virtual void SetEmitErrors(bool)
Set if the transformer must emit CPLError.
Definition: ogr_spatialref.h:702
OSRAxisMappingStrategy
OSRAxisMappingStrategy
Data axis to CRS axis mapping strategy.
Definition: ogr_srs_api.h:648
OGR_SRSNode::Listener
Listener that is notified of modification to nodes.
Definition: ogr_spatialref.h:70
OGR_SRSNode
Objects of this class are used to represent value nodes in the parsed representation of the WKT SRS f...
Definition: ogr_spatialref.h:66
OGR_SRSNode::IsLeafNode
int IsLeafNode() const
Return whether this is a leaf node.
Definition: ogr_spatialref.h:86
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:329
OGR_SRSNode::GetValue
const char * GetValue() const
Fetch value string for this node.
Definition: ogr_spatialref.h:102
OGRCoordinateTransformation::GetEmitErrors
virtual bool GetEmitErrors() const
Whether the transformer will emit CPLError.
Definition: ogr_spatialref.h:699
cpl_string.h
Various convenience functions for working with strings and string lists.
OGRCoordinateTransformationH
void * OGRCoordinateTransformationH
Opaque type for a coordinate transformation object.
Definition: ogr_api.h:76
USGS_ANGLE_PACKEDDMS
#define USGS_ANGLE_PACKEDDMS
Angle is in packed degree minute second.
Definition: ogr_spatialref.h:220
OGRSpatialReferenceH
void * OGRSpatialReferenceH
Opaque type for a spatial reference system.
Definition: ogr_api.h:74
ogr_srs_api.h
C spatial reference system services and defines.
OGRAxisOrientation
OGRAxisOrientation
Axis orientations (corresponds to CS_AxisOrientationEnum).
Definition: ogr_srs_api.h:48
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:156
OGRSpatialReference::ToHandle
static OGRSpatialReferenceH ToHandle(OGRSpatialReference *poSRS)
Convert a OGRSpatialReference* to a OGRSpatialReferenceH.
Definition: ogr_spatialref.h:656
OGRSpatialReference::FromHandle
static OGRSpatialReference * FromHandle(OGRSpatialReferenceH hSRS)
Convert a OGRSpatialReferenceH to a OGRSpatialReference*.
Definition: ogr_spatialref.h:662
OGRCoordinateTransformation::FromHandle
static OGRCoordinateTransformation * FromHandle(OGRCoordinateTransformationH hCT)
Convert a OGRCoordinateTransformationH to a OGRCoordinateTransformation*.
Definition: ogr_spatialref.h:755
OGRCoordinateTransformation
Interface for transforming between coordinate systems.
Definition: ogr_spatialref.h:683
OGRCreateCoordinateTransformation
OGRCoordinateTransformation * OGRCreateCoordinateTransformation(const OGRSpatialReference *poSource, const OGRSpatialReference *poTarget)
Create transformation object.
Definition: ogrct.cpp:409
OGRErr
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:290
OGR_SRSNode::GetChildCount
int GetChildCount() const
Get number of children nodes.
Definition: ogr_spatialref.h:88
OGRCoordinateTransformationOptions
Context for coordinate transformation.
Definition: ogr_spatialref.h:770
CPL_DISALLOW_COPY_ASSIGN
#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

Generated for GDAL by 1.8.8.