18 #ifndef QGSCOORDINATEREFERENCESYSTEM_H
19 #define QGSCOORDINATEREFERENCESYSTEM_H
90 bool createFromId(
const long theId, CrsType theType = PostgisCrsId );
99 bool createFromOgcWmsCrs( QString theCrs );
107 bool createFromSrid(
const long theSrid );
119 bool createFromWkt(
const QString &theWkt );
129 bool createFromSrsId(
const long theSrsId );
157 bool createFromProj4(
const QString &theProjString );
166 bool createFromString(
const QString &theDefinition );
181 bool createFromUserInput(
const QString &theDefinition );
191 static void setupESRIWktFix();
194 bool isValid()
const;
218 long findMatchingProj();
233 bool readXML( QDomNode & theNode );
251 bool writeXML( QDomNode & theNode, QDomDocument & theDoc )
const;
275 long postgisSrid()
const;
280 QString authid()
const;
286 QString description()
const;
292 QString projectionAcronym()
const;
298 QString ellipsoidAcronym()
const;
303 QString toWkt()
const;
312 QString toProj4()
const;
317 bool geographicFlag()
const;
322 bool axisInverted()
const;
333 void setValidationHint( QString html );
337 QString validationHint();
348 bool saveAsUserCRS( QString name );
351 QString geographicCRSAuthId()
const;
361 static QString proj4FromSrsId(
const int theSrsId );
366 void setInternalId(
long theSrsId );
370 void setSrid(
long theSrid );
374 void setDescription( QString theDescription );
385 void setProj4String( QString theProj4String );
389 void setGeographicFlag(
bool theGeoFlag );
394 void setEpsg(
long theEpsg );
399 void setAuthId( QString theID );
403 void setProjectionAcronym( QString theProjectionAcronym );
407 void setEllipsoidAcronym( QString theEllipsoidAcronym );
414 typedef QMap<QString, QString> RecordMap;
421 RecordMap getRecord( QString theSql );
425 static int openDb( QString path,
sqlite3 **db,
bool readonly =
true );
430 QString mDescription;
432 QString mProjectionAcronym;
434 QString mEllipsoidAcronym;
450 long getRecordCount();
453 static QString quotedValue( QString value );
457 bool loadFromDb( QString db, QString expression, QString value );
459 QString mValidationHint;
460 mutable QString mWkt;
461 mutable QString mProj4;
463 static bool loadIDs( QHash<int, QString> &wkts );
464 static bool loadWkts( QHash<int, QString> &wkts,
const char *filename );
465 static bool syncDatumTransform(
const QString& dbPath );
468 mutable int mAxisInverted;
477 QString mySummary(
"\n\tSpatial Reference System:" );
478 mySummary +=
"\n\t\tDescription : ";
485 mySummary +=
"Undefined";
487 mySummary +=
"\n\t\tProjection : ";
494 mySummary +=
"Undefined";
497 mySummary +=
"\n\t\tEllipsoid : ";
504 mySummary +=
"Undefined";
507 mySummary +=
"\n\t\tProj4String : ";
514 mySummary +=
"Undefined";
517 return os << mySummary.toLocal8Bit().data() << std::endl;
520 #endif // QGSCOORDINATEREFERENCESYSTEM_H