[QGIS Commit] r15246 - in trunk/qgis: python/core src/app src/app/gps src/core src/gui src/mapserver src/plugins/offline_editing src/providers/memory src/providers/wfs tests/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Feb 22 18:32:33 EST 2011


Author: jef
Date: 2011-02-22 15:32:33 -0800 (Tue, 22 Feb 2011)
New Revision: 15246

Modified:
   trunk/qgis/python/core/qgscoordinatereferencesystem.sip
   trunk/qgis/python/core/qgsdistancearea.sip
   trunk/qgis/src/app/gps/qgsgpsinformationwidget.cpp
   trunk/qgis/src/app/gps/qgsgpsmarker.cpp
   trunk/qgis/src/app/qgsprojectproperties.cpp
   trunk/qgis/src/app/qgsrasterlayerproperties.cpp
   trunk/qgis/src/app/qgsvectorlayerproperties.cpp
   trunk/qgis/src/core/qgscoordinatereferencesystem.cpp
   trunk/qgis/src/core/qgscoordinatereferencesystem.h
   trunk/qgis/src/core/qgsdistancearea.cpp
   trunk/qgis/src/core/qgsdistancearea.h
   trunk/qgis/src/gui/CMakeLists.txt
   trunk/qgis/src/gui/qgsgenericprojectionselector.cpp
   trunk/qgis/src/gui/qgsgenericprojectionselector.h
   trunk/qgis/src/gui/qgsprojectionselector.cpp
   trunk/qgis/src/gui/qgsprojectionselector.h
   trunk/qgis/src/mapserver/qgsconfigparser.cpp
   trunk/qgis/src/mapserver/qgsconfigparser.h
   trunk/qgis/src/mapserver/qgsepsgcache.cpp
   trunk/qgis/src/mapserver/qgshostedrdsbuilder.cpp
   trunk/qgis/src/mapserver/qgshostedvdsbuilder.cpp
   trunk/qgis/src/mapserver/qgsprojectparser.cpp
   trunk/qgis/src/mapserver/qgsprojectparser.h
   trunk/qgis/src/mapserver/qgssldparser.cpp
   trunk/qgis/src/plugins/offline_editing/offline_editing.cpp
   trunk/qgis/src/providers/memory/qgsmemoryprovider.cpp
   trunk/qgis/src/providers/wfs/qgswfsprovider.cpp
   trunk/qgis/tests/src/core/testqgscoordinatereferencesystem.cpp
Log:
deprecated special handling of EPSG - just one authority

Modified: trunk/qgis/python/core/qgscoordinatereferencesystem.sip
===================================================================
--- trunk/qgis/python/core/qgscoordinatereferencesystem.sip	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/python/core/qgscoordinatereferencesystem.sip	2011-02-22 23:32:33 UTC (rev 15246)
@@ -68,7 +68,7 @@
          * @note Any members will be overwritten during this process.
          * @note SRID and EpsgCrsId may be blank if no match can be found on srs db.
          * @param theWkt The Wkt for the desired spatial reference system.
-         * @return bool TRUE if sucess else false
+         * @return bool TRUE if success else false
          */
         bool createFromWkt(const QString theWkt);
         
@@ -86,9 +86,10 @@
          * and then the users ~/.qgis/qgis.db database will be checked for a match.
          * @note Any members will be overwritten during this process.
          * @param theEpsg The EpsgCrsId for the desired spatial reference system.
-         * @return bool TRUE if sucess else false
+         * @return bool TRUE if success else false
+         * @deprecated use createFromOgcWmsCrs()
          */
-        bool createFromEpsg(const long theEpsg);
+        bool createFromEpsg(const long theEpsg) /Deprecated/;
 
         /*! Set up this srs by fetching the appropriate information from the 
          * sqlite backend. If the srsid is < 100000, only the system srs.db 
@@ -96,7 +97,7 @@
          * the ~/.qgis/qgis.db
          * @note Any members will be overwritten during this process.
          * @param theSrsId The QGIS SrsId for the desired spatial reference system.
-         * @return bool TRUE if sucess else false
+         * @return bool TRUE if success else false
          */
         bool createFromSrsId (const long theSrsId);
 
@@ -127,7 +128,7 @@
          *    for this srs.
          *
          * @param theProjString A proj4 format string
-         * @return bool TRUE if sucess else false
+         * @return bool TRUE if success else false
          */
         bool createFromProj4 (const QString theProjString);
 
@@ -211,9 +212,10 @@
          */
         long postgisSrid () const;
         /*! Get the EpsgCrsId identifier for this srs
-         * @return  long theEpsg the ESPG identifier for this srs (defaults to 0)
+         * @return  long theEpsg the EPGG identifier for this srs (defaults to 0)
+         * @deprecated use authid()
          */
-        long epsg () const;
+        long epsg () const /Deprecated/;
         /*! Get the Description
          * @return  QString the Description A textual description of the srs.
          * @note A zero length string will be returned if the description is uninitialised

Modified: trunk/qgis/python/core/qgsdistancearea.sip
===================================================================
--- trunk/qgis/python/core/qgsdistancearea.sip	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/python/core/qgsdistancearea.sip	2011-02-22 23:32:33 UTC (rev 15246)
@@ -23,8 +23,12 @@
     void setSourceCrs(long srsid);
     
     //! sets source spatial reference system (by EpsgCrsId)
-    void setSourceEpsgCrsId(long epsgId);
+    // @deprecated use setSourceAuthid()
+    void setSourceEpsgCrsId(long epsgId) /Deprecated/;
 
+    //! sets source spatial reference system by authid
+    void setSourceAuthId( QString authid );
+
     //! returns source spatial reference system
     long sourceCrs();
     //! What sort of coordinate system is being used?

Modified: trunk/qgis/src/app/gps/qgsgpsinformationwidget.cpp
===================================================================
--- trunk/qgis/src/app/gps/qgsgpsinformationwidget.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/app/gps/qgsgpsinformationwidget.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -189,7 +189,7 @@
   }
   // Set up the rubber band to show digitising
   createRubberBand();
-  mWgs84CRS.createFromEpsg( 4326 );
+  mWgs84CRS.createFromOgcWmsCrs( "EPSG:4326" );
   //for now I am hiding accuracy and date widgets
   mDateTime->hide();
   mVerticalAccuracy->hide();

Modified: trunk/qgis/src/app/gps/qgsgpsmarker.cpp
===================================================================
--- trunk/qgis/src/app/gps/qgsgpsmarker.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/app/gps/qgsgpsmarker.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -27,7 +27,7 @@
     : QgsMapCanvasItem( mapCanvas )
 {
   mSize = 16;
-  mWgs84CRS.createFromEpsg( 4326 );
+  mWgs84CRS.createFromOgcWmsCrs( "EPSG:4326" );
 }
 
 void QgsGpsMarker::setSize( int theSize )

Modified: trunk/qgis/src/app/qgsprojectproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsprojectproperties.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/app/qgsprojectproperties.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -189,13 +189,30 @@
     mWMSExtMaxY->setText( values[3] );
   }
 
-  values = QgsProject::instance()->readListEntry( "WMSEpsgList", "/", &ok );
+  values = QgsProject::instance()->readListEntry( "WMSCrsList", "/", &ok );
   grpWMSList->setChecked( ok && values.size() > 0 );
   if ( grpWMSList->isChecked() )
   {
     mWMSList->addItems( values );
   }
+  else
+  {
+    values = QgsProject::instance()->readListEntry( "WMSEpsgList", "/", &ok );
+    grpWMSList->setChecked( ok && values.size() > 0 );
+    if ( grpWMSList->isChecked() )
+    {
+      QStringList list;
+      foreach( QString value, values )
+      {
+        list << QString( "EPSG:%1" ).arg( value );
+      }
 
+      mWMSList->addItems( list );
+    }
+  }
+
+  grpWMSList->setChecked( mWMSList->count() > 0 );
+
   restoreState();
 }
 
@@ -375,6 +392,8 @@
     grpWMSList->setChecked( false );
   }
 
+  QgsProject::instance()->removeEntry( "WMSEpsgList", "/" );
+
   if ( grpWMSList->isChecked() )
   {
     QStringList crslist;
@@ -383,11 +402,11 @@
       crslist << mWMSList->item( i )->text();
     }
 
-    QgsProject::instance()->writeEntry( "WMSEpsgList", "/", crslist );
+    QgsProject::instance()->writeEntry( "WMSCrsList", "/", crslist );
   }
   else
   {
-    QgsProject::instance()->removeEntry( "WMSEpsgList", "/" );
+    QgsProject::instance()->removeEntry( "WMSCrsList", "/" );
   }
 
   //todo XXX set canvas color
@@ -498,23 +517,16 @@
   mySelector->setMessage();
   if ( mySelector->exec() )
   {
-    long crs = mySelector->selectedEpsg();
+    QString authid = mySelector->selectedAuthId();
 
-    if ( crs > 0 )
+    QList<QListWidgetItem *> items = mWMSList->findItems( authid.mid( 5 ), Qt::MatchFixedString );
+    if ( items.size() == 0 )
     {
-      QList<QListWidgetItem *> items = mWMSList->findItems( QString::number( crs ), Qt::MatchFixedString );
-      if ( items.size() == 0 )
-      {
-        mWMSList->addItem( QString::number( crs ) );
-      }
-      else
-      {
-        QMessageBox::information( this, tr( "Coordinate System Restriction" ), tr( "CRS %1 was already selected" ).arg( crs ) );
-      }
+      mWMSList->addItem( authid );
     }
     else
     {
-      QMessageBox::information( this, tr( "Coordinate System Restriction" ), tr( "Selected CRS is not a EPSG coordinate system." ) );
+      QMessageBox::information( this, tr( "Coordinate System Restriction" ), tr( "CRS %1 was already selected" ).arg( authid ) );
     }
   }
 
@@ -542,16 +554,13 @@
   if ( cbxProjectionEnabled->isChecked() )
   {
     QgsCoordinateReferenceSystem srs( projectionSelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
-    if ( srs.epsg() > 0 )
-      crsList << QString::number( srs.epsg() );
+    crsList << srs.authid();
   }
 
   const QMap<QString, QgsMapLayer*> &mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
   for ( QMap<QString, QgsMapLayer*>::const_iterator it = mapLayers.constBegin(); it != mapLayers.constEnd(); it++ )
   {
-    long crs = it.value()->crs().epsg();
-    if ( crs > 0 )
-      crsList << QString::number( crs );
+    crsList << it.value()->crs().authid();
   }
 
   mWMSList->clear();

Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -250,7 +250,7 @@
     tabPageHistogram->setEnabled( false );
   }
 
-  leSpatialRefSys->setText( "EPSG:" + QString::number( mRasterLayer->crs().epsg() ) + " - " + mRasterLayer->crs().description() );
+  leSpatialRefSys->setText( mRasterLayer->crs().authid() + " - " + mRasterLayer->crs().description() );
   leSpatialRefSys->setCursorPosition( 0 );
 
   // Set text for pyramid info box
@@ -1640,7 +1640,7 @@
   }
   delete mySelector;
 
-  leSpatialRefSys->setText( "EPSG:" + QString::number( mRasterLayer->crs().epsg() ) + " - " + mRasterLayer->crs().description() );
+  leSpatialRefSys->setText( mRasterLayer->crs().authid() + " - " + mRasterLayer->crs().description() );
   leSpatialRefSys->setCursorPosition( 0 );
 }
 

Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -127,7 +127,7 @@
 
   updateButtons();
 
-  leSpatialRefSys->setText( "EPSG:" + QString::number( layer->crs().epsg() ) + " - " + layer->crs().description() );
+  leSpatialRefSys->setText( layer->crs().authid() + " - " + layer->crs().description() );
   leSpatialRefSys->setCursorPosition( 0 );
 
   leEditForm->setText( layer->editForm() );
@@ -989,7 +989,7 @@
   }
   delete mySelector;
 
-  leSpatialRefSys->setText( "EPSG:" + QString::number( layer->crs().epsg() ) + " - " + layer->crs().description() );
+  leSpatialRefSys->setText( layer->crs().authid() + " - " + layer->crs().description() );
   leSpatialRefSys->setCursorPosition( 0 );
 }
 

Modified: trunk/qgis/src/core/qgscoordinatereferencesystem.cpp
===================================================================
--- trunk/qgis/src/core/qgscoordinatereferencesystem.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/core/qgscoordinatereferencesystem.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -87,7 +87,7 @@
       result = createFromSrid( theId );
       break;
     case EpsgCrsId:
-      result = createFromEpsg( theId );
+      result = createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( theId ) );
       break;
     default:
       //THIS IS BAD...THIS PART OF CODE SHOULD NEVER BE REACHED...
@@ -993,7 +993,7 @@
     {
       myNode = srsNode.namedItem( "epsg" );
       if ( !myNode.isNull() )
-        initialized = createFromEpsg( myNode.toElement().text().toLong() );
+        initialized = createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( myNode.toElement().text().toLong() ) );
     }
 
     if ( initialized )

Modified: trunk/qgis/src/core/qgscoordinatereferencesystem.h
===================================================================
--- trunk/qgis/src/core/qgscoordinatereferencesystem.h	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/core/qgscoordinatereferencesystem.h	2011-02-22 23:32:33 UTC (rev 15246)
@@ -109,7 +109,7 @@
      * @note Any members will be overwritten during this process.
      * @note SRID and EpsgCrsId may be blank if no match can be found on srs db.
      * @param theWkt The Wkt for the desired spatial reference system.
-     * @return bool TRUE if sucess else false
+     * @return bool TRUE if success else false
      */
     bool createFromWkt( const QString theWkt );
 
@@ -118,9 +118,10 @@
      * and then the users ~/.qgis/qgis.db database will be checked for a match.
      * @note Any members will be overwritten during this process.
      * @param theEpsg The EpsgCrsId for the desired spatial reference system.
-     * @return bool TRUE if sucess else false
+     * @return bool TRUE if success else false
+     * @deprecated use createFromOgcWmsCrs()
      */
-    bool createFromEpsg( const long theEpsg );
+    QGISDEPRECATED bool createFromEpsg( const long theEpsg );
 
     /*! Set up this srs by fetching the appropriate information from the
      * sqlite backend. If the srsid is < 100000, only the system srs.db
@@ -128,7 +129,7 @@
      * the ~/.qgis/qgis.db
      * @note Any members will be overwritten during this process.
      * @param theSrsId The QGIS SrsId for the desired spatial reference system.
-     * @return bool TRUE if sucess else false
+     * @return bool TRUE if success else false
      */
     bool createFromSrsId( const long theSrsId );
 
@@ -159,7 +160,7 @@
      *    for this srs.
      *
      * @param theProjString A proj4 format string
-     * @return bool TRUE if sucess else false
+     * @return bool TRUE if success else false
      */
     bool createFromProj4( const QString theProjString );
 
@@ -262,8 +263,9 @@
 
     /*! Get the EpsgCrsId identifier for this srs
      * @return  long theEpsg the EPSG identifier for this srs (defaults to 0)
+     * @deprecated there are other authorities - use authid()
      */
-    long epsg() const;
+    QGISDEPRECATED long epsg() const;
 
     /*! Get the authority identifier for this srs
      * @return  QString the Authority identifier for this srs

Modified: trunk/qgis/src/core/qgsdistancearea.cpp
===================================================================
--- trunk/qgis/src/core/qgsdistancearea.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/core/qgsdistancearea.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -69,10 +69,17 @@
 void QgsDistanceArea::setSourceEpsgCrsId( long epsgId )
 {
   QgsCoordinateReferenceSystem srcCRS;
-  srcCRS.createFromEpsg( epsgId );
+  srcCRS.createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( epsgId ) );
   mCoordTransform->setSourceCrs( srcCRS );
 }
 
+void QgsDistanceArea::setSourceAuthId( QString authId )
+{
+  QgsCoordinateReferenceSystem srcCRS;
+  srcCRS.createFromOgcWmsCrs( authId );
+  mCoordTransform->setSourceCrs( srcCRS );
+}
+
 bool QgsDistanceArea::setEllipsoid( const QString& ellipsoid )
 {
   QString radius, parameter2;

Modified: trunk/qgis/src/core/qgsdistancearea.h
===================================================================
--- trunk/qgis/src/core/qgsdistancearea.h	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/core/qgsdistancearea.h	2011-02-22 23:32:33 UTC (rev 15246)
@@ -51,8 +51,11 @@
     void setSourceCrs( long srsid );
 
     //! sets source spatial reference system (by EpsgCrsId)
-    void setSourceEpsgCrsId( long epsgId );
+    QGISDEPRECATED void setSourceEpsgCrsId( long epsgId );
 
+    //! sets source spatial reference system by authid
+    void setSourceAuthId( QString authid );
+
     //! returns source spatial reference system
     long sourceCrs() { return mSourceRefSys; }
     //! What sort of coordinate system is being used?

Modified: trunk/qgis/src/gui/CMakeLists.txt
===================================================================
--- trunk/qgis/src/gui/CMakeLists.txt	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/gui/CMakeLists.txt	2011-02-22 23:32:33 UTC (rev 15246)
@@ -137,11 +137,19 @@
   ENDIF (MSVC)
 ENDIF (WIN32)
 
-# disable deprecation warnings for qgisinterface (re-exporting deprecated methods)
+# disable deprecation warnings for classes re-exporting deprecated methods
 IF(MSVC)
-  SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/src/gui/moc_qgisinterface.cxx PROPERTIES COMPILE_FLAGS "-wd4996")
+  SET_SOURCE_FILES_PROPERTIES(
+    ${CMAKE_BINARY_DIR}/src/gui/moc_qgisinterface.cxx
+    ${CMAKE_BINARY_DIR}/src/gui/moc_qgsgenericprojectionselector.cxx
+    ${CMAKE_BINARY_DIR}/src/gui/moc_qgsprojectionselector.cxx
+    PROPERTIES COMPILE_FLAGS "-wd4996")
 ELSE(MSVC)
-  SET_SOURCE_FILES_PROPERTIES(${CMAKE_BINARY_DIR}/src/gui/moc_qgisinterface.cxx PROPERTIES COMPILE_FLAGS "-w")
+  SET_SOURCE_FILES_PROPERTIES(
+    ${CMAKE_BINARY_DIR}/src/gui/moc_qgisinterface.cxx
+    ${CMAKE_BINARY_DIR}/src/gui/moc_qgsgenericprojectionselector.cxx
+    ${CMAKE_BINARY_DIR}/src/gui/moc_qgsprojectionselector.cxx
+    PROPERTIES COMPILE_FLAGS "-w")
 ENDIF(MSVC)
 
 #############################################################

Modified: trunk/qgis/src/gui/qgsgenericprojectionselector.cpp
===================================================================
--- trunk/qgis/src/gui/qgsgenericprojectionselector.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/gui/qgsgenericprojectionselector.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -60,7 +60,7 @@
 
 void QgsGenericProjectionSelector::setSelectedEpsg( long theId )
 {
-  projectionSelector->setSelectedEpsg( theId );
+  projectionSelector->setSelectedAuthId( QString( "EPSG:%1" ).arg( theId ) );
 }
 
 void QgsGenericProjectionSelector::setSelectedCrsName( QString theName )
@@ -92,7 +92,11 @@
 
 long QgsGenericProjectionSelector::selectedEpsg()
 {
-  return projectionSelector->selectedEpsg();
+  QString authid = projectionSelector->selectedAuthId();
+  if ( authid.startsWith( "EPSG:", Qt::CaseInsensitive ) )
+    return authid.mid( 5 ).toLong();
+  else
+    return 0;
 }
 
 QString QgsGenericProjectionSelector::selectedAuthId()

Modified: trunk/qgis/src/gui/qgsgenericprojectionselector.h
===================================================================
--- trunk/qgis/src/gui/qgsgenericprojectionselector.h	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/gui/qgsgenericprojectionselector.h	2011-02-22 23:32:33 UTC (rev 15246)
@@ -64,11 +64,19 @@
     QString selectedProj4String();
     long selectedCrsId();
     QString selectedAuthId();
+
+#ifndef Q_MOC_RUN
+    QGISDEPRECATED
+#endif
     long selectedEpsg();
 
     void setSelectedCrsName( QString theName );
     void setSelectedCrsId( long theID );
     void setSelectedAuthId( QString authId );
+
+#ifndef Q_MOC_RUN
+    QGISDEPRECATED
+#endif
     void setSelectedEpsg( long theID );
 
     /**

Modified: trunk/qgis/src/gui/qgsprojectionselector.cpp
===================================================================
--- trunk/qgis/src/gui/qgsprojectionselector.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/gui/qgsprojectionselector.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -66,18 +66,19 @@
   /*** The reading (above) of internal id from persistent storage should be removed sometime in the future */
   /*** This is kept now for backwards compatibility */
 
-  QStringList projectionsEpsg  = settings.value( "/UI/recentProjectionsEpsg" ).toStringList();
-  QStringList projectionsProj4 = settings.value( "/UI/recentProjectionsProj4" ).toStringList();
-  if ( projectionsEpsg.size() >= mRecentProjections.size() )
+  QStringList projectionsProj4  = settings.value( "/UI/recentProjectionsProj4" ).toStringList();
+  QStringList projectionsAuthId = settings.value( "/UI/recentProjectionsAuthId" ).toStringList();
+  if ( projectionsAuthId.size() >= mRecentProjections.size() )
   {
-    // We had saved state with EPSG and Proj4. Use that instead
-    // to find out the csr id
-    QgsDebugMsg( "Use popular projection list from EPSG/Proj4 saved state" );
+    // We had saved state with AuthId and Proj4. Use that instead
+    // to find out the crs id
+    QgsDebugMsg( "Use popular projection list from AuthId/Proj4 saved state" );
     mRecentProjections.clear();
-    for ( int i = 0; i <  projectionsEpsg.size(); i++ )
+    for ( int i = 0; i <  projectionsAuthId.size(); i++ )
     {
       // Create a crs from the EPSG
-      QgsCoordinateReferenceSystem crs( projectionsEpsg.at( i ).toLong(), QgsCoordinateReferenceSystem::EpsgCrsId );
+      QgsCoordinateReferenceSystem crs;
+      crs.createFromOgcWmsCrs( projectionsAuthId.at( i ) );
       if ( ! crs.isValid() )
       {
         // Couldn't create from EPSG, try the Proj4 string instead
@@ -113,10 +114,10 @@
     // Save to file *** Should be removed sometims in the future ***
     settings.setValue( "/UI/recentProjections", mRecentProjections );
 
-    // Convert to EPGS and proj4, and save those values also
+    // Convert to EPSG and proj4, and save those values also
 
-    QStringList projectionsEpsg;
     QStringList projectionsProj4;
+    QStringList projectionsAuthId;
     for ( int i = 0; i <  mRecentProjections.size(); i++ )
     {
       // Create a crs from the crsId
@@ -126,11 +127,11 @@
         // No? Skip this entry
         continue;
       }
-      projectionsEpsg  << QString::number( crs.epsg() );
       projectionsProj4 << crs.toProj4();
+      projectionsAuthId << crs.authid();
     }
-    settings.setValue( "/UI/recentProjectionsEpsg", projectionsEpsg );
     settings.setValue( "/UI/recentProjectionsProj4", projectionsProj4 );
+    settings.setValue( "/UI/recentProjectionsAuthId", projectionsAuthId );
   }
 }
 

Modified: trunk/qgis/src/gui/qgsprojectionselector.h
===================================================================
--- trunk/qgis/src/gui/qgsprojectionselector.h	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/gui/qgsprojectionselector.h	2011-02-22 23:32:33 UTC (rev 15246)
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   qgsprojectionselector.h
+ *   qgsprojectionselector.h                                               *
  *   Copyright (C) 2005 by Tim Sutton                                      *
  *   tim at linfiniti.com                                                     *
  *                                                                         *
@@ -16,6 +16,8 @@
 #include <QSet>
 #include <QStringList>
 
+#include "qgis.h"
+
 class QResizeEvent;
 
 /** \ingroup gui
@@ -68,7 +70,8 @@
     const QString sqlSafeString( const QString theSQL );
 
     //! Gets the current EpsgCrsId-style projection identifier
-    long selectedEpsg();
+    // @deprecated there are other authorities - use selectedAuthId()
+    QGISDEPRECATED long selectedEpsg();
 
     //! Gets the current InternalCrsId-style projection identifier
     long selectedSrsid();
@@ -85,6 +88,11 @@
 
     void setSelectedAuthId( QString authId );
 
+    //! Get the selected coordinate system
+    // @deprecated there are other authorities - so not always defined
+#ifndef Q_MOC_RUN
+    QGISDEPRECATED
+#endif
     void setSelectedEpsg( long epsg );
 
     QString selectedProj4String();

Modified: trunk/qgis/src/mapserver/qgsconfigparser.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgsconfigparser.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/mapserver/qgsconfigparser.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -79,7 +79,7 @@
   }
 
   QgsCoordinateReferenceSystem wgs84;
-  wgs84.createFromEpsg( 4326 );
+  wgs84.createFromOgcWmsCrs( "EPSG:4326" );
 
   //Ex_GeographicBoundingBox
   //transform the layers native CRS into WGS84
@@ -109,7 +109,7 @@
   QDomElement bBoxElement = doc.createElement( "BoundingBox" );
   if ( layerCRS.isValid() )
   {
-    bBoxElement.setAttribute( "CRS", "EPSG:" + QString::number( layerCRS.epsg() ) );
+    bBoxElement.setAttribute( "CRS", layerCRS.authid() );
   }
 
   bBoxElement.setAttribute( "minx", QString::number( layerExtent.xMinimum() ) );
@@ -119,9 +119,9 @@
   layerElem.appendChild( bBoxElement );
 }
 
-QList<int> QgsConfigParser::createCRSListForLayer( QgsMapLayer* theMapLayer ) const
+QStringList QgsConfigParser::createCRSListForLayer( QgsMapLayer* theMapLayer ) const
 {
-  QList<int> epsgNumbers;
+  QStringList crsNumbers;
   QgsVectorLayer* theVectorLayer = dynamic_cast<QgsVectorLayer*>( theMapLayer );
 
   if ( theVectorLayer ) //append the source SRS. In future, all systems supported by proj4 should be appended
@@ -137,16 +137,16 @@
     if ( myResult )
     {
       //if the database cannot be opened, add at least the epsg number of the source coordinate system
-      epsgNumbers.push_back( theMapLayer->srs().epsg() );
-      return epsgNumbers;
+      crsNumbers.push_back( theMapLayer->srs().authid() );
+      return crsNumbers;
     };
-    QString mySql = "select auth_id from tbl_srs where auth_name='EPSG' ";
+    QString mySql = "select upper(auth_name||':'||auth_id) from tbl_srs";
     myResult = sqlite3_prepare( myDatabase, mySql.toUtf8(), mySql.length(), &myPreparedStatement, &myTail );
     if ( myResult == SQLITE_OK )
     {
       while ( sqlite3_step( myPreparedStatement ) == SQLITE_ROW )
       {
-        epsgNumbers.push_back( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 0 ) ).toLong() );
+        crsNumbers.push_back( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 0 ) ) );
       }
     }
     sqlite3_finalize( myPreparedStatement );
@@ -154,10 +154,9 @@
   }
   else //rasters cannot be reprojected. Use the epsg number of the layers native CRS
   {
-    int rasterEpsg = theMapLayer->srs().epsg();
-    epsgNumbers.push_back( rasterEpsg );
+    crsNumbers.push_back( theMapLayer->srs().authid() );
   }
-  return epsgNumbers;
+  return crsNumbers;
 }
 
 bool QgsConfigParser::exGeographicBoundingBox( const QDomElement& layerElement, QgsRectangle& rect ) const
@@ -227,7 +226,7 @@
   return true;
 }
 
-bool QgsConfigParser::crsSetForLayer( const QDomElement& layerElement, QSet<int>& crsSet ) const
+bool QgsConfigParser::crsSetForLayer( const QDomElement& layerElement, QSet<QString> &crsSet ) const
 {
   if ( layerElement.isNull() )
   {
@@ -235,22 +234,17 @@
   }
 
   crsSet.clear();
-  bool intConversionOk;
 
   QDomNodeList crsNodeList = layerElement.elementsByTagName( "CRS" );
   for ( int i = 0; i < crsNodeList.size(); ++i )
   {
-    int epsg = crsNodeList.at( i ).toElement().text().remove( 0, 5 ).toInt( &intConversionOk );
-    if ( intConversionOk )
-    {
-      crsSet.insert( epsg );
-    }
+    crsSet.insert( crsNodeList.at( i ).toElement().text() );
   }
 
   return true;
 }
 
-void QgsConfigParser::appendCRSElementsToLayer( QDomElement& layerElement, QDomDocument& doc, const QList<int>& crsList ) const
+void QgsConfigParser::appendCRSElementsToLayer( QDomElement& layerElement, QDomDocument& doc, const QStringList &crsList ) const
 {
   if ( layerElement.isNull() )
   {
@@ -258,18 +252,18 @@
   }
 
   //In case the number of advertised CRS is constrained
-  QSet<int> epsgSet = supportedOutputCrsSet();
+  QSet<QString> crsSet = supportedOutputCrsSet();
 
-  QList<int>::const_iterator crsIt = crsList.constBegin();
+  QStringList::const_iterator crsIt = crsList.constBegin();
   for ( ; crsIt != crsList.constEnd(); ++crsIt )
   {
-    if ( !epsgSet.isEmpty() && !epsgSet.contains( *crsIt ) ) //consider epsg output constraint
+    if ( !crsSet.isEmpty() && !crsSet.contains( *crsIt ) ) //consider epsg output constraint
     {
       continue;
     }
     QDomElement crsElement = doc.createElement( "CRS" );
-    QDomText epsgText = doc.createTextNode( "EPSG:" + QString::number( *crsIt ) );
-    crsElement.appendChild( epsgText );
+    QDomText crsText = doc.createTextNode( *crsIt );
+    crsElement.appendChild( crsText );
     layerElement.appendChild( crsElement );
   }
 }

Modified: trunk/qgis/src/mapserver/qgsconfigparser.h
===================================================================
--- trunk/qgis/src/mapserver/qgsconfigparser.h	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/mapserver/qgsconfigparser.h	2011-02-22 23:32:33 UTC (rev 15246)
@@ -83,7 +83,7 @@
 
     /**Returns a set of supported epsg codes for the capabilities document. An empty set means
        that all possible CRS should be advertised (which could result in very long capabilities documents)*/
-    virtual QSet<int> supportedOutputCrsSet() const { return QSet<int>(); }
+    virtual QSet<QString> supportedOutputCrsSet() const { return QSet<QString>(); }
 
     /**Returns information about vector layer aliases. First key is the layer id, (second) key is the field id, value the alias.
        Default implementation returns an empty map*/
@@ -139,13 +139,13 @@
     bool exGeographicBoundingBox( const QDomElement& layerElement, QgsRectangle& rect ) const;
 
     /**Returns a list of supported EPSG coordinate system numbers from a layer*/
-    QList<int> createCRSListForLayer( QgsMapLayer* theMapLayer ) const;
+    QStringList createCRSListForLayer( QgsMapLayer* theMapLayer ) const;
     /**Reads all the epsg numbers from a capabilities layer
     @param layerElement <Layer> element in capabilities
     @param crsSet out: set containing the epsg numbers on successfull completion
     @return true in case of success*/
-    bool crsSetForLayer( const QDomElement& layerElement, QSet<int>& crsSet ) const;
-    void appendCRSElementsToLayer( QDomElement& layerElement, QDomDocument& doc, const QList<int>& crsList ) const;
+    bool crsSetForLayer( const QDomElement& layerElement, QSet<QString> &crsSet ) const;
+    void appendCRSElementsToLayer( QDomElement& layerElement, QDomDocument& doc, const QStringList &crsList ) const;
 
     void setDefaultLegendSettings();
 };

Modified: trunk/qgis/src/mapserver/qgsepsgcache.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgsepsgcache.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/mapserver/qgsepsgcache.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -43,7 +43,7 @@
   if ( crsIt == mCRS.constEnd() )
   {
     QgsCoordinateReferenceSystem s;
-    if ( ! s.createFromEpsg( epsg ) )
+    if ( ! s.createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( epsg ) ) )
     {
       return mInvalidCRS;
     }

Modified: trunk/qgis/src/mapserver/qgshostedrdsbuilder.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgshostedrdsbuilder.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/mapserver/qgshostedrdsbuilder.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -84,7 +84,7 @@
         {
           //set spatial ref sys
           QgsCoordinateReferenceSystem srs;
-          srs.createFromEpsg( epsgnr );
+          srs.createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( epsgnr ) );
           rl->setCrs( srs );
         }
       }

Modified: trunk/qgis/src/mapserver/qgshostedvdsbuilder.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgshostedvdsbuilder.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/mapserver/qgshostedvdsbuilder.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -90,7 +90,7 @@
       {
         //set spatial ref sys
         QgsCoordinateReferenceSystem srs;
-        srs.createFromEpsg( epsgnr );
+        srs.createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( epsgnr ) );
         ml->setCrs( srs );
       }
     }

Modified: trunk/qgis/src/mapserver/qgsprojectparser.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgsprojectparser.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/mapserver/qgsprojectparser.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -96,12 +96,8 @@
   QgsCoordinateReferenceSystem mapCRS;
   if ( !mapExtent.isEmpty() )
   {
-    int epsg = mapEpsg();
-    if ( epsg != -1 )
-    {
-      mapCRS.createFromEpsg( epsg );
-      appendExGeographicBoundingBox( layerParentElem, doc, mapExtent, mapCRS );
-    }
+    mapCRS.createFromOgcWmsCrs( mapAuthid() );
+    appendExGeographicBoundingBox( layerParentElem, doc, mapExtent, mapCRS );
   }
 
   QDomElement legendElem = mXMLDoc->documentElement().firstChildElement( "legend" );
@@ -144,7 +140,7 @@
       // combine bounding boxes of childs (groups/layers)
 
       QgsRectangle combinedGeographicBBox;
-      QSet<int> combinedCRSSet;
+      QSet<QString> combinedCRSSet;
       bool firstBBox = true;
       bool firstCRSSet = true;
 
@@ -171,7 +167,7 @@
         }
 
         //combine crs set
-        QSet<int> crsSet;
+        QSet<QString> crsSet;
         if ( crsSetForLayer( childElem, crsSet ) )
         {
           if ( firstCRSSet )
@@ -233,7 +229,7 @@
       layerElem.appendChild( abstractElem );
 
       //CRS
-      QList<int> crsList = createCRSListForLayer( currentLayer );
+      QStringList crsList = createCRSListForLayer( currentLayer );
       appendCRSElementsToLayer( layerElem, doc, crsList );
 
       //Ex_GeographicBoundingBox
@@ -406,40 +402,53 @@
   return disabledList;
 }
 
-QSet<int> QgsProjectParser::supportedOutputCrsSet() const
+QSet<QString> QgsProjectParser::supportedOutputCrsSet() const
 {
-  QSet<int> epsgSet;
+  QSet<QString> crsSet;
   if ( !mXMLDoc )
   {
-    return epsgSet;
+    return crsSet;
   }
 
   QDomElement qgisElem = mXMLDoc->documentElement();
   if ( qgisElem.isNull() )
   {
-    return epsgSet;
+    return crsSet;
   }
   QDomElement propertiesElem = qgisElem.firstChildElement( "properties" );
   if ( propertiesElem.isNull() )
   {
-    return epsgSet;
+    return crsSet;
   }
-  QDomElement wmsEpsgElem = propertiesElem.firstChildElement( "WMSEpsgList" );
-  if ( wmsEpsgElem.isNull() )
+  QDomElement wmsCrsElem = propertiesElem.firstChildElement( "WMSCrsList" );
+  if ( !wmsCrsElem.isNull() )
   {
-    return epsgSet;
+    QDomNodeList valueList = wmsCrsElem.elementsByTagName( "value" );
+    for ( int i = 0; i < valueList.size(); ++i )
+    {
+      crsSet.insert( valueList.at( i ).toElement().text() );
+    }
   }
-  QDomNodeList valueList = wmsEpsgElem.elementsByTagName( "value" );
-  bool conversionOk;
-  for ( int i = 0; i < valueList.size(); ++i )
+  else
   {
-    int epsgNr = valueList.at( i ).toElement().text().toInt( &conversionOk );
-    if ( conversionOk )
+    QDomElement wmsEpsgElem = propertiesElem.firstChildElement( "WMSEpsgList" );
+    if ( wmsEpsgElem.isNull() )
     {
-      epsgSet.insert( epsgNr );
+      return crsSet;
     }
+    QDomNodeList valueList = wmsEpsgElem.elementsByTagName( "value" );
+    bool conversionOk;
+    for ( int i = 0; i < valueList.size(); ++i )
+    {
+      int epsgNr = valueList.at( i ).toElement().text().toInt( &conversionOk );
+      if ( conversionOk )
+      {
+        crsSet.insert( QString( "EPSG:%1" ).arg( epsgNr ) );
+      }
+    }
   }
-  return epsgSet;
+
+  return crsSet;
 }
 
 QMap< QString, QMap< int, QString > > QgsProjectParser::layerAliasInfo() const
@@ -538,43 +547,38 @@
   return QgsRectangle( xmin, ymin, xmax, ymax );
 }
 
-int QgsProjectParser::mapEpsg() const
+QString QgsProjectParser::mapAuthid() const
 {
   if ( !mXMLDoc )
   {
-    return -1;
+    return QString::null;
   }
 
   QDomElement qgisElem = mXMLDoc->documentElement();
   if ( qgisElem.isNull() )
   {
-    return -1;
+    return QString::null;
   }
 
   QDomElement mapCanvasElem = qgisElem.firstChildElement( "mapcanvas" );
   if ( mapCanvasElem.isNull() )
   {
-    return -1;
+    return QString::null;
   }
 
   QDomElement srsElem = mapCanvasElem.firstChildElement( "destinationsrs" );
   if ( srsElem.isNull() )
   {
-    return -1;
+    return QString::null;
   }
 
   QDomNodeList authIdNodes = srsElem.elementsByTagName( "authid" );
   if ( authIdNodes.size() < 1 )
   {
-    return -1;
+    return QString::null;
   }
 
-  QStringList authIdSplit = authIdNodes.at( 0 ).toElement().text().split( ":" );
-  if ( authIdSplit.size() < 2 )
-  {
-    return -1;
-  }
-  return authIdSplit.at( 1 ).toInt();
+  return authIdNodes.at( 0 ).toElement().text();
 }
 
 QString QgsProjectParser::projectTitle() const

Modified: trunk/qgis/src/mapserver/qgsprojectparser.h
===================================================================
--- trunk/qgis/src/mapserver/qgsprojectparser.h	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/mapserver/qgsprojectparser.h	2011-02-22 23:32:33 UTC (rev 15246)
@@ -67,7 +67,7 @@
           </WMSEpsgList>
       </properties>
     */
-    virtual QSet<int> supportedOutputCrsSet() const;
+    virtual QSet<QString> supportedOutputCrsSet() const;
 
     /**Returns information about vector layer aliases. First key is the layer id, (second) key is the field id, value the alias.
        Default implementation returns an empty map*/
@@ -79,8 +79,8 @@
     /**Returns map rectangle for the project file*/
     QgsRectangle mapRectangle() const;
 
-    /**Returns epsg number of the project crs (or -1 in case of error)*/
-    int mapEpsg() const;
+    /**Returns epsg number of the project crs (or Null in case of error)*/
+    QString mapAuthid() const;
 
     /**Return project title*/
     QString projectTitle() const;

Modified: trunk/qgis/src/mapserver/qgssldparser.cpp
===================================================================
--- trunk/qgis/src/mapserver/qgssldparser.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/mapserver/qgssldparser.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -209,8 +209,8 @@
         }
 
         //append geographic bbox and the CRS elements
-        QList<int> epsgNumbers = createCRSListForLayer( theMapLayer );
-        appendCRSElementsToLayer( layerElement, doc, epsgNumbers );
+        QStringList crsNumbers = createCRSListForLayer( theMapLayer );
+        appendCRSElementsToLayer( layerElement, doc, crsNumbers );
         appendExGeographicBoundingBox( layerElement, doc, theMapLayer->extent(), theMapLayer->srs() );
 
         //iterate over all <UserStyle> nodes within a user layer
@@ -1519,7 +1519,7 @@
     {
       //set spatial ref sys
       QgsCoordinateReferenceSystem srs;
-      srs.createFromEpsg( epsgnr );
+      srs.createFromOgcWmsCrs( QString( "EPSG:%1" ).arg( epsgnr ) );
       ml->setCrs( srs );
     }
   }

Modified: trunk/qgis/src/plugins/offline_editing/offline_editing.cpp
===================================================================
--- trunk/qgis/src/plugins/offline_editing/offline_editing.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/plugins/offline_editing/offline_editing.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -460,7 +460,7 @@
   };
   QString sqlAddGeom = QString( "SELECT AddGeometryColumn('%1', 'Geometry', %2, '%3', 2)" )
                        .arg( tableName )
-                       .arg( layer->crs().epsg() )
+                       .arg( layer->crs().authid().startsWith( "EPSG:", Qt::CaseInsensitive ) ? layer->crs().authid().mid( 5 ).toLong() : 0 )
                        .arg( geomType );
 
   // create spatial index

Modified: trunk/qgis/src/providers/memory/qgsmemoryprovider.cpp
===================================================================
--- trunk/qgis/src/providers/memory/qgsmemoryprovider.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/providers/memory/qgsmemoryprovider.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -174,18 +174,22 @@
   if ( mCrs.isValid() )
   {
     QString crsDef( "" );
-    long srid = mCrs.epsg();
-    if ( srid )
+    QString authid = mCrs.authid();
+    if ( authid.startsWith( "EPSG:" ) )
     {
-      crsDef = QString( "epsg:%1" ).arg( srid );
+      crsDef = authid;
     }
-    else if (( srid = mCrs.postgisSrid() ) )
-    {
-      crsDef = QString( "postgis:%1" ).arg( srid );
-    }
     else
     {
-      crsDef = QString( "wkt:%1" ).arg( mCrs.toWkt() );
+      int srid = mCrs.postgisSrid();
+      if ( srid )
+      {
+        crsDef = QString( "postgis:%1" ).arg( srid );
+      }
+      else
+      {
+        crsDef = QString( "wkt:%1" ).arg( mCrs.toWkt() );
+      }
     }
     uri.addQueryItem( "crs", crsDef );
   }

Modified: trunk/qgis/src/providers/wfs/qgswfsprovider.cpp
===================================================================
--- trunk/qgis/src/providers/wfs/qgswfsprovider.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/src/providers/wfs/qgswfsprovider.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -661,11 +661,7 @@
   QString srsname = parameterFromUrl( "SRSNAME" );
   if ( !srsname.isEmpty() )
   {
-    QStringList epsgSplit = srsname.split( ":" );
-    if ( epsgSplit.size() > 1 )
-    {
-      mSourceCRS.createFromEpsg( epsgSplit.at( 1 ).toInt() );
-    }
+    mSourceCRS.createFromOgcWmsCrs( srsname );
   }
 
   QgsWFSData dataReader( uri, &mExtent, mFeatures, mIdMap, geometryAttribute, thematicAttributes, &mWKBType );
@@ -1820,7 +1816,7 @@
     QgsCoordinateReferenceSystem layerCrs = crs();
     if ( layerCrs.isValid() )
     {
-      geomElement.setAttribute( "srsName", QString( "EPSG:" ) + QString::number( layerCrs.epsg() ) );
+      geomElement.setAttribute( "srsName", layerCrs.authid() );
     }
   }
   return geomElement;

Modified: trunk/qgis/tests/src/core/testqgscoordinatereferencesystem.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgscoordinatereferencesystem.cpp	2011-02-22 23:28:30 UTC (rev 15245)
+++ trunk/qgis/tests/src/core/testqgscoordinatereferencesystem.cpp	2011-02-22 23:32:33 UTC (rev 15246)
@@ -25,7 +25,7 @@
 
 class TestQgsCoordinateReferenceSystem: public QObject
 {
-  Q_OBJECT;
+    Q_OBJECT
   private slots:
     void initTestCase();
     void wktCtor();
@@ -36,7 +36,6 @@
     void createFromOgcWmsCrs();
     void createFromSrid();
     void createFromWkt();
-    void createFromEpsg();
     void createFromSrsId();
     void createFromProj4();
     void isValid();
@@ -76,7 +75,7 @@
 
 void TestQgsCoordinateReferenceSystem::wktCtor()
 {
-  QString myWkt ( "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4326\"]]" ) ;
+  QString myWkt( "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4326\"]]" ) ;
   QgsCoordinateReferenceSystem myCrs( myWkt );
   debugPrint( myCrs );
   QVERIFY( myCrs.isValid() );
@@ -111,9 +110,9 @@
 void TestQgsCoordinateReferenceSystem::createFromOgcWmsCrs()
 {
   QgsCoordinateReferenceSystem myCrs;
-  //@todo implement this - for now we just check that if fails 
+  //@todo implement this - for now we just check that if fails
   //if passed an empty string
-  QVERIFY ( !myCrs.createFromOgcWmsCrs( QString ("") ) );
+  QVERIFY( !myCrs.createFromOgcWmsCrs( QString( "" ) ) );
 }
 void TestQgsCoordinateReferenceSystem::createFromSrid()
 {
@@ -126,14 +125,8 @@
 {
   QgsCoordinateReferenceSystem myCrs;
   QString myWkt = "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4326\"]]" ;
-  QVERIFY ( !myCrs.createFromWkt( myWkt ) );
+  QVERIFY( !myCrs.createFromWkt( myWkt ) );
 }
-void TestQgsCoordinateReferenceSystem::createFromEpsg()
-{
-  QgsCoordinateReferenceSystem myCrs;
-  QVERIFY ( myCrs.createFromEpsg( 4326 ) );
-  debugPrint( myCrs );
-}
 void TestQgsCoordinateReferenceSystem::createFromSrsId()
 {
   QgsCoordinateReferenceSystem myCrs;
@@ -149,14 +142,14 @@
 void TestQgsCoordinateReferenceSystem::isValid()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QVERIFY( myCrs.isValid() );
   debugPrint( myCrs );
 }
 void TestQgsCoordinateReferenceSystem::validate()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   myCrs.validate();
   QVERIFY( myCrs.isValid() );
   debugPrint( myCrs );
@@ -164,7 +157,7 @@
 void TestQgsCoordinateReferenceSystem::findMatchingProj()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   int myLong  = myCrs.findMatchingProj();
   QVERIFY( myLong == 4326 );
   debugPrint( myCrs );
@@ -172,32 +165,32 @@
 void TestQgsCoordinateReferenceSystem::equality()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QgsCoordinateReferenceSystem myCrs2;
-  myCrs2.createFromSrsId( 4326 ); 
+  myCrs2.createFromSrsId( 4326 );
   QVERIFY( myCrs == myCrs2 );
   debugPrint( myCrs );
 }
 void TestQgsCoordinateReferenceSystem::noEquality()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QgsCoordinateReferenceSystem myCrs2;
-  myCrs2.createFromSrsId( 4327 ); 
+  myCrs2.createFromSrsId( 4327 );
   QVERIFY( myCrs != myCrs2 );
   debugPrint( myCrs );
 }
 void TestQgsCoordinateReferenceSystem::equals()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QVERIFY( myCrs.equals( "proj4 string" ) );
   debugPrint( myCrs );
 }
 void TestQgsCoordinateReferenceSystem::readXML()
 {
   //QgsCoordinateReferenceSystem myCrs;
-  //myCrs.createFromSrsId( 4326 ); 
+  //myCrs.createFromSrsId( 4326 );
   //QgsCoordinateReferenceSystem myCrs2;
   //QVERIFY( myCrs2.readXML( QDomNode & theNode ) );
 }
@@ -225,21 +218,21 @@
 void TestQgsCoordinateReferenceSystem::srsid()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QVERIFY( myCrs.srsid() == 4326 );
   debugPrint( myCrs );
 }
 void TestQgsCoordinateReferenceSystem::postgisSrid()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QVERIFY( myCrs.postgisSrid() == 4326 );
   debugPrint( myCrs );
 }
 void TestQgsCoordinateReferenceSystem::ellipsoidAcronym()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QString myAcronym = myCrs.ellipsoidAcronym();
   QVERIFY( myAcronym == "foo" );
   debugPrint( myCrs );
@@ -247,7 +240,7 @@
 void TestQgsCoordinateReferenceSystem::toWkt()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QString myWkt = myCrs.toWkt();
   QVERIFY( myWkt == "GEOGCS[\"WGS 84\",DATUM[\"WGS_1984\",SPHEROID[\"WGS 84\",6378137,298.257223563,AUTHORITY[\"EPSG\",\"7030\"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY[\"EPSG\",\"6326\"]],PRIMEM[\"Greenwich\",0,AUTHORITY[\"EPSG\",\"8901\"]],UNIT[\"degree\",0.0174532925199433,AUTHORITY[\"EPSG\",\"9108\"]],AUTHORITY[\"EPSG\",\"4326\"]]" );
   debugPrint( myCrs );
@@ -255,21 +248,21 @@
 void TestQgsCoordinateReferenceSystem::toProj4()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QVERIFY( myCrs.toProj4() == "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs" );
   debugPrint( myCrs );
 }
 void TestQgsCoordinateReferenceSystem::geographicFlag()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QVERIFY( myCrs.geographicFlag() );
   debugPrint( myCrs );
 }
 void TestQgsCoordinateReferenceSystem::mapUnits()
 {
   QgsCoordinateReferenceSystem myCrs;
-  myCrs.createFromSrsId( 4326 ); 
+  myCrs.createFromSrsId( 4326 );
   QVERIFY( myCrs.mapUnits() == QGis::Degrees );
   debugPrint( myCrs );
 }



More information about the QGIS-commit mailing list