31 #ifndef _OGR_SPATIALREF_H_INCLUDED
32 #define _OGR_SPATIALREF_H_INCLUDED
68 int NeedsQuoting()
const;
74 int IsLeafNode()
const {
return nChildren == 0; }
85 int FindChild(
const char * )
const;
86 void DestroyChild(
int );
88 void StripNodes(
const char * );
90 const char *
GetValue()
const {
return pszValue; }
91 void SetValue(
const char * );
94 OGRErr FixupOrdering();
98 OGRErr importFromWkt(
char ** );
99 OGRErr exportToWkt(
char ** )
const;
100 OGRErr exportToPrettyWkt(
char **,
int = 1)
const;
102 OGRErr applyRemapper(
const char *pszNode,
103 char **papszSrcValues,
104 char **papszDstValues,
106 int bChildOfHit = FALSE );
129 double dfFromGreenwich;
139 static OGRErr ValidateAuthority(
OGR_SRSNode *poRoot);
142 static OGRErr ValidateVertDatum(
OGR_SRSNode *poRoot);
143 static OGRErr ValidateProjection(
OGR_SRSNode* poRoot );
144 static int IsAliasFor(
const char *,
const char * );
145 void GetNormInfo()
const;
147 OGRErr importFromURNPart(
const char* pszAuthority,
168 OGRErr exportToWkt(
char ** )
const;
169 OGRErr exportToPrettyWkt(
char **,
int = FALSE)
const;
170 OGRErr exportToProj4(
char ** )
const;
171 OGRErr exportToPCI(
char **,
char **,
double ** )
const;
172 OGRErr exportToUSGS(
long *,
long *,
double **,
long * )
const;
173 OGRErr exportToXML(
char **,
const char * = NULL )
const;
174 OGRErr exportToPanorama(
long *,
long *,
long *,
long *,
176 OGRErr exportToERM(
char *pszProj,
char *pszDatum,
char *pszUnits );
177 OGRErr exportToMICoordSys(
char ** )
const;
179 OGRErr importFromWkt(
char ** );
180 OGRErr importFromProj4(
const char * );
181 OGRErr importFromEPSG(
int );
182 OGRErr importFromEPSGA(
int );
183 OGRErr importFromESRI(
char ** );
184 OGRErr importFromPCI(
const char *,
const char * = NULL,
186 OGRErr importFromUSGS(
long iProjSys,
long iZone,
187 double *padfPrjParams,
188 long iDatum,
int bAnglesInPackedDMSFormat = TRUE );
189 OGRErr importFromPanorama(
long,
long,
long,
double* );
190 OGRErr importFromOzi(
const char *,
const char *,
const char * );
191 OGRErr importFromWMSAUTO(
const char *pszAutoDef );
192 OGRErr importFromXML(
const char * );
193 OGRErr importFromDict(
const char *pszDict,
const char *pszCode );
194 OGRErr importFromURN(
const char * );
195 OGRErr importFromERM(
const char *pszProj,
const char *pszDatum,
196 const char *pszUnits );
197 OGRErr importFromUrl(
const char * );
198 OGRErr importFromMICoordSys(
const char * );
200 OGRErr morphToESRI();
201 OGRErr morphFromESRI();
205 OGRErr StripVertical();
206 OGRErr FixupOrdering();
209 int EPSGTreatsAsLatLong();
210 const char *GetAxis(
const char *pszTargetKey,
int iAxis,
211 OGRAxisOrientation *peOrientation )
const;
212 OGRErr SetAxes(
const char *pszTargetKey,
213 const char *pszXAxisName,
214 OGRAxisOrientation eXAxisOrientation,
215 const char *pszYAxisName,
216 OGRAxisOrientation eYAxisOrientation );
220 const OGR_SRSNode *GetRoot()
const {
return poRoot; }
224 const OGR_SRSNode *GetAttrNode(
const char *)
const;
225 const char *GetAttrValue(
const char *,
int = 0)
const;
227 OGRErr SetNode(
const char *,
const char * );
228 OGRErr SetNode(
const char *,
double );
230 OGRErr SetLinearUnitsAndUpdateParameters(
const char *pszName,
232 OGRErr SetLinearUnits(
const char *pszName,
double dfInMeters );
233 OGRErr SetTargetLinearUnits(
const char *pszTargetKey,
234 const char *pszName,
double dfInMeters );
235 double GetLinearUnits(
char ** = NULL )
const;
236 double GetTargetLinearUnits(
const char *pszTargetKey,
237 char ** ppszRetName = NULL )
const;
239 OGRErr SetAngularUnits(
const char *pszName,
double dfInRadians );
240 double GetAngularUnits(
char ** = NULL )
const;
242 double GetPrimeMeridian(
char ** = NULL )
const;
244 int IsGeographic()
const;
245 int IsProjected()
const;
246 int IsGeocentric()
const;
248 int IsVertical()
const;
249 int IsCompound()
const;
255 OGRErr SetLocalCS(
const char * );
256 OGRErr SetProjCS(
const char * );
257 OGRErr SetProjection(
const char * );
258 OGRErr SetGeocCS(
const char * pszGeocName );
259 OGRErr SetGeogCS(
const char * pszGeogName,
260 const char * pszDatumName,
261 const char * pszEllipsoidName,
262 double dfSemiMajor,
double dfInvFlattening,
263 const char * pszPMName = NULL,
264 double dfPMOffset = 0.0,
265 const char * pszUnits = NULL,
266 double dfConvertToRadians = 0.0 );
267 OGRErr SetWellKnownGeogCS(
const char * );
269 OGRErr SetVertCS(
const char *pszVertCSName,
270 const char *pszVertDatumName,
271 int nVertDatumClass = 2005 );
272 OGRErr SetCompoundCS(
const char *pszName,
276 OGRErr SetFromUserInput(
const char * );
278 OGRErr SetTOWGS84(
double,
double,
double,
279 double = 0.0,
double = 0.0,
double = 0.0,
281 OGRErr GetTOWGS84(
double *padfCoef,
int nCoeff = 7 )
const;
283 double GetSemiMajor( OGRErr * = NULL )
const;
284 double GetSemiMinor( OGRErr * = NULL )
const;
285 double GetInvFlattening( OGRErr * = NULL )
const;
287 OGRErr SetAuthority(
const char * pszTargetKey,
288 const char * pszAuthority,
291 OGRErr AutoIdentifyEPSG();
294 const char *GetAuthorityCode(
const char * pszTargetKey )
const;
295 const char *GetAuthorityName(
const char * pszTargetKey )
const;
297 const char *GetExtension(
const char *pszTargetKey,
299 const char *pszDefault = NULL )
const;
300 OGRErr SetExtension(
const char *pszTargetKey,
302 const char *pszValue );
304 int FindProjParm(
const char *pszParameter,
306 OGRErr SetProjParm(
const char *,
double );
307 double GetProjParm(
const char *,
double =0.0, OGRErr* = NULL )
const;
309 OGRErr SetNormProjParm(
const char *,
double );
310 double GetNormProjParm(
const char *,
double=0.0, OGRErr* =NULL)
const;
312 static int IsAngularParameter(
const char * );
313 static int IsLongitudeParameter(
const char * );
314 static int IsLinearParameter(
const char * );
317 OGRErr SetACEA(
double dfStdP1,
double dfStdP2,
318 double dfCenterLat,
double dfCenterLong,
319 double dfFalseEasting,
double dfFalseNorthing );
322 OGRErr SetAE(
double dfCenterLat,
double dfCenterLong,
323 double dfFalseEasting,
double dfFalseNorthing );
326 OGRErr SetBonne(
double dfStdP1,
double dfCentralMeridian,
327 double dfFalseEasting,
double dfFalseNorthing );
330 OGRErr SetCEA(
double dfStdP1,
double dfCentralMeridian,
331 double dfFalseEasting,
double dfFalseNorthing );
334 OGRErr SetCS(
double dfCenterLat,
double dfCenterLong,
335 double dfFalseEasting,
double dfFalseNorthing );
338 OGRErr SetEC(
double dfStdP1,
double dfStdP2,
339 double dfCenterLat,
double dfCenterLong,
340 double dfFalseEasting,
double dfFalseNorthing );
343 OGRErr SetEckert(
int nVariation,
double dfCentralMeridian,
344 double dfFalseEasting,
double dfFalseNorthing );
346 OGRErr SetEckertIV(
double dfCentralMeridian,
347 double dfFalseEasting,
double dfFalseNorthing );
349 OGRErr SetEckertVI(
double dfCentralMeridian,
350 double dfFalseEasting,
double dfFalseNorthing );
353 OGRErr SetEquirectangular(
double dfCenterLat,
double dfCenterLong,
354 double dfFalseEasting,
double dfFalseNorthing );
356 OGRErr SetEquirectangular2(
double dfCenterLat,
double dfCenterLong,
357 double dfPseudoStdParallel1,
358 double dfFalseEasting,
double dfFalseNorthing );
361 OGRErr SetGEOS(
double dfCentralMeridian,
double dfSatelliteHeight,
362 double dfFalseEasting,
double dfFalseNorthing );
365 OGRErr SetGH(
double dfCentralMeridian,
366 double dfFalseEasting,
double dfFalseNorthing );
372 OGRErr SetGS(
double dfCentralMeridian,
373 double dfFalseEasting,
double dfFalseNorthing );
376 OGRErr SetGaussSchreiberTMercator(
double dfCenterLat,
double dfCenterLong,
378 double dfFalseEasting,
double dfFalseNorthing );
381 OGRErr SetGnomonic(
double dfCenterLat,
double dfCenterLong,
382 double dfFalseEasting,
double dfFalseNorthing );
385 OGRErr SetHOM(
double dfCenterLat,
double dfCenterLong,
386 double dfAzimuth,
double dfRectToSkew,
388 double dfFalseEasting,
double dfFalseNorthing );
390 OGRErr SetHOM2PNO(
double dfCenterLat,
391 double dfLat1,
double dfLong1,
392 double dfLat2,
double dfLong2,
394 double dfFalseEasting,
double dfFalseNorthing );
397 OGRErr SetIWMPolyconic(
double dfLat1,
double dfLat2,
399 double dfFalseEasting,
400 double dfFalseNorthing );
403 OGRErr SetKrovak(
double dfCenterLat,
double dfCenterLong,
404 double dfAzimuth,
double dfPseudoStdParallelLat,
406 double dfFalseEasting,
double dfFalseNorthing );
409 OGRErr SetLAEA(
double dfCenterLat,
double dfCenterLong,
410 double dfFalseEasting,
double dfFalseNorthing );
413 OGRErr SetLCC(
double dfStdP1,
double dfStdP2,
414 double dfCenterLat,
double dfCenterLong,
415 double dfFalseEasting,
double dfFalseNorthing );
418 OGRErr SetLCC1SP(
double dfCenterLat,
double dfCenterLong,
420 double dfFalseEasting,
double dfFalseNorthing );
423 OGRErr SetLCCB(
double dfStdP1,
double dfStdP2,
424 double dfCenterLat,
double dfCenterLong,
425 double dfFalseEasting,
double dfFalseNorthing );
428 OGRErr SetMC(
double dfCenterLat,
double dfCenterLong,
429 double dfFalseEasting,
double dfFalseNorthing );
432 OGRErr SetMercator(
double dfCenterLat,
double dfCenterLong,
434 double dfFalseEasting,
double dfFalseNorthing );
436 OGRErr SetMercator2SP(
double dfStdP1,
437 double dfCenterLat,
double dfCenterLong,
438 double dfFalseEasting,
double dfFalseNorthing );
441 OGRErr SetMollweide(
double dfCentralMeridian,
442 double dfFalseEasting,
double dfFalseNorthing );
445 OGRErr SetNZMG(
double dfCenterLat,
double dfCenterLong,
446 double dfFalseEasting,
double dfFalseNorthing );
449 OGRErr SetOS(
double dfOriginLat,
double dfCMeridian,
451 double dfFalseEasting,
double dfFalseNorthing);
454 OGRErr SetOrthographic(
double dfCenterLat,
double dfCenterLong,
455 double dfFalseEasting,
double dfFalseNorthing);
458 OGRErr SetPolyconic(
double dfCenterLat,
double dfCenterLong,
459 double dfFalseEasting,
double dfFalseNorthing );
462 OGRErr SetPS(
double dfCenterLat,
double dfCenterLong,
464 double dfFalseEasting,
double dfFalseNorthing);
467 OGRErr SetRobinson(
double dfCenterLong,
468 double dfFalseEasting,
double dfFalseNorthing );
471 OGRErr SetSinusoidal(
double dfCenterLong,
472 double dfFalseEasting,
double dfFalseNorthing );
475 OGRErr SetStereographic(
double dfCenterLat,
double dfCenterLong,
477 double dfFalseEasting,
double dfFalseNorthing);
480 OGRErr SetSOC(
double dfLatitudeOfOrigin,
double dfCentralMeridian,
481 double dfFalseEasting,
double dfFalseNorthing );
484 OGRErr SetTM(
double dfCenterLat,
double dfCenterLong,
486 double dfFalseEasting,
double dfFalseNorthing );
489 OGRErr SetTMVariant(
const char *pszVariantName,
490 double dfCenterLat,
double dfCenterLong,
492 double dfFalseEasting,
double dfFalseNorthing );
495 OGRErr SetTMG(
double dfCenterLat,
double dfCenterLong,
496 double dfFalseEasting,
double dfFalseNorthing );
499 OGRErr SetTMSO(
double dfCenterLat,
double dfCenterLong,
501 double dfFalseEasting,
double dfFalseNorthing );
504 OGRErr SetTPED(
double dfLat1,
double dfLong1,
505 double dfLat2,
double dfLong2,
506 double dfFalseEasting,
double dfFalseNorthing );
509 OGRErr SetVDG(
double dfCenterLong,
510 double dfFalseEasting,
double dfFalseNorthing );
513 OGRErr SetUTM(
int nZone,
int bNorth = TRUE );
514 int GetUTMZone(
int *pbNorth = NULL )
const;
517 OGRErr SetWagner(
int nVariation,
double dfCenterLat,
518 double dfFalseEasting,
double dfFalseNorthing );
521 OGRErr SetStatePlane(
int nZone,
int bNAD83 = TRUE,
522 const char *pszOverrideUnitName = NULL,
523 double dfOverrideUnit = 0.0 );
525 OGRErr ImportFromESRIStatePlaneWKT(
526 int nCode,
const char* pszDatumName,
const char* pszUnitsName,
527 int nPCSCode,
const char* pszCSName = 0 );
528 OGRErr ImportFromESRIWisconsinWKT(
529 const char* pszPrjName,
double dfCentralMeridian,
double dfLatOfOrigin,
530 const char* pszUnitsName,
const char* pszCSName = 0 );
581 virtual int Transform(
int nCount,
582 double *x,
double *y,
double *z = NULL ) = 0;
599 virtual int TransformEx(
int nCount,
600 double *x,
double *y,
double *z = NULL,
601 int *pabSuccess = NULL ) = 0;