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,
169 OGRErr exportToWkt(
char ** )
const;
170 OGRErr exportToPrettyWkt(
char **,
int = FALSE)
const;
171 OGRErr exportToProj4(
char ** )
const;
172 OGRErr exportToPCI(
char **,
char **,
double ** )
const;
173 OGRErr exportToUSGS(
long *,
long *,
double **,
long * )
const;
174 OGRErr exportToXML(
char **,
const char * = NULL )
const;
175 OGRErr exportToPanorama(
long *,
long *,
long *,
long *,
177 OGRErr exportToERM(
char *pszProj,
char *pszDatum,
char *pszUnits );
178 OGRErr exportToMICoordSys(
char ** )
const;
180 OGRErr importFromWkt(
char ** );
181 OGRErr importFromProj4(
const char * );
182 OGRErr importFromEPSG(
int );
183 OGRErr importFromEPSGA(
int );
184 OGRErr importFromESRI(
char ** );
185 OGRErr importFromPCI(
const char *,
const char * = NULL,
187 #define USGS_ANGLE_DECIMALDEGREES 0
188 #define USGS_ANGLE_PACKEDDMS TRUE
189 #define USGS_ANGLE_RADIANS 2
190 OGRErr importFromUSGS(
long iProjSys,
long iZone,
191 double *padfPrjParams,
long iDatum,
192 int nUSGSAngleFormat = USGS_ANGLE_PACKEDDMS );
193 OGRErr importFromPanorama(
long,
long,
long,
double* );
194 OGRErr importFromOzi(
const char *,
const char *,
const char * );
195 OGRErr importFromOzi(
const char *
const* papszLines );
196 OGRErr importFromWMSAUTO(
const char *pszAutoDef );
197 OGRErr importFromXML(
const char * );
198 OGRErr importFromDict(
const char *pszDict,
const char *pszCode );
199 OGRErr importFromURN(
const char * );
200 OGRErr importFromCRSURL(
const char * );
201 OGRErr importFromERM(
const char *pszProj,
const char *pszDatum,
202 const char *pszUnits );
203 OGRErr importFromUrl(
const char * );
204 OGRErr importFromMICoordSys(
const char * );
206 OGRErr morphToESRI();
207 OGRErr morphFromESRI();
211 OGRErr StripVertical();
212 OGRErr FixupOrdering();
215 int EPSGTreatsAsLatLong();
216 int EPSGTreatsAsNorthingEasting();
217 const char *GetAxis(
const char *pszTargetKey,
int iAxis,
218 OGRAxisOrientation *peOrientation )
const;
219 OGRErr SetAxes(
const char *pszTargetKey,
220 const char *pszXAxisName,
221 OGRAxisOrientation eXAxisOrientation,
222 const char *pszYAxisName,
223 OGRAxisOrientation eYAxisOrientation );
227 const OGR_SRSNode *GetRoot()
const {
return poRoot; }
231 const OGR_SRSNode *GetAttrNode(
const char *)
const;
232 const char *GetAttrValue(
const char *,
int = 0)
const;
234 OGRErr SetNode(
const char *,
const char * );
235 OGRErr SetNode(
const char *,
double );
237 OGRErr SetLinearUnitsAndUpdateParameters(
const char *pszName,
239 OGRErr SetLinearUnits(
const char *pszName,
double dfInMeters );
240 OGRErr SetTargetLinearUnits(
const char *pszTargetKey,
241 const char *pszName,
double dfInMeters );
242 double GetLinearUnits(
char ** = NULL )
const;
243 double GetTargetLinearUnits(
const char *pszTargetKey,
244 char ** ppszRetName = NULL )
const;
246 OGRErr SetAngularUnits(
const char *pszName,
double dfInRadians );
247 double GetAngularUnits(
char ** = NULL )
const;
249 double GetPrimeMeridian(
char ** = NULL )
const;
251 int IsGeographic()
const;
252 int IsProjected()
const;
253 int IsGeocentric()
const;
255 int IsVertical()
const;
256 int IsCompound()
const;
262 OGRErr SetLocalCS(
const char * );
263 OGRErr SetProjCS(
const char * );
264 OGRErr SetProjection(
const char * );
265 OGRErr SetGeocCS(
const char * pszGeocName );
266 OGRErr SetGeogCS(
const char * pszGeogName,
267 const char * pszDatumName,
268 const char * pszEllipsoidName,
269 double dfSemiMajor,
double dfInvFlattening,
270 const char * pszPMName = NULL,
271 double dfPMOffset = 0.0,
272 const char * pszUnits = NULL,
273 double dfConvertToRadians = 0.0 );
274 OGRErr SetWellKnownGeogCS(
const char * );
276 OGRErr SetVertCS(
const char *pszVertCSName,
277 const char *pszVertDatumName,
278 int nVertDatumClass = 2005 );
279 OGRErr SetCompoundCS(
const char *pszName,
283 OGRErr SetFromUserInput(
const char * );
285 OGRErr SetTOWGS84(
double,
double,
double,
286 double = 0.0,
double = 0.0,
double = 0.0,
288 OGRErr GetTOWGS84(
double *padfCoef,
int nCoeff = 7 )
const;
290 double GetSemiMajor( OGRErr * = NULL )
const;
291 double GetSemiMinor( OGRErr * = NULL )
const;
292 double GetInvFlattening( OGRErr * = NULL )
const;
294 OGRErr SetAuthority(
const char * pszTargetKey,
295 const char * pszAuthority,
298 OGRErr AutoIdentifyEPSG();
301 const char *GetAuthorityCode(
const char * pszTargetKey )
const;
302 const char *GetAuthorityName(
const char * pszTargetKey )
const;
304 const char *GetExtension(
const char *pszTargetKey,
306 const char *pszDefault = NULL )
const;
307 OGRErr SetExtension(
const char *pszTargetKey,
309 const char *pszValue );
311 int FindProjParm(
const char *pszParameter,
313 OGRErr SetProjParm(
const char *,
double );
314 double GetProjParm(
const char *,
double =0.0, OGRErr* = NULL )
const;
316 OGRErr SetNormProjParm(
const char *,
double );
317 double GetNormProjParm(
const char *,
double=0.0, OGRErr* =NULL)
const;
319 static int IsAngularParameter(
const char * );
320 static int IsLongitudeParameter(
const char * );
321 static int IsLinearParameter(
const char * );
324 OGRErr SetACEA(
double dfStdP1,
double dfStdP2,
325 double dfCenterLat,
double dfCenterLong,
326 double dfFalseEasting,
double dfFalseNorthing );
329 OGRErr SetAE(
double dfCenterLat,
double dfCenterLong,
330 double dfFalseEasting,
double dfFalseNorthing );
333 OGRErr SetBonne(
double dfStdP1,
double dfCentralMeridian,
334 double dfFalseEasting,
double dfFalseNorthing );
337 OGRErr SetCEA(
double dfStdP1,
double dfCentralMeridian,
338 double dfFalseEasting,
double dfFalseNorthing );
341 OGRErr SetCS(
double dfCenterLat,
double dfCenterLong,
342 double dfFalseEasting,
double dfFalseNorthing );
345 OGRErr SetEC(
double dfStdP1,
double dfStdP2,
346 double dfCenterLat,
double dfCenterLong,
347 double dfFalseEasting,
double dfFalseNorthing );
350 OGRErr SetEckert(
int nVariation,
double dfCentralMeridian,
351 double dfFalseEasting,
double dfFalseNorthing );
353 OGRErr SetEckertIV(
double dfCentralMeridian,
354 double dfFalseEasting,
double dfFalseNorthing );
356 OGRErr SetEckertVI(
double dfCentralMeridian,
357 double dfFalseEasting,
double dfFalseNorthing );
360 OGRErr SetEquirectangular(
double dfCenterLat,
double dfCenterLong,
361 double dfFalseEasting,
double dfFalseNorthing );
363 OGRErr SetEquirectangular2(
double dfCenterLat,
double dfCenterLong,
364 double dfPseudoStdParallel1,
365 double dfFalseEasting,
double dfFalseNorthing );
368 OGRErr SetGEOS(
double dfCentralMeridian,
double dfSatelliteHeight,
369 double dfFalseEasting,
double dfFalseNorthing );
372 OGRErr SetGH(
double dfCentralMeridian,
373 double dfFalseEasting,
double dfFalseNorthing );
379 OGRErr SetGS(
double dfCentralMeridian,
380 double dfFalseEasting,
double dfFalseNorthing );
383 OGRErr SetGaussSchreiberTMercator(
double dfCenterLat,
double dfCenterLong,
385 double dfFalseEasting,
double dfFalseNorthing );
388 OGRErr SetGnomonic(
double dfCenterLat,
double dfCenterLong,
389 double dfFalseEasting,
double dfFalseNorthing );
392 OGRErr SetHOM(
double dfCenterLat,
double dfCenterLong,
393 double dfAzimuth,
double dfRectToSkew,
395 double dfFalseEasting,
double dfFalseNorthing );
397 OGRErr SetHOM2PNO(
double dfCenterLat,
398 double dfLat1,
double dfLong1,
399 double dfLat2,
double dfLong2,
401 double dfFalseEasting,
double dfFalseNorthing );
403 OGRErr SetOM(
double dfCenterLat,
double dfCenterLong,
404 double dfAzimuth,
double dfRectToSkew,
406 double dfFalseEasting,
double dfFalseNorthing );
409 OGRErr SetHOMAC(
double dfCenterLat,
double dfCenterLong,
410 double dfAzimuth,
double dfRectToSkew,
412 double dfFalseEasting,
double dfFalseNorthing );
415 OGRErr SetIWMPolyconic(
double dfLat1,
double dfLat2,
417 double dfFalseEasting,
418 double dfFalseNorthing );
421 OGRErr SetKrovak(
double dfCenterLat,
double dfCenterLong,
422 double dfAzimuth,
double dfPseudoStdParallelLat,
424 double dfFalseEasting,
double dfFalseNorthing );
427 OGRErr SetLAEA(
double dfCenterLat,
double dfCenterLong,
428 double dfFalseEasting,
double dfFalseNorthing );
431 OGRErr SetLCC(
double dfStdP1,
double dfStdP2,
432 double dfCenterLat,
double dfCenterLong,
433 double dfFalseEasting,
double dfFalseNorthing );
436 OGRErr SetLCC1SP(
double dfCenterLat,
double dfCenterLong,
438 double dfFalseEasting,
double dfFalseNorthing );
441 OGRErr SetLCCB(
double dfStdP1,
double dfStdP2,
442 double dfCenterLat,
double dfCenterLong,
443 double dfFalseEasting,
double dfFalseNorthing );
446 OGRErr SetMC(
double dfCenterLat,
double dfCenterLong,
447 double dfFalseEasting,
double dfFalseNorthing );
450 OGRErr SetMercator(
double dfCenterLat,
double dfCenterLong,
452 double dfFalseEasting,
double dfFalseNorthing );
454 OGRErr SetMercator2SP(
double dfStdP1,
455 double dfCenterLat,
double dfCenterLong,
456 double dfFalseEasting,
double dfFalseNorthing );
459 OGRErr SetMollweide(
double dfCentralMeridian,
460 double dfFalseEasting,
double dfFalseNorthing );
463 OGRErr SetNZMG(
double dfCenterLat,
double dfCenterLong,
464 double dfFalseEasting,
double dfFalseNorthing );
467 OGRErr SetOS(
double dfOriginLat,
double dfCMeridian,
469 double dfFalseEasting,
double dfFalseNorthing);
472 OGRErr SetOrthographic(
double dfCenterLat,
double dfCenterLong,
473 double dfFalseEasting,
double dfFalseNorthing);
476 OGRErr SetPolyconic(
double dfCenterLat,
double dfCenterLong,
477 double dfFalseEasting,
double dfFalseNorthing );
480 OGRErr SetPS(
double dfCenterLat,
double dfCenterLong,
482 double dfFalseEasting,
double dfFalseNorthing);
485 OGRErr SetRobinson(
double dfCenterLong,
486 double dfFalseEasting,
double dfFalseNorthing );
489 OGRErr SetSinusoidal(
double dfCenterLong,
490 double dfFalseEasting,
double dfFalseNorthing );
493 OGRErr SetStereographic(
double dfCenterLat,
double dfCenterLong,
495 double dfFalseEasting,
double dfFalseNorthing);
498 OGRErr SetSOC(
double dfLatitudeOfOrigin,
double dfCentralMeridian,
499 double dfFalseEasting,
double dfFalseNorthing );
502 OGRErr SetTM(
double dfCenterLat,
double dfCenterLong,
504 double dfFalseEasting,
double dfFalseNorthing );
507 OGRErr SetTMVariant(
const char *pszVariantName,
508 double dfCenterLat,
double dfCenterLong,
510 double dfFalseEasting,
double dfFalseNorthing );
513 OGRErr SetTMG(
double dfCenterLat,
double dfCenterLong,
514 double dfFalseEasting,
double dfFalseNorthing );
517 OGRErr SetTMSO(
double dfCenterLat,
double dfCenterLong,
519 double dfFalseEasting,
double dfFalseNorthing );
522 OGRErr SetTPED(
double dfLat1,
double dfLong1,
523 double dfLat2,
double dfLong2,
524 double dfFalseEasting,
double dfFalseNorthing );
527 OGRErr SetVDG(
double dfCenterLong,
528 double dfFalseEasting,
double dfFalseNorthing );
531 OGRErr SetUTM(
int nZone,
int bNorth = TRUE );
532 int GetUTMZone(
int *pbNorth = NULL )
const;
535 OGRErr SetWagner(
int nVariation,
double dfCenterLat,
536 double dfFalseEasting,
double dfFalseNorthing );
539 OGRErr SetStatePlane(
int nZone,
int bNAD83 = TRUE,
540 const char *pszOverrideUnitName = NULL,
541 double dfOverrideUnit = 0.0 );
543 OGRErr ImportFromESRIStatePlaneWKT(
544 int nCode,
const char* pszDatumName,
const char* pszUnitsName,
545 int nPCSCode,
const char* pszCSName = 0 );
546 OGRErr ImportFromESRIWisconsinWKT(
547 const char* pszPrjName,
double dfCentralMeridian,
double dfLatOfOrigin,
548 const char* pszUnitsName,
const char* pszCSName = 0 );
599 virtual int Transform(
int nCount,
600 double *x,
double *y,
double *z = NULL ) = 0;
617 virtual int TransformEx(
int nCount,
618 double *x,
double *y,
double *z = NULL,
619 int *pabSuccess = NULL ) = 0;