|
Quantum GIS API Documentation
master-693a1fe
|
00001 /*************************************************************************** 00002 qgscrscache.h 00003 -------------- 00004 begin : September 6th, 2011 00005 copyright : (C) 2011 by Marco Hugentobler 00006 email : marco dot hugentobler at sourcepole dot ch 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 #ifndef QGSCRSCACHE_H 00019 #define QGSCRSCACHE_H 00020 00021 #include "qgscoordinatereferencesystem.h" 00022 #include <QHash> 00023 00024 class QgsCoordinateTransform; 00025 00028 class CORE_EXPORT QgsCoordinateTransformCache 00029 { 00030 public: 00031 static QgsCoordinateTransformCache* instance(); 00032 ~QgsCoordinateTransformCache(); 00036 const QgsCoordinateTransform* transform( const QString& srcAuthId, const QString& destAuthId ); 00037 00038 private: 00039 static QgsCoordinateTransformCache* mInstance; 00040 QHash< QPair< QString, QString >, QgsCoordinateTransform* > mTransforms; 00041 }; 00042 00043 class CORE_EXPORT QgsCRSCache 00044 { 00045 public: 00046 static QgsCRSCache* instance(); 00047 ~QgsCRSCache(); 00049 const QgsCoordinateReferenceSystem& crsByAuthId( const QString& authid ); 00050 const QgsCoordinateReferenceSystem& crsByEpsgId( long epsg ); 00051 00052 protected: 00053 QgsCRSCache(); 00054 00055 private: 00056 static QgsCRSCache* mInstance; 00057 QHash< QString, QgsCoordinateReferenceSystem > mCRS; 00059 QgsCoordinateReferenceSystem mInvalidCRS; 00060 }; 00061 00062 #endif // QGSCRSCACHE_H