32 #ifndef OGR_SPATIALREF_H_INCLUDED
33 #define OGR_SPATIALREF_H_INCLUDED
73 int NeedsQuoting()
const;
74 OGRErr importFromWkt(
char **,
int nRecLevel,
int* pnNodes );
94 int FindChild(
const char * )
const;
95 void DestroyChild(
int );
97 void StripNodes(
const char * );
99 const char *
GetValue()
const {
return pszValue; }
100 void SetValue(
const char * );
102 void MakeValueSafe();
107 OGRErr importFromWkt(
char ** );
108 OGRErr exportToWkt(
char ** )
const;
109 OGRErr exportToPrettyWkt(
char **,
int = 1)
const;
111 OGRErr applyRemapper(
const char *pszNode,
112 char **papszSrcValues,
113 char **papszDstValues,
115 int bChildOfHit = FALSE );
141 double dfFromGreenwich;
156 static int IsAliasFor(
const char *,
const char * );
157 void GetNormInfo()
const;
159 OGRErr importFromURNPart(
const char* pszAuthority,
163 OGRErr importFromEPSGAInternal(
int nCode,
164 const char* pszSRSType);
166 static const std::vector<OGRSpatialReference*>* GetSRSCache(
167 const char* pszSRSType,
168 const std::map<CPLString, int>*& poMapESRICSNameToCodeOut);
189 OGRErr exportToWkt(
char ** )
const;
190 OGRErr exportToPrettyWkt(
char **,
int = FALSE)
const;
191 OGRErr exportToProj4(
char ** )
const;
192 OGRErr exportToPCI(
char **,
char **,
double ** )
const;
193 OGRErr exportToUSGS(
long *,
long *,
double **,
long * )
const;
194 OGRErr exportToXML(
char **,
const char * =
nullptr )
const;
195 OGRErr exportToPanorama(
long *,
long *,
long *,
long *,
197 OGRErr exportToERM(
char *pszProj,
char *pszDatum,
char *pszUnits );
198 OGRErr exportToMICoordSys(
char ** )
const;
200 OGRErr importFromWkt(
char ** );
201 OGRErr importFromWkt(
const char* );
202 OGRErr importFromProj4(
const char * );
203 OGRErr importFromEPSG(
int );
204 OGRErr importFromEPSGA(
int );
205 OGRErr importFromESRI(
char ** );
206 OGRErr importFromPCI(
const char *,
const char * =
nullptr,
207 double * =
nullptr );
209 #define USGS_ANGLE_DECIMALDEGREES 0
210 #define USGS_ANGLE_PACKEDDMS TRUE
211 #define USGS_ANGLE_RADIANS 2
212 OGRErr importFromUSGS( long iProjSys, long iZone,
213 double *padfPrjParams,
long iDatum,
215 OGRErr importFromPanorama(
long,
long,
long,
double* );
216 OGRErr importFromOzi(
const char *
const* papszLines );
217 OGRErr importFromWMSAUTO(
const char *pszAutoDef );
218 OGRErr importFromXML(
const char * );
219 OGRErr importFromDict(
const char *pszDict,
const char *pszCode );
220 OGRErr importFromURN(
const char * );
221 OGRErr importFromCRSURL(
const char * );
222 OGRErr importFromERM(
const char *pszProj,
const char *pszDatum,
223 const char *pszUnits );
224 OGRErr importFromUrl(
const char * );
225 OGRErr importFromMICoordSys(
const char * );
231 const char* pszTargetProjection,
232 const char*
const* papszOptions =
nullptr )
const;
240 int EPSGTreatsAsLatLong();
241 int EPSGTreatsAsNorthingEasting();
242 const char *GetAxis(
const char *pszTargetKey,
int iAxis,
244 OGRErr SetAxes(
const char *pszTargetKey,
245 const char *pszXAxisName,
247 const char *pszYAxisName,
259 const OGR_SRSNode *GetAttrNode(
const char *)
const;
260 const char *GetAttrValue(
const char *,
int = 0)
const;
262 OGRErr SetNode(
const char *,
const char * );
263 OGRErr SetNode(
const char *,
double );
265 OGRErr SetLinearUnitsAndUpdateParameters(
const char *pszName,
267 OGRErr SetLinearUnits(
const char *pszName,
double dfInMeters );
268 OGRErr SetTargetLinearUnits(
const char *pszTargetKey,
269 const char *pszName,
double dfInMeters );
270 double GetLinearUnits(
char ** =
nullptr )
const;
271 double GetTargetLinearUnits(
const char *pszTargetKey,
272 char ** ppszRetName =
nullptr )
const;
274 OGRErr SetAngularUnits(
const char *pszName,
double dfInRadians );
275 double GetAngularUnits(
char ** =
nullptr )
const;
277 double GetPrimeMeridian(
char ** =
nullptr )
const;
279 int IsGeographic()
const;
280 int IsProjected()
const;
281 int IsGeocentric()
const;
283 int IsVertical()
const;
284 int IsCompound()
const;
287 const char*
const * papszOptions )
const;
291 const char*
const * papszOptions )
const;
294 OGRErr SetLocalCS(
const char * );
295 OGRErr SetProjCS(
const char * );
296 OGRErr SetProjection(
const char * );
297 OGRErr SetGeocCS(
const char * pszGeocName );
298 OGRErr SetGeogCS(
const char * pszGeogName,
299 const char * pszDatumName,
300 const char * pszEllipsoidName,
301 double dfSemiMajor,
double dfInvFlattening,
302 const char * pszPMName =
nullptr,
303 double dfPMOffset = 0.0,
304 const char * pszUnits =
nullptr,
305 double dfConvertToRadians = 0.0 );
306 OGRErr SetWellKnownGeogCS(
const char * );
308 OGRErr SetVertCS(
const char *pszVertCSName,
309 const char *pszVertDatumName,
310 int nVertDatumClass = 2005 );
311 OGRErr SetCompoundCS(
const char *pszName,
315 OGRErr SetFromUserInput(
const char * );
317 OGRErr SetTOWGS84(
double,
double,
double,
318 double = 0.0,
double = 0.0,
double = 0.0,
320 OGRErr GetTOWGS84(
double *padfCoef,
int nCoeff = 7 )
const;
322 double GetSemiMajor(
OGRErr * =
nullptr )
const;
323 double GetSemiMinor(
OGRErr * =
nullptr )
const;
324 double GetInvFlattening(
OGRErr * =
nullptr )
const;
325 double GetEccentricity()
const;
326 double GetSquaredEccentricity()
const;
328 OGRErr SetAuthority(
const char * pszTargetKey,
329 const char * pszAuthority,
332 OGRErr AutoIdentifyEPSG();
335 int** ppanMatchConfidence )
const;
339 const char *GetAuthorityCode(
const char * pszTargetKey )
const;
340 const char *GetAuthorityName(
const char * pszTargetKey )
const;
342 const char *GetExtension(
const char *pszTargetKey,
344 const char *pszDefault =
nullptr )
const;
345 OGRErr SetExtension(
const char *pszTargetKey,
347 const char *pszValue );
349 int FindProjParm(
const char *pszParameter,
351 OGRErr SetProjParm(
const char *,
double );
352 double GetProjParm(
const char *,
double =0.0,
OGRErr* =
nullptr )
const;
354 OGRErr SetNormProjParm(
const char *,
double );
355 double GetNormProjParm(
const char *,
double=0.0,
OGRErr* =
nullptr)
const;
357 static int IsAngularParameter(
const char * );
358 static int IsLongitudeParameter(
const char * );
359 static int IsLinearParameter(
const char * );
362 OGRErr SetACEA(
double dfStdP1,
double dfStdP2,
363 double dfCenterLat,
double dfCenterLong,
364 double dfFalseEasting,
double dfFalseNorthing );
367 OGRErr SetAE(
double dfCenterLat,
double dfCenterLong,
368 double dfFalseEasting,
double dfFalseNorthing );
371 OGRErr SetBonne(
double dfStdP1,
double dfCentralMeridian,
372 double dfFalseEasting,
double dfFalseNorthing );
375 OGRErr SetCEA(
double dfStdP1,
double dfCentralMeridian,
376 double dfFalseEasting,
double dfFalseNorthing );
379 OGRErr SetCS(
double dfCenterLat,
double dfCenterLong,
380 double dfFalseEasting,
double dfFalseNorthing );
383 OGRErr SetEC(
double dfStdP1,
double dfStdP2,
384 double dfCenterLat,
double dfCenterLong,
385 double dfFalseEasting,
double dfFalseNorthing );
388 OGRErr SetEckert(
int nVariation,
double dfCentralMeridian,
389 double dfFalseEasting,
double dfFalseNorthing );
392 OGRErr SetEckertIV(
double dfCentralMeridian,
393 double dfFalseEasting,
double dfFalseNorthing );
396 OGRErr SetEckertVI(
double dfCentralMeridian,
397 double dfFalseEasting,
double dfFalseNorthing );
400 OGRErr SetEquirectangular(
double dfCenterLat,
double dfCenterLong,
401 double dfFalseEasting,
double dfFalseNorthing );
403 OGRErr SetEquirectangular2(
double dfCenterLat,
double dfCenterLong,
404 double dfPseudoStdParallel1,
405 double dfFalseEasting,
double dfFalseNorthing );
408 OGRErr SetGEOS(
double dfCentralMeridian,
double dfSatelliteHeight,
409 double dfFalseEasting,
double dfFalseNorthing );
412 OGRErr SetGH(
double dfCentralMeridian,
413 double dfFalseEasting,
double dfFalseNorthing );
419 OGRErr SetGS(
double dfCentralMeridian,
420 double dfFalseEasting,
double dfFalseNorthing );
423 OGRErr SetGaussSchreiberTMercator(
double dfCenterLat,
double dfCenterLong,
425 double dfFalseEasting,
double dfFalseNorthing );
428 OGRErr SetGnomonic(
double dfCenterLat,
double dfCenterLong,
429 double dfFalseEasting,
double dfFalseNorthing );
432 OGRErr SetHOM(
double dfCenterLat,
double dfCenterLong,
433 double dfAzimuth,
double dfRectToSkew,
435 double dfFalseEasting,
double dfFalseNorthing );
438 OGRErr SetHOM2PNO(
double dfCenterLat,
439 double dfLat1,
double dfLong1,
440 double dfLat2,
double dfLong2,
442 double dfFalseEasting,
double dfFalseNorthing );
446 OGRErr SetOM(
double dfCenterLat,
double dfCenterLong,
447 double dfAzimuth,
double dfRectToSkew,
449 double dfFalseEasting,
double dfFalseNorthing );
453 OGRErr SetHOMAC(
double dfCenterLat,
double dfCenterLong,
454 double dfAzimuth,
double dfRectToSkew,
456 double dfFalseEasting,
double dfFalseNorthing );
459 OGRErr SetIWMPolyconic(
double dfLat1,
double dfLat2,
461 double dfFalseEasting,
462 double dfFalseNorthing );
465 OGRErr SetKrovak(
double dfCenterLat,
double dfCenterLong,
466 double dfAzimuth,
double dfPseudoStdParallelLat,
468 double dfFalseEasting,
double dfFalseNorthing );
471 OGRErr SetLAEA(
double dfCenterLat,
double dfCenterLong,
472 double dfFalseEasting,
double dfFalseNorthing );
475 OGRErr SetLCC(
double dfStdP1,
double dfStdP2,
476 double dfCenterLat,
double dfCenterLong,
477 double dfFalseEasting,
double dfFalseNorthing );
480 OGRErr SetLCC1SP(
double dfCenterLat,
double dfCenterLong,
482 double dfFalseEasting,
double dfFalseNorthing );
485 OGRErr SetLCCB(
double dfStdP1,
double dfStdP2,
486 double dfCenterLat,
double dfCenterLong,
487 double dfFalseEasting,
double dfFalseNorthing );
490 OGRErr SetMC(
double dfCenterLat,
double dfCenterLong,
491 double dfFalseEasting,
double dfFalseNorthing );
494 OGRErr SetMercator(
double dfCenterLat,
double dfCenterLong,
496 double dfFalseEasting,
double dfFalseNorthing );
499 OGRErr SetMercator2SP(
double dfStdP1,
500 double dfCenterLat,
double dfCenterLong,
501 double dfFalseEasting,
double dfFalseNorthing );
504 OGRErr SetMollweide(
double dfCentralMeridian,
505 double dfFalseEasting,
double dfFalseNorthing );
508 OGRErr SetNZMG(
double dfCenterLat,
double dfCenterLong,
509 double dfFalseEasting,
double dfFalseNorthing );
512 OGRErr SetOS(
double dfOriginLat,
double dfCMeridian,
514 double dfFalseEasting,
double dfFalseNorthing);
517 OGRErr SetOrthographic(
double dfCenterLat,
double dfCenterLong,
518 double dfFalseEasting,
double dfFalseNorthing);
521 OGRErr SetPolyconic(
double dfCenterLat,
double dfCenterLong,
522 double dfFalseEasting,
double dfFalseNorthing );
525 OGRErr SetPS(
double dfCenterLat,
double dfCenterLong,
527 double dfFalseEasting,
double dfFalseNorthing);
530 OGRErr SetRobinson(
double dfCenterLong,
531 double dfFalseEasting,
double dfFalseNorthing );
534 OGRErr SetSinusoidal(
double dfCenterLong,
535 double dfFalseEasting,
double dfFalseNorthing );
538 OGRErr SetStereographic(
double dfCenterLat,
double dfCenterLong,
540 double dfFalseEasting,
double dfFalseNorthing);
543 OGRErr SetSOC(
double dfLatitudeOfOrigin,
double dfCentralMeridian,
544 double dfFalseEasting,
double dfFalseNorthing );
547 OGRErr SetTM(
double dfCenterLat,
double dfCenterLong,
549 double dfFalseEasting,
double dfFalseNorthing );
552 OGRErr SetTMVariant(
const char *pszVariantName,
553 double dfCenterLat,
double dfCenterLong,
555 double dfFalseEasting,
double dfFalseNorthing );
558 OGRErr SetTMG(
double dfCenterLat,
double dfCenterLong,
559 double dfFalseEasting,
double dfFalseNorthing );
562 OGRErr SetTMSO(
double dfCenterLat,
double dfCenterLong,
564 double dfFalseEasting,
double dfFalseNorthing );
567 OGRErr SetTPED(
double dfLat1,
double dfLong1,
568 double dfLat2,
double dfLong2,
569 double dfFalseEasting,
double dfFalseNorthing );
572 OGRErr SetVDG(
double dfCenterLong,
573 double dfFalseEasting,
double dfFalseNorthing );
576 OGRErr SetUTM(
int nZone,
int bNorth = TRUE );
577 int GetUTMZone(
int *pbNorth =
nullptr )
const;
580 OGRErr SetWagner(
int nVariation,
double dfCenterLat,
581 double dfFalseEasting,
double dfFalseNorthing );
584 OGRErr SetQSC(
double dfCenterLat,
double dfCenterLong);
587 OGRErr SetSCH(
double dfPegLat,
double dfPegLong,
588 double dfPegHeading,
double dfPegHgt);
590 OGRErr SetStatePlane(
int nZone,
int bNAD83 = TRUE,
591 const char *pszOverrideUnitName =
nullptr,
592 double dfOverrideUnit = 0.0 );
595 OGRErr ImportFromESRIStatePlaneWKT(
596 int nCode,
const char* pszDatumName,
const char* pszUnitsName,
597 int nPCSCode,
const char* pszCSName =
nullptr );
600 OGRErr ImportFromESRIWisconsinWKT(
601 const char* pszPrjName,
double dfCentralMeridian,
double dfLatOfOrigin,
602 const char* pszUnitsName,
const char* pszCSName =
nullptr );
674 virtual int Transform(
int nCount,
675 double *x,
double *y,
double *z =
nullptr ) = 0;
692 virtual int TransformEx(
int nCount,
693 double *x,
double *y,
double *z =
nullptr,
694 int *pabSuccess =
nullptr ) = 0;
OGRCoordinateTransformation * OGRCreateCoordinateTransformation(OGRSpatialReference *poSource, OGRSpatialReference *poTarget)
Create transformation object.
Definition: ogrct.cpp:493
Objects of this class are used to represent value nodes in the parsed representation of the WKT SRS f...
Definition: ogr_spatialref.h:64
int IsLeafNode() const
Return whether this is a leaf node.
Definition: ogr_spatialref.h:83
const char * GetValue() const
Fetch value string for this node.
Definition: ogr_spatialref.h:99
Various convenience functions for working with strings and string lists.
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:210
OGR_SRSNode * GetRoot()
Return root node.
Definition: ogr_spatialref.h:253
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:139
static OGRSpatialReferenceH ToHandle(OGRSpatialReference *poSRS)
Convert a OGRSpatialReference* to a OGRSpatialReferenceH.
Definition: ogr_spatialref.h:609
static OGRSpatialReference * FromHandle(OGRSpatialReferenceH hSRS)
Convert a OGRSpatialReferenceH to a OGRSpatialReference*.
Definition: ogr_spatialref.h:615
int GetReferenceCount() const
Fetch current reference count.
Definition: ogr_spatialref.h:182
const OGR_SRSNode * GetRoot() const
Return root node.
Definition: ogr_spatialref.h:255
int OGRErr
Simple container for a bounding region.
Definition: ogr_core.h:290
int GetChildCount() const
Get number of children nodes.
Definition: ogr_spatialref.h:85