31 #ifndef _OGR_SPATIALREF_H_INCLUDED
32 #define _OGR_SPATIALREF_H_INCLUDED
68 int NeedsQuoting()
const;
69 OGRErr importFromWkt(
char **,
int nRecLevel,
int* pnNodes );
75 int IsLeafNode()
const {
return nChildren == 0; }
86 int FindChild(
const char * )
const;
87 void DestroyChild(
int );
89 void StripNodes(
const char * );
91 const char *
GetValue()
const {
return pszValue; }
92 void SetValue(
const char * );
95 OGRErr FixupOrdering();
99 OGRErr importFromWkt(
char ** );
100 OGRErr exportToWkt(
char ** )
const;
101 OGRErr exportToPrettyWkt(
char **,
int = 1)
const;
103 OGRErr applyRemapper(
const char *pszNode,
104 char **papszSrcValues,
105 char **papszDstValues,
107 int bChildOfHit = FALSE );
130 double dfFromGreenwich;
140 static OGRErr ValidateAuthority(
OGR_SRSNode *poRoot);
143 static OGRErr ValidateVertDatum(
OGR_SRSNode *poRoot);
144 static OGRErr ValidateProjection(
OGR_SRSNode* poRoot );
145 static int IsAliasFor(
const char *,
const char * );
146 void GetNormInfo()
const;
148 OGRErr importFromURNPart(
const char* pszAuthority,
170 OGRErr exportToWkt(
char ** )
const;
171 OGRErr exportToPrettyWkt(
char **,
int = FALSE)
const;
172 OGRErr exportToProj4(
char ** )
const;
173 OGRErr exportToPCI(
char **,
char **,
double ** )
const;
174 OGRErr exportToUSGS(
long *,
long *,
double **,
long * )
const;
175 OGRErr exportToXML(
char **,
const char * = NULL )
const;
176 OGRErr exportToPanorama(
long *,
long *,
long *,
long *,
178 OGRErr exportToERM(
char *pszProj,
char *pszDatum,
char *pszUnits );
179 OGRErr exportToMICoordSys(
char ** )
const;
181 OGRErr importFromWkt(
char ** );
182 OGRErr importFromProj4(
const char * );
183 OGRErr importFromEPSG(
int );
184 OGRErr importFromEPSGA(
int );
185 OGRErr importFromESRI(
char ** );
186 OGRErr importFromPCI(
const char *,
const char * = NULL,
188 #define USGS_ANGLE_DECIMALDEGREES 0
189 #define USGS_ANGLE_PACKEDDMS TRUE
190 #define USGS_ANGLE_RADIANS 2
191 OGRErr importFromUSGS(
long iProjSys,
long iZone,
192 double *padfPrjParams,
long iDatum,
193 int nUSGSAngleFormat = USGS_ANGLE_PACKEDDMS );
194 OGRErr importFromPanorama(
long,
long,
long,
double* );
195 OGRErr importFromOzi(
const char *,
const char *,
const char * );
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 SetStatePlane(
int nZone,
int bNAD83 = TRUE,
541 const char *pszOverrideUnitName = NULL,
542 double dfOverrideUnit = 0.0 );
544 OGRErr ImportFromESRIStatePlaneWKT(
545 int nCode,
const char* pszDatumName,
const char* pszUnitsName,
546 int nPCSCode,
const char* pszCSName = 0 );
547 OGRErr ImportFromESRIWisconsinWKT(
548 const char* pszPrjName,
double dfCentralMeridian,
double dfLatOfOrigin,
549 const char* pszUnitsName,
const char* pszCSName = 0 );
600 virtual int Transform(
int nCount,
601 double *x,
double *y,
double *z = NULL ) = 0;
618 virtual int TransformEx(
int nCount,
619 double *x,
double *y,
double *z = NULL,
620 int *pabSuccess = NULL ) = 0;