32 #ifndef OGR_SPATIALREF_H_INCLUDED
33 #define OGR_SPATIALREF_H_INCLUDED
69 int NeedsQuoting()
const;
70 OGRErr importFromWkt(
char **,
int nRecLevel,
int* pnNodes );
90 int FindChild(
const char * )
const;
91 void DestroyChild(
int );
93 void StripNodes(
const char * );
95 const char *
GetValue()
const {
return pszValue; }
96 void SetValue(
const char * );
103 OGRErr importFromWkt(
char ** );
104 OGRErr exportToWkt(
char ** )
const;
105 OGRErr exportToPrettyWkt(
char **,
int = 1)
const;
107 OGRErr applyRemapper(
const char *pszNode,
108 char **papszSrcValues,
109 char **papszDstValues,
111 int bChildOfHit = FALSE );
134 double dfFromGreenwich;
149 static int IsAliasFor(
const char *,
const char * );
150 void GetNormInfo()
const;
152 OGRErr importFromURNPart(
const char* pszAuthority,
174 OGRErr exportToWkt(
char ** )
const;
175 OGRErr exportToPrettyWkt(
char **,
int = FALSE)
const;
176 OGRErr exportToProj4(
char ** )
const;
177 OGRErr exportToPCI(
char **,
char **,
double ** )
const;
178 OGRErr exportToUSGS(
long *,
long *,
double **,
long * )
const;
179 OGRErr exportToXML(
char **,
const char * = NULL )
const;
180 OGRErr exportToPanorama(
long *,
long *,
long *,
long *,
182 OGRErr exportToERM(
char *pszProj,
char *pszDatum,
char *pszUnits );
183 OGRErr exportToMICoordSys(
char ** )
const;
185 OGRErr importFromWkt(
char ** );
186 OGRErr importFromProj4(
const char * );
187 OGRErr importFromEPSG(
int );
188 OGRErr importFromEPSGA(
int );
189 OGRErr importFromESRI(
char ** );
190 OGRErr importFromPCI(
const char *,
const char * = NULL,
193 #define USGS_ANGLE_DECIMALDEGREES 0
194 #define USGS_ANGLE_PACKEDDMS TRUE
195 #define USGS_ANGLE_RADIANS 2
196 OGRErr importFromUSGS( long iProjSys, long iZone,
197 double *padfPrjParams,
long iDatum,
199 OGRErr importFromPanorama(
long,
long,
long,
double* );
200 OGRErr importFromOzi(
const char *
const* papszLines );
201 OGRErr importFromWMSAUTO(
const char *pszAutoDef );
202 OGRErr importFromXML(
const char * );
203 OGRErr importFromDict(
const char *pszDict,
const char *pszCode );
204 OGRErr importFromURN(
const char * );
205 OGRErr importFromCRSURL(
const char * );
206 OGRErr importFromERM(
const char *pszProj,
const char *pszDatum,
207 const char *pszUnits );
208 OGRErr importFromUrl(
const char * );
209 OGRErr importFromMICoordSys(
const char * );
220 int EPSGTreatsAsLatLong();
221 int EPSGTreatsAsNorthingEasting();
222 const char *GetAxis(
const char *pszTargetKey,
int iAxis,
224 OGRErr SetAxes(
const char *pszTargetKey,
225 const char *pszXAxisName,
227 const char *pszYAxisName,
239 const OGR_SRSNode *GetAttrNode(
const char *)
const;
240 const char *GetAttrValue(
const char *,
int = 0)
const;
242 OGRErr SetNode(
const char *,
const char * );
243 OGRErr SetNode(
const char *,
double );
245 OGRErr SetLinearUnitsAndUpdateParameters(
const char *pszName,
247 OGRErr SetLinearUnits(
const char *pszName,
double dfInMeters );
248 OGRErr SetTargetLinearUnits(
const char *pszTargetKey,
249 const char *pszName,
double dfInMeters );
250 double GetLinearUnits(
char ** = NULL )
const;
251 double GetTargetLinearUnits(
const char *pszTargetKey,
252 char ** ppszRetName = NULL )
const;
254 OGRErr SetAngularUnits(
const char *pszName,
double dfInRadians );
255 double GetAngularUnits(
char ** = NULL )
const;
257 double GetPrimeMeridian(
char ** = NULL )
const;
259 int IsGeographic()
const;
260 int IsProjected()
const;
261 int IsGeocentric()
const;
263 int IsVertical()
const;
264 int IsCompound()
const;
270 OGRErr SetLocalCS(
const char * );
271 OGRErr SetProjCS(
const char * );
272 OGRErr SetProjection(
const char * );
273 OGRErr SetGeocCS(
const char * pszGeocName );
274 OGRErr SetGeogCS(
const char * pszGeogName,
275 const char * pszDatumName,
276 const char * pszEllipsoidName,
277 double dfSemiMajor,
double dfInvFlattening,
278 const char * pszPMName = NULL,
279 double dfPMOffset = 0.0,
280 const char * pszUnits = NULL,
281 double dfConvertToRadians = 0.0 );
282 OGRErr SetWellKnownGeogCS(
const char * );
284 OGRErr SetVertCS(
const char *pszVertCSName,
285 const char *pszVertDatumName,
286 int nVertDatumClass = 2005 );
287 OGRErr SetCompoundCS(
const char *pszName,
291 OGRErr SetFromUserInput(
const char * );
293 OGRErr SetTOWGS84(
double,
double,
double,
294 double = 0.0,
double = 0.0,
double = 0.0,
296 OGRErr GetTOWGS84(
double *padfCoef,
int nCoeff = 7 )
const;
298 double GetSemiMajor(
OGRErr * = NULL )
const;
299 double GetSemiMinor(
OGRErr * = NULL )
const;
300 double GetInvFlattening(
OGRErr * = NULL )
const;
302 OGRErr SetAuthority(
const char * pszTargetKey,
303 const char * pszAuthority,
306 OGRErr AutoIdentifyEPSG();
309 const char *GetAuthorityCode(
const char * pszTargetKey )
const;
310 const char *GetAuthorityName(
const char * pszTargetKey )
const;
312 const char *GetExtension(
const char *pszTargetKey,
314 const char *pszDefault = NULL )
const;
315 OGRErr SetExtension(
const char *pszTargetKey,
317 const char *pszValue );
319 int FindProjParm(
const char *pszParameter,
321 OGRErr SetProjParm(
const char *,
double );
322 double GetProjParm(
const char *,
double =0.0,
OGRErr* = NULL )
const;
324 OGRErr SetNormProjParm(
const char *,
double );
325 double GetNormProjParm(
const char *,
double=0.0,
OGRErr* =NULL)
const;
327 static int IsAngularParameter(
const char * );
328 static int IsLongitudeParameter(
const char * );
329 static int IsLinearParameter(
const char * );
332 OGRErr SetACEA(
double dfStdP1,
double dfStdP2,
333 double dfCenterLat,
double dfCenterLong,
334 double dfFalseEasting,
double dfFalseNorthing );
337 OGRErr SetAE(
double dfCenterLat,
double dfCenterLong,
338 double dfFalseEasting,
double dfFalseNorthing );
341 OGRErr SetBonne(
double dfStdP1,
double dfCentralMeridian,
342 double dfFalseEasting,
double dfFalseNorthing );
345 OGRErr SetCEA(
double dfStdP1,
double dfCentralMeridian,
346 double dfFalseEasting,
double dfFalseNorthing );
349 OGRErr SetCS(
double dfCenterLat,
double dfCenterLong,
350 double dfFalseEasting,
double dfFalseNorthing );
353 OGRErr SetEC(
double dfStdP1,
double dfStdP2,
354 double dfCenterLat,
double dfCenterLong,
355 double dfFalseEasting,
double dfFalseNorthing );
358 OGRErr SetEckert(
int nVariation,
double dfCentralMeridian,
359 double dfFalseEasting,
double dfFalseNorthing );
362 OGRErr SetEckertIV(
double dfCentralMeridian,
363 double dfFalseEasting,
double dfFalseNorthing );
366 OGRErr SetEckertVI(
double dfCentralMeridian,
367 double dfFalseEasting,
double dfFalseNorthing );
370 OGRErr SetEquirectangular(
double dfCenterLat,
double dfCenterLong,
371 double dfFalseEasting,
double dfFalseNorthing );
373 OGRErr SetEquirectangular2(
double dfCenterLat,
double dfCenterLong,
374 double dfPseudoStdParallel1,
375 double dfFalseEasting,
double dfFalseNorthing );
378 OGRErr SetGEOS(
double dfCentralMeridian,
double dfSatelliteHeight,
379 double dfFalseEasting,
double dfFalseNorthing );
382 OGRErr SetGH(
double dfCentralMeridian,
383 double dfFalseEasting,
double dfFalseNorthing );
389 OGRErr SetGS(
double dfCentralMeridian,
390 double dfFalseEasting,
double dfFalseNorthing );
393 OGRErr SetGaussSchreiberTMercator(
double dfCenterLat,
double dfCenterLong,
395 double dfFalseEasting,
double dfFalseNorthing );
398 OGRErr SetGnomonic(
double dfCenterLat,
double dfCenterLong,
399 double dfFalseEasting,
double dfFalseNorthing );
402 OGRErr SetHOM(
double dfCenterLat,
double dfCenterLong,
403 double dfAzimuth,
double dfRectToSkew,
405 double dfFalseEasting,
double dfFalseNorthing );
408 OGRErr SetHOM2PNO(
double dfCenterLat,
409 double dfLat1,
double dfLong1,
410 double dfLat2,
double dfLong2,
412 double dfFalseEasting,
double dfFalseNorthing );
415 OGRErr SetOM(
double dfCenterLat,
double dfCenterLong,
416 double dfAzimuth,
double dfRectToSkew,
418 double dfFalseEasting,
double dfFalseNorthing );
421 OGRErr SetHOMAC(
double dfCenterLat,
double dfCenterLong,
422 double dfAzimuth,
double dfRectToSkew,
424 double dfFalseEasting,
double dfFalseNorthing );
427 OGRErr SetIWMPolyconic(
double dfLat1,
double dfLat2,
429 double dfFalseEasting,
430 double dfFalseNorthing );
433 OGRErr SetKrovak(
double dfCenterLat,
double dfCenterLong,
434 double dfAzimuth,
double dfPseudoStdParallelLat,
436 double dfFalseEasting,
double dfFalseNorthing );
439 OGRErr SetLAEA(
double dfCenterLat,
double dfCenterLong,
440 double dfFalseEasting,
double dfFalseNorthing );
443 OGRErr SetLCC(
double dfStdP1,
double dfStdP2,
444 double dfCenterLat,
double dfCenterLong,
445 double dfFalseEasting,
double dfFalseNorthing );
448 OGRErr SetLCC1SP(
double dfCenterLat,
double dfCenterLong,
450 double dfFalseEasting,
double dfFalseNorthing );
453 OGRErr SetLCCB(
double dfStdP1,
double dfStdP2,
454 double dfCenterLat,
double dfCenterLong,
455 double dfFalseEasting,
double dfFalseNorthing );
458 OGRErr SetMC(
double dfCenterLat,
double dfCenterLong,
459 double dfFalseEasting,
double dfFalseNorthing );
462 OGRErr SetMercator(
double dfCenterLat,
double dfCenterLong,
464 double dfFalseEasting,
double dfFalseNorthing );
467 OGRErr SetMercator2SP(
double dfStdP1,
468 double dfCenterLat,
double dfCenterLong,
469 double dfFalseEasting,
double dfFalseNorthing );
472 OGRErr SetMollweide(
double dfCentralMeridian,
473 double dfFalseEasting,
double dfFalseNorthing );
476 OGRErr SetNZMG(
double dfCenterLat,
double dfCenterLong,
477 double dfFalseEasting,
double dfFalseNorthing );
480 OGRErr SetOS(
double dfOriginLat,
double dfCMeridian,
482 double dfFalseEasting,
double dfFalseNorthing);
485 OGRErr SetOrthographic(
double dfCenterLat,
double dfCenterLong,
486 double dfFalseEasting,
double dfFalseNorthing);
489 OGRErr SetPolyconic(
double dfCenterLat,
double dfCenterLong,
490 double dfFalseEasting,
double dfFalseNorthing );
493 OGRErr SetPS(
double dfCenterLat,
double dfCenterLong,
495 double dfFalseEasting,
double dfFalseNorthing);
498 OGRErr SetRobinson(
double dfCenterLong,
499 double dfFalseEasting,
double dfFalseNorthing );
502 OGRErr SetSinusoidal(
double dfCenterLong,
503 double dfFalseEasting,
double dfFalseNorthing );
506 OGRErr SetStereographic(
double dfCenterLat,
double dfCenterLong,
508 double dfFalseEasting,
double dfFalseNorthing);
511 OGRErr SetSOC(
double dfLatitudeOfOrigin,
double dfCentralMeridian,
512 double dfFalseEasting,
double dfFalseNorthing );
515 OGRErr SetTM(
double dfCenterLat,
double dfCenterLong,
517 double dfFalseEasting,
double dfFalseNorthing );
520 OGRErr SetTMVariant(
const char *pszVariantName,
521 double dfCenterLat,
double dfCenterLong,
523 double dfFalseEasting,
double dfFalseNorthing );
526 OGRErr SetTMG(
double dfCenterLat,
double dfCenterLong,
527 double dfFalseEasting,
double dfFalseNorthing );
530 OGRErr SetTMSO(
double dfCenterLat,
double dfCenterLong,
532 double dfFalseEasting,
double dfFalseNorthing );
535 OGRErr SetTPED(
double dfLat1,
double dfLong1,
536 double dfLat2,
double dfLong2,
537 double dfFalseEasting,
double dfFalseNorthing );
540 OGRErr SetVDG(
double dfCenterLong,
541 double dfFalseEasting,
double dfFalseNorthing );
544 OGRErr SetUTM(
int nZone,
int bNorth = TRUE );
545 int GetUTMZone(
int *pbNorth = NULL )
const;
548 OGRErr SetWagner(
int nVariation,
double dfCenterLat,
549 double dfFalseEasting,
double dfFalseNorthing );
552 OGRErr SetQSC(
double dfCenterLat,
double dfCenterLong);
555 OGRErr SetSCH(
double dfPegLat,
double dfPegLong,
556 double dfPegHeading,
double dfPegHgt);
558 OGRErr SetStatePlane(
int nZone,
int bNAD83 = TRUE,
559 const char *pszOverrideUnitName = NULL,
560 double dfOverrideUnit = 0.0 );
563 OGRErr ImportFromESRIStatePlaneWKT(
564 int nCode,
const char* pszDatumName,
const char* pszUnitsName,
565 int nPCSCode,
const char* pszCSName = NULL );
568 OGRErr ImportFromESRIWisconsinWKT(
569 const char* pszPrjName,
double dfCentralMeridian,
double dfLatOfOrigin,
570 const char* pszUnitsName,
const char* pszCSName = NULL );
629 virtual int Transform(
int nCount,
630 double *x,
double *y,
double *z = NULL ) = 0;
647 virtual int TransformEx(
int nCount,
648 double *x,
double *y,
double *z = NULL,
649 int *pabSuccess = NULL ) = 0;
OGRCoordinateTransformation * OGRCreateCoordinateTransformation(OGRSpatialReference *poSource, OGRSpatialReference *poTarget)
Definition: ogrct.cpp:433
Definition: ogr_spatialref.h:60
int IsLeafNode() const
Definition: ogr_spatialref.h:79
const char * GetValue() const
Definition: ogr_spatialref.h:95
#define USGS_ANGLE_PACKEDDMS
Definition: ogr_spatialref.h:194
OGR_SRSNode * GetRoot()
Return root node.
Definition: ogr_spatialref.h:233
OGRAxisOrientation
Definition: ogr_srs_api.h:48
Definition: ogr_spatialref.h:132
int GetReferenceCount() const
Fetch current reference count.
Definition: ogr_spatialref.h:167
const OGR_SRSNode * GetRoot() const
Return root node.
Definition: ogr_spatialref.h:235
int OGRErr
Definition: ogr_core.h:285
int GetChildCount() const
Definition: ogr_spatialref.h:81