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;
357 static QStringList recentProjections();
367 static QString proj4FromSrsId(
const int theSrsId );
372 void setInternalId(
long theSrsId );
376 void setSrid(
long theSrid );
380 void setDescription( QString theDescription );
391 void setProj4String( QString theProj4String );
395 void setGeographicFlag(
bool theGeoFlag );
400 void setEpsg(
long theEpsg );
405 void setAuthId( QString theID );
409 void setProjectionAcronym( QString theProjectionAcronym );
413 void setEllipsoidAcronym( QString theEllipsoidAcronym );
420 typedef QMap<QString, QString> RecordMap;
427 RecordMap getRecord( QString theSql );
431 static int openDb( QString path,
sqlite3 **db,
bool readonly =
true );
436 QString mDescription;
438 QString mProjectionAcronym;
440 QString mEllipsoidAcronym;
456 long getRecordCount();
459 static QString quotedValue( QString value );
463 bool loadFromDb( QString db, QString expression, QString value );
465 QString mValidationHint;
466 mutable QString mWkt;
467 mutable QString mProj4;
469 static bool loadIDs( QHash<int, QString> &wkts );
470 static bool loadWkts( QHash<int, QString> &wkts,
const char *filename );
471 static bool syncDatumTransform(
const QString& dbPath );
474 mutable int mAxisInverted;
483 QString mySummary(
"\n\tSpatial Reference System:" );
484 mySummary +=
"\n\t\tDescription : ";
491 mySummary +=
"Undefined";
493 mySummary +=
"\n\t\tProjection : ";
500 mySummary +=
"Undefined";
503 mySummary +=
"\n\t\tEllipsoid : ";
510 mySummary +=
"Undefined";
513 mySummary +=
"\n\t\tProj4String : ";
520 mySummary +=
"Undefined";
523 return os << mySummary.toLocal8Bit().data() << std::endl;
526 #endif // QGSCOORDINATEREFERENCESYSTEM_H bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
std::ostream & operator<<(std::ostream &os, const QgsCoordinateReferenceSystem &r)
Output stream operator.
QString ellipsoidAcronym() const
QString projectionAcronym() const
Class for storing a coordinate reference system (CRS)
UnitType
Map units that qgis supports.
QString description() const
void(* CUSTOM_CRS_VALIDATION)(QgsCoordinateReferenceSystem &)
void * OGRSpatialReferenceH
QString toProj4() const
Get the Proj Proj4 string representation of this srs.