32 #ifndef OGR_SPATIALREF_H_INCLUDED 33 #define OGR_SPATIALREF_H_INCLUDED 69 int NeedsQuoting()
const;
70 OGRErr importFromWkt(
char **,
int nRecLevel,
int* pnNodes );
76 int IsLeafNode()
const {
return nChildren == 0; }
87 int FindChild(
const char * )
const;
88 void DestroyChild(
int );
90 void StripNodes(
const char * );
92 const char *
GetValue()
const {
return pszValue; }
93 void SetValue(
const char * );
96 OGRErr FixupOrdering();
100 OGRErr importFromWkt(
char ** );
101 OGRErr exportToWkt(
char ** )
const;
102 OGRErr exportToPrettyWkt(
char **,
int = 1)
const;
104 OGRErr applyRemapper(
const char *pszNode,
105 char **papszSrcValues,
106 char **papszDstValues,
108 int bChildOfHit = FALSE );
131 double dfFromGreenwich;
141 static OGRErr ValidateAuthority(
OGR_SRSNode *poRoot);
144 static OGRErr ValidateVertDatum(
OGR_SRSNode *poRoot);
145 static OGRErr ValidateProjection(
OGR_SRSNode* poRoot );
146 static int IsAliasFor(
const char *,
const char * );
147 void GetNormInfo()
const;
149 OGRErr importFromURNPart(
const char* pszAuthority,
171 OGRErr exportToWkt(
char ** )
const;
172 OGRErr exportToPrettyWkt(
char **,
int = FALSE)
const;
173 OGRErr exportToProj4(
char ** )
const;
174 OGRErr exportToPCI(
char **,
char **,
double ** )
const;
175 OGRErr exportToUSGS(
long *,
long *,
double **,
long * )
const;
176 OGRErr exportToXML(
char **,
const char * = NULL )
const;
177 OGRErr exportToPanorama(
long *,
long *,
long *,
long *,
179 OGRErr exportToERM(
char *pszProj,
char *pszDatum,
char *pszUnits );
180 OGRErr exportToMICoordSys(
char ** )
const;
182 OGRErr importFromWkt(
char ** );
183 OGRErr importFromProj4(
const char * );
184 OGRErr importFromEPSG(
int );
185 OGRErr importFromEPSGA(
int );
186 OGRErr importFromESRI(
char ** );
187 OGRErr importFromPCI(
const char *,
const char * = NULL,
189 #define USGS_ANGLE_DECIMALDEGREES 0 190 #define USGS_ANGLE_PACKEDDMS TRUE 191 #define USGS_ANGLE_RADIANS 2 192 OGRErr importFromUSGS(
long iProjSys,
long iZone,
193 double *padfPrjParams,
long iDatum,
194 int nUSGSAngleFormat = USGS_ANGLE_PACKEDDMS );
195 OGRErr importFromPanorama(
long,
long,
long,
double* );
196 OGRErr importFromOzi(
const char *
const* papszLines );
197 OGRErr importFromWMSAUTO(
const char *pszAutoDef );
198 OGRErr importFromXML(
const char * );
199 OGRErr importFromDict(
const char *pszDict,
const char *pszCode );
200 OGRErr importFromURN(
const char * );
201 OGRErr importFromCRSURL(
const char * );
202 OGRErr importFromERM(
const char *pszProj,
const char *pszDatum,
203 const char *pszUnits );
204 OGRErr importFromUrl(
const char * );
205 OGRErr importFromMICoordSys(
const char * );
207 OGRErr morphToESRI();
208 OGRErr morphFromESRI();
212 OGRErr StripVertical();
213 OGRErr FixupOrdering();
216 int EPSGTreatsAsLatLong();
217 int EPSGTreatsAsNorthingEasting();
218 const char *GetAxis(
const char *pszTargetKey,
int iAxis,
219 OGRAxisOrientation *peOrientation )
const;
220 OGRErr SetAxes(
const char *pszTargetKey,
221 const char *pszXAxisName,
222 OGRAxisOrientation eXAxisOrientation,
223 const char *pszYAxisName,
224 OGRAxisOrientation eYAxisOrientation );
228 const OGR_SRSNode *GetRoot()
const {
return poRoot; }
232 const OGR_SRSNode *GetAttrNode(
const char *)
const;
233 const char *GetAttrValue(
const char *,
int = 0)
const;
235 OGRErr SetNode(
const char *,
const char * );
236 OGRErr SetNode(
const char *,
double );
238 OGRErr SetLinearUnitsAndUpdateParameters(
const char *pszName,
240 OGRErr SetLinearUnits(
const char *pszName,
double dfInMeters );
241 OGRErr SetTargetLinearUnits(
const char *pszTargetKey,
242 const char *pszName,
double dfInMeters );
243 double GetLinearUnits(
char ** = NULL )
const;
244 double GetTargetLinearUnits(
const char *pszTargetKey,
245 char ** ppszRetName = NULL )
const;
247 OGRErr SetAngularUnits(
const char *pszName,
double dfInRadians );
248 double GetAngularUnits(
char ** = NULL )
const;
250 double GetPrimeMeridian(
char ** = NULL )
const;
252 int IsGeographic()
const;
253 int IsProjected()
const;
254 int IsGeocentric()
const;
256 int IsVertical()
const;
257 int IsCompound()
const;
263 OGRErr SetLocalCS(
const char * );
264 OGRErr SetProjCS(
const char * );
265 OGRErr SetProjection(
const char * );
266 OGRErr SetGeocCS(
const char * pszGeocName );
267 OGRErr SetGeogCS(
const char * pszGeogName,
268 const char * pszDatumName,
269 const char * pszEllipsoidName,
270 double dfSemiMajor,
double dfInvFlattening,
271 const char * pszPMName = NULL,
272 double dfPMOffset = 0.0,
273 const char * pszUnits = NULL,
274 double dfConvertToRadians = 0.0 );
275 OGRErr SetWellKnownGeogCS(
const char * );
277 OGRErr SetVertCS(
const char *pszVertCSName,
278 const char *pszVertDatumName,
279 int nVertDatumClass = 2005 );
280 OGRErr SetCompoundCS(
const char *pszName,
284 OGRErr SetFromUserInput(
const char * );
286 OGRErr SetTOWGS84(
double,
double,
double,
287 double = 0.0,
double = 0.0,
double = 0.0,
289 OGRErr GetTOWGS84(
double *padfCoef,
int nCoeff = 7 )
const;
291 double GetSemiMajor( OGRErr * = NULL )
const;
292 double GetSemiMinor( OGRErr * = NULL )
const;
293 double GetInvFlattening( OGRErr * = NULL )
const;
295 OGRErr SetAuthority(
const char * pszTargetKey,
296 const char * pszAuthority,
299 OGRErr AutoIdentifyEPSG();
302 const char *GetAuthorityCode(
const char * pszTargetKey )
const;
303 const char *GetAuthorityName(
const char * pszTargetKey )
const;
305 const char *GetExtension(
const char *pszTargetKey,
307 const char *pszDefault = NULL )
const;
308 OGRErr SetExtension(
const char *pszTargetKey,
310 const char *pszValue );
312 int FindProjParm(
const char *pszParameter,
314 OGRErr SetProjParm(
const char *,
double );
315 double GetProjParm(
const char *,
double =0.0, OGRErr* = NULL )
const;
317 OGRErr SetNormProjParm(
const char *,
double );
318 double GetNormProjParm(
const char *,
double=0.0, OGRErr* =NULL)
const;
320 static int IsAngularParameter(
const char * );
321 static int IsLongitudeParameter(
const char * );
322 static int IsLinearParameter(
const char * );
325 OGRErr SetACEA(
double dfStdP1,
double dfStdP2,
326 double dfCenterLat,
double dfCenterLong,
327 double dfFalseEasting,
double dfFalseNorthing );
330 OGRErr SetAE(
double dfCenterLat,
double dfCenterLong,
331 double dfFalseEasting,
double dfFalseNorthing );
334 OGRErr SetBonne(
double dfStdP1,
double dfCentralMeridian,
335 double dfFalseEasting,
double dfFalseNorthing );
338 OGRErr SetCEA(
double dfStdP1,
double dfCentralMeridian,
339 double dfFalseEasting,
double dfFalseNorthing );
342 OGRErr SetCS(
double dfCenterLat,
double dfCenterLong,
343 double dfFalseEasting,
double dfFalseNorthing );
346 OGRErr SetEC(
double dfStdP1,
double dfStdP2,
347 double dfCenterLat,
double dfCenterLong,
348 double dfFalseEasting,
double dfFalseNorthing );
351 OGRErr SetEckert(
int nVariation,
double dfCentralMeridian,
352 double dfFalseEasting,
double dfFalseNorthing );
354 OGRErr SetEckertIV(
double dfCentralMeridian,
355 double dfFalseEasting,
double dfFalseNorthing );
357 OGRErr SetEckertVI(
double dfCentralMeridian,
358 double dfFalseEasting,
double dfFalseNorthing );
361 OGRErr SetEquirectangular(
double dfCenterLat,
double dfCenterLong,
362 double dfFalseEasting,
double dfFalseNorthing );
364 OGRErr SetEquirectangular2(
double dfCenterLat,
double dfCenterLong,
365 double dfPseudoStdParallel1,
366 double dfFalseEasting,
double dfFalseNorthing );
369 OGRErr SetGEOS(
double dfCentralMeridian,
double dfSatelliteHeight,
370 double dfFalseEasting,
double dfFalseNorthing );
373 OGRErr SetGH(
double dfCentralMeridian,
374 double dfFalseEasting,
double dfFalseNorthing );
380 OGRErr SetGS(
double dfCentralMeridian,
381 double dfFalseEasting,
double dfFalseNorthing );
384 OGRErr SetGaussSchreiberTMercator(
double dfCenterLat,
double dfCenterLong,
386 double dfFalseEasting,
double dfFalseNorthing );
389 OGRErr SetGnomonic(
double dfCenterLat,
double dfCenterLong,
390 double dfFalseEasting,
double dfFalseNorthing );
393 OGRErr SetHOM(
double dfCenterLat,
double dfCenterLong,
394 double dfAzimuth,
double dfRectToSkew,
396 double dfFalseEasting,
double dfFalseNorthing );
398 OGRErr SetHOM2PNO(
double dfCenterLat,
399 double dfLat1,
double dfLong1,
400 double dfLat2,
double dfLong2,
402 double dfFalseEasting,
double dfFalseNorthing );
404 OGRErr SetOM(
double dfCenterLat,
double dfCenterLong,
405 double dfAzimuth,
double dfRectToSkew,
407 double dfFalseEasting,
double dfFalseNorthing );
410 OGRErr SetHOMAC(
double dfCenterLat,
double dfCenterLong,
411 double dfAzimuth,
double dfRectToSkew,
413 double dfFalseEasting,
double dfFalseNorthing );
416 OGRErr SetIWMPolyconic(
double dfLat1,
double dfLat2,
418 double dfFalseEasting,
419 double dfFalseNorthing );
422 OGRErr SetKrovak(
double dfCenterLat,
double dfCenterLong,
423 double dfAzimuth,
double dfPseudoStdParallelLat,
425 double dfFalseEasting,
double dfFalseNorthing );
428 OGRErr SetLAEA(
double dfCenterLat,
double dfCenterLong,
429 double dfFalseEasting,
double dfFalseNorthing );
432 OGRErr SetLCC(
double dfStdP1,
double dfStdP2,
433 double dfCenterLat,
double dfCenterLong,
434 double dfFalseEasting,
double dfFalseNorthing );
437 OGRErr SetLCC1SP(
double dfCenterLat,
double dfCenterLong,
439 double dfFalseEasting,
double dfFalseNorthing );
442 OGRErr SetLCCB(
double dfStdP1,
double dfStdP2,
443 double dfCenterLat,
double dfCenterLong,
444 double dfFalseEasting,
double dfFalseNorthing );
447 OGRErr SetMC(
double dfCenterLat,
double dfCenterLong,
448 double dfFalseEasting,
double dfFalseNorthing );
451 OGRErr SetMercator(
double dfCenterLat,
double dfCenterLong,
453 double dfFalseEasting,
double dfFalseNorthing );
455 OGRErr SetMercator2SP(
double dfStdP1,
456 double dfCenterLat,
double dfCenterLong,
457 double dfFalseEasting,
double dfFalseNorthing );
460 OGRErr SetMollweide(
double dfCentralMeridian,
461 double dfFalseEasting,
double dfFalseNorthing );
464 OGRErr SetNZMG(
double dfCenterLat,
double dfCenterLong,
465 double dfFalseEasting,
double dfFalseNorthing );
468 OGRErr SetOS(
double dfOriginLat,
double dfCMeridian,
470 double dfFalseEasting,
double dfFalseNorthing);
473 OGRErr SetOrthographic(
double dfCenterLat,
double dfCenterLong,
474 double dfFalseEasting,
double dfFalseNorthing);
477 OGRErr SetPolyconic(
double dfCenterLat,
double dfCenterLong,
478 double dfFalseEasting,
double dfFalseNorthing );
481 OGRErr SetPS(
double dfCenterLat,
double dfCenterLong,
483 double dfFalseEasting,
double dfFalseNorthing);
486 OGRErr SetRobinson(
double dfCenterLong,
487 double dfFalseEasting,
double dfFalseNorthing );
490 OGRErr SetSinusoidal(
double dfCenterLong,
491 double dfFalseEasting,
double dfFalseNorthing );
494 OGRErr SetStereographic(
double dfCenterLat,
double dfCenterLong,
496 double dfFalseEasting,
double dfFalseNorthing);
499 OGRErr SetSOC(
double dfLatitudeOfOrigin,
double dfCentralMeridian,
500 double dfFalseEasting,
double dfFalseNorthing );
503 OGRErr SetTM(
double dfCenterLat,
double dfCenterLong,
505 double dfFalseEasting,
double dfFalseNorthing );
508 OGRErr SetTMVariant(
const char *pszVariantName,
509 double dfCenterLat,
double dfCenterLong,
511 double dfFalseEasting,
double dfFalseNorthing );
514 OGRErr SetTMG(
double dfCenterLat,
double dfCenterLong,
515 double dfFalseEasting,
double dfFalseNorthing );
518 OGRErr SetTMSO(
double dfCenterLat,
double dfCenterLong,
520 double dfFalseEasting,
double dfFalseNorthing );
523 OGRErr SetTPED(
double dfLat1,
double dfLong1,
524 double dfLat2,
double dfLong2,
525 double dfFalseEasting,
double dfFalseNorthing );
528 OGRErr SetVDG(
double dfCenterLong,
529 double dfFalseEasting,
double dfFalseNorthing );
532 OGRErr SetUTM(
int nZone,
int bNorth = TRUE );
533 int GetUTMZone(
int *pbNorth = NULL )
const;
536 OGRErr SetWagner(
int nVariation,
double dfCenterLat,
537 double dfFalseEasting,
double dfFalseNorthing );
540 OGRErr SetQSC(
double dfCenterLat,
double dfCenterLong);
543 OGRErr SetSCH(
double dfPegLat,
double dfPegLong,
544 double dfPegHeading,
double dfPegHgt);
546 OGRErr SetStatePlane(
int nZone,
int bNAD83 = TRUE,
547 const char *pszOverrideUnitName = NULL,
548 double dfOverrideUnit = 0.0 );
550 OGRErr ImportFromESRIStatePlaneWKT(
551 int nCode,
const char* pszDatumName,
const char* pszUnitsName,
552 int nPCSCode,
const char* pszCSName = NULL );
553 OGRErr ImportFromESRIWisconsinWKT(
554 const char* pszPrjName,
double dfCentralMeridian,
double dfLatOfOrigin,
555 const char* pszUnitsName,
const char* pszCSName = NULL );
608 virtual int Transform(
int nCount,
609 double *x,
double *y,
double *z = NULL ) = 0;
626 virtual int TransformEx(
int nCount,
627 double *x,
double *y,
double *z = NULL,
628 int *pabSuccess = NULL ) = 0;
OGRCoordinateTransformation * OGRCreateCoordinateTransformation(OGRSpatialReference *poSource, OGRSpatialReference *poTarget)
Create transformation object.
Definition: ogrct.cpp:425
Objects of this class are used to represent value nodes in the parsed representation of the WKT SRS f...
Definition: ogr_spatialref.h:60
const char * GetValue() const
Fetch value string for this node.
Definition: ogr_spatialref.h:92
C spatial reference system services and defines.
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:129
int GetReferenceCount() const
Fetch current reference count.
Definition: ogr_spatialref.h:164
int GetChildCount() const
Get number of children nodes.
Definition: ogr_spatialref.h:78