32 #ifndef OGR_SPATIALREF_H_INCLUDED 33 #define OGR_SPATIALREF_H_INCLUDED 74 int NeedsQuoting()
const;
75 OGRErr importFromWkt(
const char **,
int nRecLevel,
int* pnNodes );
97 int FindChild(
const char * )
const;
98 void DestroyChild(
int );
100 void StripNodes(
const char * );
103 void SetValue(
const char * );
105 void MakeValueSafe();
110 OGRErr importFromWkt(
char ** )
112 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**)")
115 OGRErr importFromWkt(
const char ** );
116 OGRErr exportToWkt(
char ** )
const;
117 OGRErr exportToPrettyWkt(
char **,
int = 1)
const;
119 OGRErr applyRemapper(
const char *pszNode,
120 const char *
const *papszSrcValues,
121 const char *
const *papszDstValues,
123 int bChildOfHit = FALSE );
149 mutable double dfFromGreenwich;
150 mutable double dfToMeter;
151 mutable double dfToDegrees;
156 mutable int bNormInfoSet;
164 static int IsAliasFor(
const char *,
const char * );
165 void GetNormInfo()
const;
167 OGRErr importFromURNPart(
const char* pszAuthority,
171 OGRErr importFromEPSGAInternal(
int nCode,
172 const char* pszSRSType);
174 static const std::vector<OGRSpatialReference*>* GetSRSCache(
175 const char* pszSRSType,
176 const std::map<CPLString, int>*& poMapESRICSNameToCodeOut);
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 *,
205 OGRErr exportToERM(
char *pszProj,
char *pszDatum,
char *pszUnits );
206 OGRErr exportToMICoordSys(
char ** )
const;
209 OGRErr importFromWkt(
char ** )
211 CPL_WARN_DEPRECATED(
"Use importFromWkt(const char**) or importFromWkt(const char*)")
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 );
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,
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 * );
246 const char* pszTargetProjection,
247 const char*
const* papszOptions =
nullptr )
const;
255 int EPSGTreatsAsLatLong()
const;
256 int EPSGTreatsAsNorthingEasting()
const;
257 const char *GetAxis(
const char *pszTargetKey,
int iAxis,
259 OGRErr SetAxes(
const char *pszTargetKey,
260 const char *pszXAxisName,
262 const char *pszYAxisName,
274 const OGR_SRSNode *GetAttrNode(
const char *)
const;
275 const char *GetAttrValue(
const char *,
int = 0)
const;
277 OGRErr SetNode(
const char *,
const char * );
278 OGRErr SetNode(
const char *,
double );
280 OGRErr SetLinearUnitsAndUpdateParameters(
const char *pszName,
282 OGRErr SetLinearUnits(
const char *pszName,
double dfInMeters );
283 OGRErr SetTargetLinearUnits(
const char *pszTargetKey,
284 const char *pszName,
double dfInMeters );
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;
322 int IsVertical()
const;
323 int IsCompound()
const;
326 const char*
const * papszOptions )
const;
330 const char*
const * papszOptions )
const;
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 * );
347 OGRErr SetVertCS(
const char *pszVertCSName,
348 const char *pszVertDatumName,
349 int nVertDatumClass = 2005 );
350 OGRErr SetCompoundCS(
const char *pszName,
354 OGRErr SetFromUserInput(
const char * );
356 OGRErr SetTOWGS84(
double,
double,
double,
357 double = 0.0,
double = 0.0,
double = 0.0,
359 OGRErr GetTOWGS84(
double *padfCoef,
int nCoeff = 7 )
const;
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;
367 OGRErr SetAuthority(
const char * pszTargetKey,
368 const char * pszAuthority,
371 OGRErr AutoIdentifyEPSG();
374 int** ppanMatchConfidence )
const;
376 int GetEPSGGeogCS()
const;
378 const char *GetAuthorityCode(
const char * pszTargetKey )
const;
379 const char *GetAuthorityName(
const char * pszTargetKey )
const;
381 const char *GetExtension(
const char *pszTargetKey,
383 const char *pszDefault =
nullptr )
const;
384 OGRErr SetExtension(
const char *pszTargetKey,
386 const char *pszValue );
388 int FindProjParm(
const char *pszParameter,
390 OGRErr SetProjParm(
const char *,
double );
391 double GetProjParm(
const char *,
double =0.0,
OGRErr* =
nullptr )
const;
393 OGRErr SetNormProjParm(
const char *,
double );
394 double GetNormProjParm(
const char *,
double=0.0,
OGRErr* =
nullptr)
const;
396 static int IsAngularParameter(
const char * );
397 static int IsLongitudeParameter(
const char * );
398 static int IsLinearParameter(
const char * );
401 OGRErr SetACEA(
double dfStdP1,
double dfStdP2,
402 double dfCenterLat,
double dfCenterLong,
403 double dfFalseEasting,
double dfFalseNorthing );
406 OGRErr SetAE(
double dfCenterLat,
double dfCenterLong,
407 double dfFalseEasting,
double dfFalseNorthing );
410 OGRErr SetBonne(
double dfStdP1,
double dfCentralMeridian,
411 double dfFalseEasting,
double dfFalseNorthing );
414 OGRErr SetCEA(
double dfStdP1,
double dfCentralMeridian,
415 double dfFalseEasting,
double dfFalseNorthing );
418 OGRErr SetCS(
double dfCenterLat,
double dfCenterLong,
419 double dfFalseEasting,
double dfFalseNorthing );
422 OGRErr SetEC(
double dfStdP1,
double dfStdP2,
423 double dfCenterLat,
double dfCenterLong,
424 double dfFalseEasting,
double dfFalseNorthing );
427 OGRErr SetEckert(
int nVariation,
double dfCentralMeridian,
428 double dfFalseEasting,
double dfFalseNorthing );
431 OGRErr SetEckertIV(
double dfCentralMeridian,
432 double dfFalseEasting,
double dfFalseNorthing );
435 OGRErr SetEckertVI(
double dfCentralMeridian,
436 double dfFalseEasting,
double dfFalseNorthing );
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 );
447 OGRErr SetGEOS(
double dfCentralMeridian,
double dfSatelliteHeight,
448 double dfFalseEasting,
double dfFalseNorthing );
451 OGRErr SetGH(
double dfCentralMeridian,
452 double dfFalseEasting,
double dfFalseNorthing );
458 OGRErr SetGS(
double dfCentralMeridian,
459 double dfFalseEasting,
double dfFalseNorthing );
462 OGRErr SetGaussSchreiberTMercator(
double dfCenterLat,
double dfCenterLong,
464 double dfFalseEasting,
double dfFalseNorthing );
467 OGRErr SetGnomonic(
double dfCenterLat,
double dfCenterLong,
468 double dfFalseEasting,
double dfFalseNorthing );
471 OGRErr SetHOM(
double dfCenterLat,
double dfCenterLong,
472 double dfAzimuth,
double dfRectToSkew,
474 double dfFalseEasting,
double dfFalseNorthing );
477 OGRErr SetHOM2PNO(
double dfCenterLat,
478 double dfLat1,
double dfLong1,
479 double dfLat2,
double dfLong2,
481 double dfFalseEasting,
double dfFalseNorthing );
485 OGRErr SetOM(
double dfCenterLat,
double dfCenterLong,
486 double dfAzimuth,
double dfRectToSkew,
488 double dfFalseEasting,
double dfFalseNorthing );
492 OGRErr SetHOMAC(
double dfCenterLat,
double dfCenterLong,
493 double dfAzimuth,
double dfRectToSkew,
495 double dfFalseEasting,
double dfFalseNorthing );
498 OGRErr SetIWMPolyconic(
double dfLat1,
double dfLat2,
500 double dfFalseEasting,
501 double dfFalseNorthing );
504 OGRErr SetKrovak(
double dfCenterLat,
double dfCenterLong,
505 double dfAzimuth,
double dfPseudoStdParallelLat,
507 double dfFalseEasting,
double dfFalseNorthing );
510 OGRErr SetLAEA(
double dfCenterLat,
double dfCenterLong,
511 double dfFalseEasting,
double dfFalseNorthing );
514 OGRErr SetLCC(
double dfStdP1,
double dfStdP2,
515 double dfCenterLat,
double dfCenterLong,
516 double dfFalseEasting,
double dfFalseNorthing );
519 OGRErr SetLCC1SP(
double dfCenterLat,
double dfCenterLong,
521 double dfFalseEasting,
double dfFalseNorthing );
524 OGRErr SetLCCB(
double dfStdP1,
double dfStdP2,
525 double dfCenterLat,
double dfCenterLong,
526 double dfFalseEasting,
double dfFalseNorthing );
529 OGRErr SetMC(
double dfCenterLat,
double dfCenterLong,
530 double dfFalseEasting,
double dfFalseNorthing );
533 OGRErr SetMercator(
double dfCenterLat,
double dfCenterLong,
535 double dfFalseEasting,
double dfFalseNorthing );
538 OGRErr SetMercator2SP(
double dfStdP1,
539 double dfCenterLat,
double dfCenterLong,
540 double dfFalseEasting,
double dfFalseNorthing );
543 OGRErr SetMollweide(
double dfCentralMeridian,
544 double dfFalseEasting,
double dfFalseNorthing );
547 OGRErr SetNZMG(
double dfCenterLat,
double dfCenterLong,
548 double dfFalseEasting,
double dfFalseNorthing );
551 OGRErr SetOS(
double dfOriginLat,
double dfCMeridian,
553 double dfFalseEasting,
double dfFalseNorthing);
556 OGRErr SetOrthographic(
double dfCenterLat,
double dfCenterLong,
557 double dfFalseEasting,
double dfFalseNorthing);
560 OGRErr SetPolyconic(
double dfCenterLat,
double dfCenterLong,
561 double dfFalseEasting,
double dfFalseNorthing );
564 OGRErr SetPS(
double dfCenterLat,
double dfCenterLong,
566 double dfFalseEasting,
double dfFalseNorthing);
569 OGRErr SetRobinson(
double dfCenterLong,
570 double dfFalseEasting,
double dfFalseNorthing );
573 OGRErr SetSinusoidal(
double dfCenterLong,
574 double dfFalseEasting,
double dfFalseNorthing );
577 OGRErr SetStereographic(
double dfCenterLat,
double dfCenterLong,
579 double dfFalseEasting,
double dfFalseNorthing);
582 OGRErr SetSOC(
double dfLatitudeOfOrigin,
double dfCentralMeridian,
583 double dfFalseEasting,
double dfFalseNorthing );
586 OGRErr SetTM(
double dfCenterLat,
double dfCenterLong,
588 double dfFalseEasting,
double dfFalseNorthing );
591 OGRErr SetTMVariant(
const char *pszVariantName,
592 double dfCenterLat,
double dfCenterLong,
594 double dfFalseEasting,
double dfFalseNorthing );
597 OGRErr SetTMG(
double dfCenterLat,
double dfCenterLong,
598 double dfFalseEasting,
double dfFalseNorthing );
601 OGRErr SetTMSO(
double dfCenterLat,
double dfCenterLong,
603 double dfFalseEasting,
double dfFalseNorthing );
606 OGRErr SetTPED(
double dfLat1,
double dfLong1,
607 double dfLat2,
double dfLong2,
608 double dfFalseEasting,
double dfFalseNorthing );
611 OGRErr SetVDG(
double dfCenterLong,
612 double dfFalseEasting,
double dfFalseNorthing );
615 OGRErr SetUTM(
int nZone,
int bNorth = TRUE );
616 int GetUTMZone(
int *pbNorth =
nullptr )
const;
619 OGRErr SetWagner(
int nVariation,
double dfCenterLat,
620 double dfFalseEasting,
double dfFalseNorthing );
623 OGRErr SetQSC(
double dfCenterLat,
double dfCenterLong);
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 );
634 OGRErr ImportFromESRIStatePlaneWKT(
635 int nCode,
const char* pszDatumName,
const char* pszUnitsName,
636 int nPCSCode,
const char* pszCSName =
nullptr );
639 OGRErr ImportFromESRIWisconsinWKT(
640 const char* pszPrjName,
double dfCentralMeridian,
double dfLatOfOrigin,
641 const char* pszUnitsName,
const char* pszCSName =
nullptr );
713 virtual int Transform(
int nCount,
714 double *x,
double *y,
double *z =
nullptr ) = 0;
731 virtual int TransformEx(
int nCount,
732 double *x,
double *y,
double *z =
nullptr,
733 int *pabSuccess =
nullptr ) = 0;
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
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
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
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