[QGIS Commit] r9478 - in trunk/qgis: python/core python/gui resources src/app src/app/legend src/core src/gui src/plugins/coordinate_capture src/plugins/grass src/plugins/wfs src/providers/wfs src/providers/wms src/ui tests/algorithms/projections tests/src/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Thu Oct 16 02:31:26 EDT 2008


Author: timlinux
Date: 2008-10-16 02:31:25 -0400 (Thu, 16 Oct 2008)
New Revision: 9478

Modified:
   trunk/qgis/python/core/qgis.sip
   trunk/qgis/python/core/qgscoordinatereferencesystem.sip
   trunk/qgis/python/core/qgscoordinatetransform.sip
   trunk/qgis/python/core/qgsdistancearea.sip
   trunk/qgis/python/gui/qgsgenericprojectionselector.sip
   trunk/qgis/python/gui/qgsprojectionselector.sip
   trunk/qgis/resources/qgis_help.db
   trunk/qgis/src/app/legend/qgslegendlayerfile.cpp
   trunk/qgis/src/app/qgsprojectproperties.cpp
   trunk/qgis/src/app/qgsrasterlayerproperties.cpp
   trunk/qgis/src/app/qgsserversourceselect.cpp
   trunk/qgis/src/app/qgsserversourceselect.h
   trunk/qgis/src/app/qgsvectorlayerproperties.cpp
   trunk/qgis/src/core/qgis.h
   trunk/qgis/src/core/qgscoordinatereferencesystem.cpp
   trunk/qgis/src/core/qgscoordinatereferencesystem.h
   trunk/qgis/src/core/qgscoordinatetransform.cpp
   trunk/qgis/src/core/qgscoordinatetransform.h
   trunk/qgis/src/core/qgsdistancearea.cpp
   trunk/qgis/src/core/qgsdistancearea.h
   trunk/qgis/src/core/qgsmaprenderer.cpp
   trunk/qgis/src/gui/qgsgenericprojectionselector.h
   trunk/qgis/src/gui/qgsprojectionselector.cpp
   trunk/qgis/src/gui/qgsprojectionselector.h
   trunk/qgis/src/plugins/coordinate_capture/coordinatecapture.cpp
   trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp
   trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp
   trunk/qgis/src/providers/wfs/qgswfsdata.h
   trunk/qgis/src/providers/wfs/qgswfsprovider.cpp
   trunk/qgis/src/providers/wms/qgswmsprovider.cpp
   trunk/qgis/src/ui/qgsprojectionselectorbase.ui
   trunk/qgis/tests/algorithms/projections/projectioncshandlingtest.h
   trunk/qgis/tests/src/core/testqgsvectorfilewriter.cpp
Log:
Further api updates in core

Modified: trunk/qgis/python/core/qgis.sip
===================================================================
--- trunk/qgis/python/core/qgis.sip	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/python/core/qgis.sip	2008-10-16 06:31:25 UTC (rev 9478)
@@ -98,8 +98,8 @@
   const long GEOSRID;
   /** Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id */
   const long GEOCRS_ID;
-  /**  Magic number for a geographic coord sys in EPSG ID format */
-  const long GEOEPSG_ID;
+  /**  Magic number for a geographic coord sys in EpsgCrsId ID format */
+  const long GEO_EPSG_CRS_ID;
   /** The length of teh string "+proj=" */
   const int PROJ_PREFIX_LEN;
   /** The length of teh string "+ellps=" */

Modified: trunk/qgis/python/core/qgscoordinatereferencesystem.sip
===================================================================
--- trunk/qgis/python/core/qgscoordinatereferencesystem.sip	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/python/core/qgscoordinatereferencesystem.sip	2008-10-16 06:31:25 UTC (rev 9478)
@@ -12,10 +12,10 @@
 
 //      typedef void (*CUSTOM_CRS_VALIDATION)(QgsCoordinateReferenceSystem*);
       
-        enum CRS_TYPE {
-          QGIS_CRSID,
-          POSTGIS_SRID,
-          EPSG
+        enum CrsType {
+          InternalCrsId,
+          PostgisCrsId,
+          EpsgCrsId
         };
         
         //! Default constructor
@@ -30,24 +30,24 @@
         explicit QgsCoordinateReferenceSystem(QString theWkt);
 
         /*! Use this constructor when you want to create a CRS object using 
-         *  a postgis SRID, an EPSG id or a QGIS CRS_ID.
+         *  a postgis SRID, an Epsg Id id or a QGIS CRS_ID.
          * @param theId The ID no valid for the chosen coordinate system id type
-         * @param theType One of the types described in QgsCoordinateReferenceSystem::CRS_TYPE
+         * @param theType One of the types described in QgsCoordinateReferenceSystem::CrsType
          */
-        QgsCoordinateReferenceSystem(const long theId, CRS_TYPE theType=POSTGIS_SRID);
+        QgsCoordinateReferenceSystem(const long theId, CrsType theType=PostgisCrsId);
 
         // Misc helper functions -----------------------
 
-        void createFromId(const long theId, CRS_TYPE theType=POSTGIS_SRID);
+        void createFromId(const long theId, CrsType theType=PostgisCrsId);
 
         /**
          * \brief Set up this CRS from the given OGC CRS
          *
          * Sets this CRS to the given OGC WMS-format Coordinate Reference Systems.
          *
-         * \note This function only deals with EPSG labels only at this time.
+         * \note This function only deals with Epsg Id labels only at this time.
          *
-         * \retval FALSE if not given an EPSG label
+         * \retval FALSE if not given an Epsg Id label
          */
         bool createFromOgcWmsCrs(QString theCrs);
 
@@ -65,7 +65,7 @@
          * First the system level read only srs.db will be checked
          * and then the users ~/.qgis/qgis.db database will be checked for a match.
          * @note Any members will be overwritten during this process.
-         * @note SRID and EPSG may be blank if no match can be found on srs db.
+         * @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
          */
@@ -75,7 +75,7 @@
          * sqlite backend. First the system level read only srs.db will be checked
          * 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 EPSG for the desired spatial reference system.
+         * @param theEpsg The EpsgCrsId for the desired spatial reference system.
          * @return bool TRUE if sucess else false
          */
         bool createFromEpsg(const long theEpsg);
@@ -206,10 +206,14 @@
          *  @return  long theSrsId The internal sqlite3 srs.db primary key for this srs 
          */
         long srsid() const;
-        /*! Get the Postgis SRID - if possible.
-        *  @return  long theSRID The internal postgis SRID for this CRS
-        */
-        long srid() const;
+        /*! Get the postgis srid for this srs
+         * @return  long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
+         */
+        long postgisSrid () const;
+        /*! Get the EpsgCrsId identifier for this srs
+         * @return  long theEpsg the ESPG identifier for this srs (defaults to 0)
+         */
+        long epsg () const;
         /*! 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
@@ -241,49 +245,7 @@
          */
         QGis::UnitType mapUnits() const;
 
-        /*! Set the postgis srid for this srs
-         * @return  long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
-         */
-        long postgisSrid () const;
-        /*! Set the EPSG identifier for this srs
-         * @return  long theEpsg the ESPG identifier for this srs (defaults to 0)
-         */
-        long epsg () const;
 
-        // Mutators -----------------------------------
-
-        /*! Set the QGIS  SrsId
-         *  @param  long theSrsId The internal sqlite3 srs.db primary key for this srs 
-         */
-        void setSrsId(long theSrsId);
-        /*! Set the postgis srid
-         *  @param  long theSrsId The postgis spatial_ref_sys key for this srs 
-         */
-        void setSrid(long theSrid);
-        /*! Set the Description
-         * @param  QString the Description A textual description of the srs.
-         */
-        void setDescription (QString theDescription);
-        /* Set the Proj Proj4String. 
-         * @param  QString theProj4String Proj4 format specifies (excluding proj and ellips) that define this srs.
-         */
-        void setProj4String (QString theProj4String);
-        /*! Set this Geographic? flag
-         * @param  bool theGeoFlag Whether this is a geographic or projected coordinate system
-         */
-        void setGeographicFlag (bool theGeoFlag);
-        /*! Set the EPSG identifier for this srs
-         * @param  long theEpsg the ESPG identifier for this srs (defaults to 0)
-         */
-        void setEpsg (long theEpsg);
-        /*! Set the projection acronym
-         * @param QString the acronym (must be a valid proj4 projection acronym)
-         */
-        void setProjectionAcronym(QString theProjectionAcronym);
-        /*! Set the ellipsoid acronym
-         * @param QString the acronym (must be a valid proj4 ellipsoid acronym)
-         */
-        void setEllipsoidAcronym(QString theEllipsoidAcronym);
 };
 
 

Modified: trunk/qgis/python/core/qgscoordinatetransform.sip
===================================================================
--- trunk/qgis/python/core/qgscoordinatetransform.sip	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/python/core/qgscoordinatetransform.sip	2008-10-16 06:31:25 UTC (rev 9478)
@@ -45,18 +45,18 @@
      * of the layer and map canvas coordinate system as Wkt
      * @param theSourceSrid Spatial Ref Id of the layer's coordinate system
      * @param theSourceWKT WKT of the map canvas coordinate system
-     * @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CRS_TYPE
+     * @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CrsType
      */
     QgsCoordinateTransform(long theSourceSrid,  
                            QString theDestWKT,
-                           QgsCoordinateReferenceSystem::CRS_TYPE theSourceCRSType = QgsCoordinateReferenceSystem::POSTGIS_SRID  );
+                           QgsCoordinateReferenceSystem::CrsType theSourceCRSType = QgsCoordinateReferenceSystem::PostgisCrsId  );
 
      //! destructor
     ~QgsCoordinateTransform();
 
     //! Enum used to indicate the direction (forward or inverse) of the transform
     enum TransformDirection{
-      FORWARD,     /*!< Transform from source to destination CRS. */
+      ForwardTransform,     /*!< Transform from source to destination CRS. */
       INVERSE      /*!< Transform from destination to source CRS. */
     };
     
@@ -85,63 +85,63 @@
     QgsCoordinateReferenceSystem& destCRS();
 
     /*! Transform the point from Source Coordinate System to Destination Coordinate System
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * @param p Point to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsPoint in Destination Coordinate System
      */    
-   QgsPoint transform(const QgsPoint p,TransformDirection direction=FORWARD);
+   QgsPoint transform(const QgsPoint p,TransformDirection direction=ForwardTransform);
 
     /*! Transform the point specified by x,y from Source Coordinate System to Destination Coordinate System
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * @param x x cordinate of point to transform
     * @param y y coordinate of point to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsPoint in Destination Coordinate System
      */
-   QgsPoint transform(const double x, const double y,TransformDirection direction=FORWARD);
+   QgsPoint transform(const double x, const double y,TransformDirection direction=ForwardTransform);
 
     /*! Transform a QgsRect to the dest Coordinate system 
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * It assumes that rect is a bounding box, and creates a bounding box
     * in the proejcted CS, so that all points in source rectangle is within
     * returned rectangle.
     * @param QgsRect rect to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsRect in Destination Coordinate System
      */        
-   QgsRect transformBoundingBox(const QgsRect theRect,TransformDirection direction=FORWARD);
+   QgsRect transformBoundingBox(const QgsRect theRect,TransformDirection direction=ForwardTransform);
 
    // Same as for the other transform() functions, but alters the x
    // and y variables in place. The second one works with good old-fashioned
    // C style arrays.
-   void transformInPlace(double& x, double& y, double &z, TransformDirection direction = FORWARD);
+   void transformInPlace(double& x, double& y, double &z, TransformDirection direction = ForwardTransform);
 
    // TODO: argument not supported
    //void transformInPlace(std::vector<double>& x, std::vector<double>& y, std::vector<double>& z, 
-   //    TransformDirection direction = FORWARD);
+   //    TransformDirection direction = ForwardTransform);
 
     /*! Transform a QgsRect to the dest Coordinate system 
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * @param QgsRect rect to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsRect in Destination Coordinate System
      */        
-   QgsRect transform(const QgsRect theRect,TransformDirection direction=FORWARD);
+   QgsRect transform(const QgsRect theRect,TransformDirection direction=ForwardTransform);
     
     /*! Transform an array of coordinates to a different Coordinate System
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * @param x x cordinate of point to transform
     * @param y y coordinate of point to transform     
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsRect in Destination Coordinate System
      */        
-   void transformCoords( const int &numPoint, double *x, double *y, double *z,TransformDirection direction=FORWARD);
+   void transformCoords( const int &numPoint, double *x, double *y, double *z,TransformDirection direction=ForwardTransform);
 
   /*! 
    * Flag to indicate whether the coordinate systems have been initialised

Modified: trunk/qgis/python/core/qgsdistancearea.sip
===================================================================
--- trunk/qgis/python/core/qgsdistancearea.sip	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/python/core/qgsdistancearea.sip	2008-10-16 06:31:25 UTC (rev 9478)
@@ -22,8 +22,8 @@
     //! sets source spatial reference system (by QGIS CRS)
     void setSourceCRS(long srsid);
     
-    //! sets source spatial reference system (by EPSG)
-    void setSourceEPSG(long epsgId);
+    //! sets source spatial reference system (by EpsgCrsId)
+    void setSourceEpsgCrsId(long epsgId);
 
     //! returns source spatial reference system
     long sourceCRS();

Modified: trunk/qgis/python/gui/qgsgenericprojectionselector.sip
===================================================================
--- trunk/qgis/python/gui/qgsgenericprojectionselector.sip	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/python/gui/qgsgenericprojectionselector.sip	2008-10-16 06:31:25 UTC (rev 9478)
@@ -43,7 +43,7 @@
        *                  list of projections by.  This is useful in (e.g.) WMS situations
        *                  where you just want to offer what the WMS server can support.
        *
-       * \note This function only deals with EPSG labels only at this time.
+       * \note This function only deals with EpsgCrsId labels only at this time.
        *
        * \warning This function's behaviour is undefined if it is called after the dialog is shown.
        */

Modified: trunk/qgis/python/gui/qgsprojectionselector.sip
===================================================================
--- trunk/qgis/python/gui/qgsprojectionselector.sip	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/python/gui/qgsprojectionselector.sip	2008-10-16 06:31:25 UTC (rev 9478)
@@ -53,7 +53,7 @@
        */
       const QString sqlSafeString(const QString theSQL);
 
-      //! Gets the current EPSG-style projection identifier
+      //! Gets the current EpsgCrsId-style projection identifier
       long selectedEpsg();
 
     public slots:
@@ -83,7 +83,7 @@
        *                  list of projections by.  This is useful in (e.g.) WMS situations
        *                  where you just want to offer what the WMS server can support.
        *
-       * \note This function only deals with EPSG labels only at this time.
+       * \note This function only deals with EpsgCrsId labels only at this time.
        *
        * \warning This function's behaviour is undefined if it is called after the widget is shown.
        */

Modified: trunk/qgis/resources/qgis_help.db
===================================================================
(Binary files differ)

Modified: trunk/qgis/src/app/legend/qgslegendlayerfile.cpp
===================================================================
--- trunk/qgis/src/app/legend/qgslegendlayerfile.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/app/legend/qgslegendlayerfile.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -282,9 +282,9 @@
 
   if ( mySelector->exec() )
   {
-    QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::QGIS_CRSID );
+    QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
     destCRS = srs;
-    //   destCRS->createFromId(mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::QGIS_CRSID)
+    //   destCRS->createFromId(mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId)
   }
   else
   {

Modified: trunk/qgis/src/app/qgsprojectproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsprojectproperties.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/app/qgsprojectproperties.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -248,7 +248,7 @@
   long myCRSID = projectionSelector->selectedCrsId();
   if ( myCRSID )
   {
-    QgsCoordinateReferenceSystem srs( myCRSID, QgsCoordinateReferenceSystem::QGIS_CRSID );
+    QgsCoordinateReferenceSystem srs( myCRSID, QgsCoordinateReferenceSystem::InternalCrsId );
     myRender->setDestinationSrs( srs );
 
     // write the currently selected projections _proj string_ to project settings

Modified: trunk/qgis/src/app/qgsrasterlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/app/qgsrasterlayerproperties.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -1687,7 +1687,7 @@
   mySelector->setSelectedCrsId( mRasterLayer->srs().srsid() );
   if ( mySelector->exec() )
   {
-    QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::QGIS_CRSID );
+    QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
     mRasterLayer->setSrs( srs );
   }
   else

Modified: trunk/qgis/src/app/qgsserversourceselect.cpp
===================================================================
--- trunk/qgis/src/app/qgsserversourceselect.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/app/qgsserversourceselect.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -38,14 +38,14 @@
 #include <QMap>
 #include <QImageReader>
 #include "qgslogger.h"
+#include "qgis.h" // GEO_EPSG_CRS_ID 
 
 
-static long DEFAULT_WMS_EPSG = 4326;  // WGS 84
 
 
 QgsServerSourceSelect::QgsServerSourceSelect( QWidget * parent, Qt::WFlags fl )
     : QDialog( parent, fl ),
-    m_Epsg( DEFAULT_WMS_EPSG ),
+    m_Epsg( GEO_EPSG_CRS_ID ),
     mWmsProvider( 0 )
 {
   setupUi( this );
@@ -97,7 +97,7 @@
   if ( currentCRS != -1 )
   {
     //convert CRS id to epsg
-    QgsCoordinateReferenceSystem currentRefSys( currentCRS, QgsCoordinateReferenceSystem::QGIS_CRSID );
+    QgsCoordinateReferenceSystem currentRefSys( currentCRS, QgsCoordinateReferenceSystem::InternalCrsId );
     if ( currentRefSys.isValid() )
     {
       m_Epsg = currentRefSys.epsg();
@@ -496,8 +496,8 @@
           // save first CRS in case we current m_Epsg is not available
           if ( i == crsFilter.begin() )
             defaultEpsg = epsg;
-          // prefer value of DEFAULT_WMS_EPSG if available
-          if ( epsg == DEFAULT_WMS_EPSG )
+          // prefer value of DEFAULT_GEO_EPSG_CRS_ID if available
+          if ( epsg == GEO_EPSG_CRS_ID )
             defaultEpsg = epsg;
         }
       }
@@ -653,7 +653,7 @@
   // We'll assume this function isn't called very often,
   // so please forgive the lack of caching of results
 
-  QgsCoordinateReferenceSystem qgisSrs = QgsCoordinateReferenceSystem( epsg, QgsCoordinateReferenceSystem::EPSG );
+  QgsCoordinateReferenceSystem qgisSrs = QgsCoordinateReferenceSystem( epsg, QgsCoordinateReferenceSystem::EpsgCrsId );
 
   return qgisSrs.description();
 }

Modified: trunk/qgis/src/app/qgsserversourceselect.h
===================================================================
--- trunk/qgis/src/app/qgsserversourceselect.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/app/qgsserversourceselect.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -140,7 +140,7 @@
     //! Populate the image encoding button group - private for now.
     void populateImageEncodingGroup( QgsWmsProvider* wmsProvider );
 
-    //! Returns a textual description for the EPSG number
+    //! Returns a textual description for the EpsgCrsId number
     QString descriptionForEpsg( long epsg );
 
     //! Name for selected connection

Modified: trunk/qgis/src/app/qgsvectorlayerproperties.cpp
===================================================================
--- trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/app/qgsvectorlayerproperties.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -866,7 +866,7 @@
   mySelector->setSelectedCrsId( layer->srs().srsid() );
   if ( mySelector->exec() )
   {
-    QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::QGIS_CRSID );
+    QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
     layer->setSrs( srs );
   }
   else

Modified: trunk/qgis/src/core/qgis.h
===================================================================
--- trunk/qgis/src/core/qgis.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/core/qgis.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -131,8 +131,8 @@
 const long GEOSRID = 4326;
 /** Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id */
 const long GEOCRS_ID = 3344;
-/**  Magic number for a geographic coord sys in EPSG ID format */
-const long GEOEPSG_ID = 4326;
+/**  Magic number for a geographic coord sys in EpsgCrsId ID format */
+const long GEO_EPSG_CRS_ID = 4326;
 /** The length of the string "+proj=" */
 const int PROJ_PREFIX_LEN = 6;
 /** The length of the string "+ellps=" */

Modified: trunk/qgis/src/core/qgscoordinatereferencesystem.cpp
===================================================================
--- trunk/qgis/src/core/qgscoordinatereferencesystem.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/core/qgscoordinatereferencesystem.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -61,7 +61,7 @@
 }
 
 
-QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( const long theId, CRS_TYPE theType )
+QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( const long theId, CrsType theType )
     : mMapUnits( QGis::UnknownUnit ),
     mIsValidFlag( 0 ),
     mValidationHint( 0 )
@@ -75,17 +75,17 @@
   OSRDestroySpatialReference( mCRS );
 }
 
-void QgsCoordinateReferenceSystem::createFromId( const long theId, CRS_TYPE theType )
+void QgsCoordinateReferenceSystem::createFromId( const long theId, CrsType theType )
 {
   switch ( theType )
   {
-    case QGIS_CRSID:
+    case InternalCrsId:
       createFromSrsId( theId );
       break;
-    case POSTGIS_SRID:
+    case PostgisCrsId:
       createFromSrid( theId );
       break;
-    case EPSG:
+    case EpsgCrsId:
       createFromEpsg( theId );
       break;
     default:
@@ -180,7 +180,8 @@
 
 bool QgsCoordinateReferenceSystem::createFromSrsId( long id )
 {
-  return loadFromDb( id < 100000 ? QgsApplication::srsDbFilePath() : QgsApplication::qgisUserDbFilePath(), "srs_id", id );
+  return loadFromDb( id < 100000 ? QgsApplication::srsDbFilePath() : 
+      QgsApplication::qgisUserDbFilePath(), "srs_id", id );
 }
 
 bool QgsCoordinateReferenceSystem::loadFromDb( QString db, QString field, long id )
@@ -434,6 +435,7 @@
   return mIsValidFlag;
 }
 
+//private method meant for internal use by this class only
 QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord( QString theSql )
 {
   QString myDatabaseFileName;
@@ -537,25 +539,24 @@
 }
 
 // Accessors -----------------------------------
-/*! Get the SrsId
- *  @return  long theSrsId The internal sqlite3 srs.db primary key for this srs
- */
+
 long QgsCoordinateReferenceSystem::srsid() const
 {
   return mSrsId;
 }
-/*! Get the Postgis SRID - if possible
- *  @return  long theSRID The internal postgis SRID for this CRS
- */
-long QgsCoordinateReferenceSystem::srid() const
+
+long QgsCoordinateReferenceSystem::postgisSrid() const
 {
 
   return mSRID;
 
 }
-/*! Get the Description
- * @return  QString the Description A textual description of the srs.
- */
+
+long QgsCoordinateReferenceSystem::epsg() const
+{
+  return mEpsg;
+}
+
 QString QgsCoordinateReferenceSystem::description() const
 {
   if ( mDescription.isNull() )
@@ -567,9 +568,7 @@
     return mDescription;
   }
 }
-/*! Get the Projection Acronym
- * @return  QString theProjectionAcronym The official proj4 acronym for the projection family
- */
+
 QString QgsCoordinateReferenceSystem::projectionAcronym() const
 {
   if ( mProjectionAcronym.isNull() )
@@ -581,9 +580,7 @@
     return mProjectionAcronym;
   }
 }
-/*! Get the Ellipsoid Acronym
- * @return  QString theEllipsoidAcronym The official proj4 acronym for the ellipoid
- */
+
 QString QgsCoordinateReferenceSystem::ellipsoidAcronym() const
 {
   if ( mEllipsoidAcronym.isNull() )
@@ -595,9 +592,7 @@
     return mEllipsoidAcronym;
   }
 }
-/* Get the Proj Proj4String.
- * @return  QString theProj4String Proj4 format specifies that define this srs.
- */
+
 QString QgsCoordinateReferenceSystem::proj4String() const
 {
   if ( !mIsValidFlag )
@@ -611,40 +606,22 @@
 
   return proj4String;
 }
-/*! Get this Geographic? flag
- * @return  bool theGeoFlag Whether this is a geographic or projected coordinate system
- */
+
 bool QgsCoordinateReferenceSystem::geographicFlag() const
 {
   return mGeoFlag;
 }
-/*! Get the units that the projection is in
- * @return QGis::UnitType
- */
+
 QGis::UnitType QgsCoordinateReferenceSystem::mapUnits() const
 {
   return mMapUnits;
 }
 
-/*! Set the postgis srid for this srs
- * @return  long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
- */
-long QgsCoordinateReferenceSystem::postgisSrid() const
-{
-  return mSRID ;
-}
-/*! Set the EPSG identifier for this srs
- * @return  long theEpsg the ESPG identifier for this srs (defaults to 0)
- */
-long QgsCoordinateReferenceSystem::epsg() const
-{
-  return mEpsg;
-}
 
 // Mutators -----------------------------------
 
 
-void QgsCoordinateReferenceSystem::setSrsId( long theSrsId )
+void QgsCoordinateReferenceSystem::setInternalId( long theSrsId )
 {
   mSrsId = theSrsId;
 }
@@ -685,9 +662,7 @@
 {
   mEllipsoidAcronym = theEllipsoidAcronym;
 }
-/*! Work out the projection units and set the appropriate local variable
- *
- */
+
 void QgsCoordinateReferenceSystem::setMapUnits()
 {
   if ( !mIsValidFlag )
@@ -912,7 +887,7 @@
 
     myNode = srsNode.namedItem( "srsid" );
     myElement = myNode.toElement();
-    setSrsId( myElement.text().toLong() );
+    setInternalId( myElement.text().toLong() );
 
     myNode = srsNode.namedItem( "srid" );
     myElement = myNode.toElement();
@@ -954,7 +929,7 @@
   else
   {
     // Return default CRS if none was found in the XML.
-    createFromEpsg( GEOEPSG_ID );
+    createFromEpsg( GEO_EPSG_CRS_ID );
   }
   return true;
 }
@@ -974,7 +949,7 @@
   mySrsElement.appendChild( mySrsIdElement );
 
   QDomElement mySridElement  = theDoc.createElement( "srid" );
-  mySridElement.appendChild( theDoc.createTextNode( QString::number( srid() ) ) );
+  mySridElement.appendChild( theDoc.createTextNode( QString::number( postgisSrid() ) ) );
   mySrsElement.appendChild( mySridElement );
 
   QDomElement myEpsgElement  = theDoc.createElement( "epsg" );

Modified: trunk/qgis/src/core/qgscoordinatereferencesystem.h
===================================================================
--- trunk/qgis/src/core/qgscoordinatereferencesystem.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/core/qgscoordinatereferencesystem.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -44,11 +44,11 @@
 {
   public:
 
-    enum CRS_TYPE
+    enum CrsType
     {
-      QGIS_CRSID,
-      POSTGIS_SRID,
-      EPSG
+      InternalCrsId,
+      PostgisCrsId,
+      EpsgCrsId
     };
 
     //! Default constructor
@@ -63,13 +63,13 @@
     explicit QgsCoordinateReferenceSystem( QString theWkt );
 
     /*! Use this constructor when you want to create a CRS object using
-     *  a postgis SRID, an EPSG id or a QGIS CRS_ID.
-     * @note We encourage you to use EPSG, WKT or Proj4 to describe CRS's in your code
+     *  a postgis SRID, an EpsgCrsId id or a QGIS CRS_ID.
+     * @note We encourage you to use EpsgCrsId, WKT or Proj4 to describe CRS's in your code
      * wherever possible. QGSI CRS_IDs are not guaranteed to be permanent / involatile.
      * @param theId The ID no valid for the chosen coordinate system id type
-     * @param theType One of the types described in QgsCoordinateReferenceSystem::CRS_TYPE
+     * @param theType One of the types described in QgsCoordinateReferenceSystem::CrsType
      */
-    QgsCoordinateReferenceSystem( const long theId, CRS_TYPE theType = POSTGIS_SRID );
+    QgsCoordinateReferenceSystem( const long theId, CrsType theType = PostgisCrsId );
 
     //! copy constructor
     QgsCoordinateReferenceSystem( const QgsCoordinateReferenceSystem& srs );
@@ -79,16 +79,16 @@
 
     // Misc helper functions -----------------------
 
-    void createFromId( const long theId, CRS_TYPE theType = POSTGIS_SRID );
+    void createFromId( const long theId, CrsType theType = PostgisCrsId );
 
     /**
      * \brief Set up this CRS from the given OGC CRS
      *
      * Sets this CRS to the given OGC WMS-format Coordinate Reference Systems.
      *
-     * \note This function only deals with EPSG labels only at this time.
+     * \note This function only deals with EpsgCrsId labels only at this time.
      *
-     * \retval FALSE if not given an EPSG label
+     * \retval FALSE if not given an EpsgCrsId label
      */
     bool createFromOgcWmsCrs( QString theCrs );
 
@@ -106,7 +106,7 @@
      * First the system level read only srs.db will be checked
      * and then the users ~/.qgis/qgis.db database will be checked for a match.
      * @note Any members will be overwritten during this process.
-     * @note SRID and EPSG may be blank if no match can be found on srs db.
+     * @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
      */
@@ -116,7 +116,7 @@
      * sqlite backend. First the system level read only srs.db will be checked
      * 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 EPSG for the desired spatial reference system.
+     * @param theEpsg The EpsgCrsId for the desired spatial reference system.
      * @return bool TRUE if sucess else false
      */
     bool createFromEpsg( const long theEpsg );
@@ -251,10 +251,14 @@
     *  @return  long theSrsId The internal sqlite3 srs.db primary key for this srs
     */
     long srsid() const;
-    /*! Get the Postgis SRID - if possible.
-    *  @return  long theSRID The internal postgis SRID for this CRS
-    */
-    long srid() const;
+    /*! Get the postgis srid for this srs
+     * @return  long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
+     */
+    long postgisSrid() const;
+    /*! Get the EpsgCrsId identifier for this srs
+     * @return  long theEpsg the ESPG identifier for this srs (defaults to 0)
+     */
+    long epsg() const;
     /*! 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
@@ -286,21 +290,24 @@
      */
     QGis::UnitType mapUnits() const;
 
-    /*! Set the postgis srid for this srs
-     * @return  long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
+
+    // Mutators -----------------------------------
+    /*! Set user hint for validation
      */
-    long postgisSrid() const;
-    /*! Set the EPSG identifier for this srs
-     * @return  long theEpsg the ESPG identifier for this srs (defaults to 0)
-     */
-    long epsg() const;
+    void setValidationHint( QString html );
 
+    /*! Get user hint for validation
+     */
+    QString validationHint();
     // Mutators -----------------------------------
+    // We dont want to expose these to the public api since they wont create 
+    // a fully valid crs. Programmers should use the createFrom* methods rather
+  private:
 
     /*! Set the QGIS  SrsId
      *  @param  long theSrsId The internal sqlite3 srs.db primary key for this srs
      */
-    void setSrsId( long theSrsId );
+    void setInternalId( long theSrsId );
     /*! Set the postgis srid
      *  @param  long theSrsId The postgis spatial_ref_sys key for this srs
      */
@@ -317,7 +324,7 @@
      * @param  bool theGeoFlag Whether this is a geographic or projected coordinate system
      */
     void setGeographicFlag( bool theGeoFlag );
-    /*! Set the EPSG identifier for this srs
+    /*! Set the EpsgCrsId identifier for this srs
      * @param  long theEpsg the ESPG identifier for this srs (defaults to 0)
      */
     void setEpsg( long theEpsg );
@@ -330,14 +337,6 @@
      */
     void setEllipsoidAcronym( QString theEllipsoidAcronym );
 
-    /*! Set user hint for validation
-     */
-    void setValidationHint( QString html );
-
-    /*! Get user hint for validation
-     */
-    QString validationHint();
-  private:
     /*! Print the description if debugging
      */
     void debugPrint();

Modified: trunk/qgis/src/core/qgscoordinatetransform.cpp
===================================================================
--- trunk/qgis/src/core/qgscoordinatetransform.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/core/qgscoordinatetransform.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -52,8 +52,8 @@
 }
 
 QgsCoordinateTransform::QgsCoordinateTransform( long theSourceSrsId, long theDestSrsId )
-    : mSourceCRS( theSourceSrsId, QgsCoordinateReferenceSystem::QGIS_CRSID ),
-    mDestCRS( theDestSrsId, QgsCoordinateReferenceSystem::QGIS_CRSID )
+    : mSourceCRS( theSourceSrsId, QgsCoordinateReferenceSystem::InternalCrsId ),
+    mDestCRS( theDestSrsId, QgsCoordinateReferenceSystem::InternalCrsId )
 {
   initialise();
 }
@@ -73,7 +73,7 @@
 
 QgsCoordinateTransform::QgsCoordinateTransform( long theSourceSrid,
     QString theDestWKT,
-    QgsCoordinateReferenceSystem::CRS_TYPE theSourceCRSType ): QObject()
+    QgsCoordinateReferenceSystem::CrsType theSourceCRSType ): QObject()
 {
   setFinder();
 
@@ -437,7 +437,7 @@
   // if the source/destination projection is lat/long, convert the points to radians
   // prior to transforming
   if (( pj_is_latlong( mDestinationProjection ) && ( direction == INVERSE ) )
-      || ( pj_is_latlong( mSourceProjection ) && ( direction == FORWARD ) ) )
+      || ( pj_is_latlong( mSourceProjection ) && ( direction == ForwardTransform ) ) )
   {
     for ( int i = 0; i < numPoints; ++i )
     {
@@ -462,7 +462,7 @@
   else
   {
 #if 0
-    QgsDebugMsg( "!!!! FORWARD PROJ4 TRANSFORM !!!!" );
+    QgsDebugMsg( "!!!! ForwardTransform PROJ4 TRANSFORM !!!!" );
     QgsDebugMsg( QString( "     numPoint: %1" ).arg( numPoints ) );
     QgsDebugMsg( QString( "     x       : %1" ).arg( x ) );
     QgsDebugMsg( QString( "     y       : %1" ).arg( y ) );
@@ -483,7 +483,7 @@
     pjErr << tr( "Failed" ) << " " << dir << " " << tr( "transform of" ) << '\n';
     for ( int i = 0; i < numPoints; ++i )
     {
-      if ( direction == FORWARD )
+      if ( direction == ForwardTransform )
       {
         pjErr << "(" << x[i] << ", " << y[i] << ")\n";
       }
@@ -504,7 +504,7 @@
   }
   // if the result is lat/long, convert the results from radians back
   // to degrees
-  if (( pj_is_latlong( mDestinationProjection ) && ( direction == FORWARD ) )
+  if (( pj_is_latlong( mDestinationProjection ) && ( direction == ForwardTransform ) )
       || ( pj_is_latlong( mSourceProjection ) && ( direction == INVERSE ) ) )
   {
     for ( int i = 0; i < numPoints; ++i )

Modified: trunk/qgis/src/core/qgscoordinatetransform.h
===================================================================
--- trunk/qgis/src/core/qgscoordinatetransform.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/core/qgscoordinatetransform.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -79,11 +79,11 @@
      * of the layer and map canvas coordinate system as Wkt
      * @param theSourceSrid Spatial Ref Id of the layer's coordinate system
      * @param theSourceWKT WKT of the map canvas coordinate system
-     * @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CRS_TYPE
+     * @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CrsType
      */
     QgsCoordinateTransform( long theSourceSrid,
                             QString theDestWKT,
-                            QgsCoordinateReferenceSystem::CRS_TYPE theSourceCRSType = QgsCoordinateReferenceSystem::POSTGIS_SRID );
+                            QgsCoordinateReferenceSystem::CrsType theSourceCRSType = QgsCoordinateReferenceSystem::PostgisCrsId );
 
     //! destructor
     ~QgsCoordinateTransform();
@@ -91,7 +91,7 @@
     //! Enum used to indicate the direction (forward or inverse) of the transform
     enum TransformDirection
     {
-      FORWARD,     /*!< Transform from source to destination CRS. */
+      ForwardTransform,     /*!< Transform from source to destination CRS. */
       INVERSE      /*!< Transform from destination to source CRS. */
     };
 
@@ -120,62 +120,62 @@
     QgsCoordinateReferenceSystem& destCRS() { return mDestCRS; }
 
     /*! Transform the point from Source Coordinate System to Destination Coordinate System
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * @param p Point to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsPoint in Destination Coordinate System
      */
-    QgsPoint transform( const QgsPoint p, TransformDirection direction = FORWARD ) const;
+    QgsPoint transform( const QgsPoint p, TransformDirection direction = ForwardTransform ) const;
 
     /*! Transform the point specified by x,y from Source Coordinate System to Destination Coordinate System
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * @param x x cordinate of point to transform
     * @param y y coordinate of point to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsPoint in Destination Coordinate System
      */
-    QgsPoint transform( const double x, const double y, TransformDirection direction = FORWARD ) const;
+    QgsPoint transform( const double x, const double y, TransformDirection direction = ForwardTransform ) const;
 
     /*! Transform a QgsRect to the dest Coordinate system
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * It assumes that rect is a bounding box, and creates a bounding box
     * in the proejcted CS, so that all points in source rectangle is within
     * returned rectangle.
     * @param QgsRect rect to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsRect in Destination Coordinate System
      */
-    QgsRect transformBoundingBox( const QgsRect theRect, TransformDirection direction = FORWARD ) const;
+    QgsRect transformBoundingBox( const QgsRect theRect, TransformDirection direction = ForwardTransform ) const;
 
     // Same as for the other transform() functions, but alters the x
     // and y variables in place. The second one works with good old-fashioned
     // C style arrays.
-    void transformInPlace( double& x, double& y, double &z, TransformDirection direction = FORWARD ) const;
+    void transformInPlace( double& x, double& y, double &z, TransformDirection direction = ForwardTransform ) const;
 
     void transformInPlace( std::vector<double>& x, std::vector<double>& y, std::vector<double>& z,
-                           TransformDirection direction = FORWARD ) const;
+                           TransformDirection direction = ForwardTransform ) const;
 
     /*! Transform a QgsRect to the dest Coordinate system
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * @param QgsRect rect to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsRect in Destination Coordinate System
      */
-    QgsRect transform( const QgsRect theRect, TransformDirection direction = FORWARD ) const;
+    QgsRect transform( const QgsRect theRect, TransformDirection direction = ForwardTransform ) const;
 
     /*! Transform an array of coordinates to a different Coordinate System
-    * If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
+    * If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
     * otherwise points are transformed from map canvas CS to layerCS.
     * @param x x cordinate of point to transform
     * @param y y coordinate of point to transform
-    * @param direction TransformDirection (defaults to FORWARD)
+    * @param direction TransformDirection (defaults to ForwardTransform)
     * @return QgsRect in Destination Coordinate System
      */
-    void transformCoords( const int &numPoint, double *x, double *y, double *z, TransformDirection direction = FORWARD ) const;
+    void transformCoords( const int &numPoint, double *x, double *y, double *z, TransformDirection direction = ForwardTransform ) const;
 
     /*!
      * Flag to indicate whether the coordinate systems have been initialised

Modified: trunk/qgis/src/core/qgsdistancearea.cpp
===================================================================
--- trunk/qgis/src/core/qgsdistancearea.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/core/qgsdistancearea.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -44,7 +44,7 @@
   // init with default settings
   mProjectionsEnabled = FALSE;
   mCoordTransform = new QgsCoordinateTransform;
-  setSourceEPSG( GEOEPSG_ID ); // WGS 84
+  setSourceEpsgCrsId( GEO_EPSG_CRS_ID ); // WGS 84
   setEllipsoid( "WGS84" );
 }
 
@@ -67,7 +67,7 @@
   mCoordTransform->setSourceCRS( srcCRS );
 }
 
-void QgsDistanceArea::setSourceEPSG( long epsgId )
+void QgsDistanceArea::setSourceEpsgCrsId( long epsgId )
 {
   QgsCoordinateReferenceSystem srcCRS;
   srcCRS.createFromEpsg( epsgId );

Modified: trunk/qgis/src/core/qgsdistancearea.h
===================================================================
--- trunk/qgis/src/core/qgsdistancearea.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/core/qgsdistancearea.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -50,8 +50,8 @@
     //! sets source spatial reference system (by QGIS CRS)
     void setSourceCRS( long srsid );
 
-    //! sets source spatial reference system (by EPSG)
-    void setSourceEPSG( long epsgId );
+    //! sets source spatial reference system (by EpsgCrsId)
+    void setSourceEpsgCrsId( long epsgId );
 
     //! returns source spatial reference system
     long sourceCRS() { return mSourceRefSys; }

Modified: trunk/qgis/src/core/qgsmaprenderer.cpp
===================================================================
--- trunk/qgis/src/core/qgsmaprenderer.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/core/qgsmaprenderer.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -49,7 +49,7 @@
   mSize = QSize( 0, 0 );
 
   mProjectionsEnabled = FALSE;
-  mDestCRS = new QgsCoordinateReferenceSystem( GEOEPSG_ID, QgsCoordinateReferenceSystem::EPSG ); //WGS 84
+  mDestCRS = new QgsCoordinateReferenceSystem( GEO_EPSG_CRS_ID, QgsCoordinateReferenceSystem::EpsgCrsId ); //WGS 84
 
   mOutputUnits = QgsMapRenderer::MM;
 }
@@ -580,7 +580,7 @@
     try
     {
       QgsCoordinateTransform tr( theLayer->srs(), *mDestCRS );
-      point = tr.transform( point, QgsCoordinateTransform::FORWARD );
+      point = tr.transform( point, QgsCoordinateTransform::ForwardTransform );
     }
     catch ( QgsCsException &cse )
     {

Modified: trunk/qgis/src/gui/qgsgenericprojectionselector.h
===================================================================
--- trunk/qgis/src/gui/qgsgenericprojectionselector.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/gui/qgsgenericprojectionselector.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -79,7 +79,7 @@
      *                  list of projections by.  This is useful in (e.g.) WMS situations
      *                  where you just want to offer what the WMS server can support.
      *
-     * \note This function only deals with EPSG labels only at this time.
+     * \note This function only deals with EpsgCrsId labels only at this time.
      *
      * \warning This function's behaviour is undefined if it is called after the dialog is shown.
      */

Modified: trunk/qgis/src/gui/qgsprojectionselector.cpp
===================================================================
--- trunk/qgis/src/gui/qgsprojectionselector.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/gui/qgsprojectionselector.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -118,7 +118,7 @@
      Label: The identifier includes a namespace prefix, a colon, a numeric or
         string code, and in some instances a comma followed by additional
         parameters. This International Standard defines three namespaces:
-        CRS, EPSG and AUTO2 [...]
+        CRS, EpsgCrsId and AUTO2 [...]
 
      URL: The identifier is a fully-qualified Uniform Resource Locator that
         references a publicly-accessible file containing a definition of the CRS
@@ -541,7 +541,7 @@
     while ( sqlite3_step( myPreparedStatement ) == SQLITE_ROW )
     {
       newItem = new QTreeWidgetItem( mUserProjList, QStringList( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 0 ) ) ) );
-      // EPSG for user projections is not always defined in some dbases.
+      // EpsgCrsId for user projections is not always defined in some dbases.
       // It's also not written from customprojections dialog.
       // display the epsg (field 2) in the second column of the list view
       // newItem->setText( EPSG_COLUMN, QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 2 ) ) );
@@ -733,7 +733,7 @@
   QString mySearchString( sqlSafeString( leSearch->text() ) );
   // Set up the query to retreive the projection information needed to populate the list
   QString mySql;
-  if ( radEPSGID->isChecked() )
+  if ( radEpsgCrsId->isChecked() )
   {
     mySql = "select srs_id from tbl_srs where epsg=" + mySearchString;
   }

Modified: trunk/qgis/src/gui/qgsprojectionselector.h
===================================================================
--- trunk/qgis/src/gui/qgsprojectionselector.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/gui/qgsprojectionselector.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -66,7 +66,7 @@
      */
     const QString sqlSafeString( const QString theSQL );
 
-    //! Gets the current EPSG-style projection identifier
+    //! Gets the current EpsgCrsId-style projection identifier
     long selectedEpsg();
 
   public slots:
@@ -96,7 +96,7 @@
      *                  list of projections by.  This is useful in (e.g.) WMS situations
      *                  where you just want to offer what the WMS server can support.
      *
-     * \note This function only deals with EPSG labels only at this time.
+     * \note This function only deals with EpsgCrsId labels only at this time.
      *
      * \warning This function's behaviour is undefined if it is called after the widget is shown.
      */
@@ -122,7 +122,7 @@
      *                  list of projections by.  This is useful in (e.g.) WMS situations
      *                  where you just want to offer what the WMS server can support.
      *
-     * \note This function only deals with EPSG labels only at this time.
+     * \note This function only deals with EpsgCrsId labels only at this time.
      */
     QString ogcWmsCrsFilterAsSqlExpression( QSet<QString> * crsFilter );
 

Modified: trunk/qgis/src/plugins/coordinate_capture/coordinatecapture.cpp
===================================================================
--- trunk/qgis/src/plugins/coordinate_capture/coordinatecapture.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/plugins/coordinate_capture/coordinatecapture.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -80,7 +80,7 @@
  */
 void CoordinateCapture::initGui()
 {
-  mEpsgId = GEOEPSG_ID;
+  mEpsgId = GEO_EPSG_CRS_ID;
   // Create the action for tool
   mQActionPointer = new QAction( QIcon( ":/coordinatecapture/coordinate_capture.png" ), tr( "Coordinate Capture" ), this );
   // Set the what's this text

Modified: trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp
===================================================================
--- trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/plugins/grass/qgsgrassnewmapset.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -857,9 +857,9 @@
   // Warning: seems that crashes if source == dest
   if ( mProjectionSelector->selectedCrsId() != GEOCRS_ID )
   {
-    // Warning: QgsCoordinateReferenceSystem::EPSG is broken (using epsg_id)
-    //QgsCoordinateReferenceSystem source ( 4326, QgsCoordinateReferenceSystem::EPSG );
-    QgsCoordinateReferenceSystem source( GEOCRS_ID, QgsCoordinateReferenceSystem::QGIS_CRSID );
+    // Warning: QgsCoordinateReferenceSystem::EpsgCrsId is broken (using epsg_id)
+    //QgsCoordinateReferenceSystem source ( 4326, QgsCoordinateReferenceSystem::EpsgCrsId );
+    QgsCoordinateReferenceSystem source( GEOCRS_ID, QgsCoordinateReferenceSystem::InternalCrsId );
 
     if ( !source.isValid() )
     {
@@ -869,7 +869,7 @@
     }
 
     QgsCoordinateReferenceSystem dest( mProjectionSelector->selectedCrsId(),
-                                       QgsCoordinateReferenceSystem::QGIS_CRSID );
+                                       QgsCoordinateReferenceSystem::InternalCrsId );
 
     if ( !dest.isValid() )
     {
@@ -952,7 +952,7 @@
   int srsid = QgsProject::instance()->readNumEntry(
                 "SpatialRefSys", "/ProjectCRSID", 0 );
 
-  QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::QGIS_CRSID );
+  QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::InternalCrsId );
   QgsDebugMsg( QString( "current project srsid = %1" ).arg( srsid ) );
   QgsDebugMsg( QString( "srs.isValid() = %1" ).arg( srs.isValid() ) );
 
@@ -1070,7 +1070,7 @@
   if ( mProjectionSelector->selectedCrsId() != GEOCRS_ID )
   {
     QgsCoordinateReferenceSystem source( mProjectionSelector->selectedCrsId(),
-                                         QgsCoordinateReferenceSystem::QGIS_CRSID );
+                                         QgsCoordinateReferenceSystem::InternalCrsId );
 
     if ( !source.isValid() )
     {
@@ -1079,7 +1079,7 @@
       return;
     }
 
-    QgsCoordinateReferenceSystem dest( GEOCRS_ID, QgsCoordinateReferenceSystem::QGIS_CRSID );
+    QgsCoordinateReferenceSystem dest( GEOCRS_ID, QgsCoordinateReferenceSystem::InternalCrsId );
 
     if ( !dest.isValid() )
     {
@@ -1426,7 +1426,7 @@
         int srsid = QgsProject::instance()->readNumEntry(
                       "SpatialRefSys", "/ProjectCRSID", 0 );
 
-        QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::QGIS_CRSID );
+        QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::InternalCrsId );
         QgsDebugMsg( QString( "current project srsid = %1" ).arg( srsid ) );
         QgsDebugMsg( QString( "srs.isValid() = %1" ).arg( srs.isValid() ) );
         if ( srs.isValid() )

Modified: trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp
===================================================================
--- trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/plugins/wfs/qgswfssourceselect.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -97,7 +97,7 @@
   //first: project CRS
   long ProjectCRSID = QgsProject::instance()->readNumEntry( "SpatialRefSys", "/ProjectCRSID", -1 );
   //convert to EPSG
-  QgsCoordinateReferenceSystem projectRefSys( ProjectCRSID, QgsCoordinateReferenceSystem::QGIS_CRSID );
+  QgsCoordinateReferenceSystem projectRefSys( ProjectCRSID, QgsCoordinateReferenceSystem::InternalCrsId );
   int ProjectCRS = -1;
   if ( projectRefSys.isValid() )
   {

Modified: trunk/qgis/src/providers/wfs/qgswfsdata.h
===================================================================
--- trunk/qgis/src/providers/wfs/qgswfsdata.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/providers/wfs/qgswfsdata.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -94,7 +94,7 @@
     }
 
     //helper routines
-    /**Reads attribute srsName="EPSG:..."
+    /**Reads attribute srsName="EpsgCrsId:..."
        @param epsgNr result
        @param attr attribute strings
        @return 0 in case of success*/

Modified: trunk/qgis/src/providers/wfs/qgswfsprovider.cpp
===================================================================
--- trunk/qgis/src/providers/wfs/qgswfsprovider.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/providers/wfs/qgswfsprovider.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -699,7 +699,7 @@
   QgsDebugMsg( "srsName is: " + srsName );
 
 
-  //extract the EPSG id
+  //extract the EpsgCrsId id
   int epsgId;
   bool conversionSuccess;
   if ( srsName.contains( "#" ) )//geoserver has "http://www.opengis.net/gml/srs/epsg.xml#4326"
@@ -719,7 +719,7 @@
     }
   }
   else
-    epsgId = GEOEPSG_ID;
+    epsgId = GEO_EPSG_CRS_ID;
 
   if ( !mSourceCRS.createFromEpsg( epsgId ) )
   {

Modified: trunk/qgis/src/providers/wms/qgswmsprovider.cpp
===================================================================
--- trunk/qgis/src/providers/wms/qgswmsprovider.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/providers/wms/qgswmsprovider.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -1749,7 +1749,7 @@
     // Convert to the user's CRS as required
     try
     {
-      extent = mCoordinateTransform->transformBoundingBox( extent, QgsCoordinateTransform::FORWARD );
+      extent = mCoordinateTransform->transformBoundingBox( extent, QgsCoordinateTransform::ForwardTransform );
     }
     catch ( QgsCsException &cse )
     {

Modified: trunk/qgis/src/ui/qgsprojectionselectorbase.ui
===================================================================
--- trunk/qgis/src/ui/qgsprojectionselectorbase.ui	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/src/ui/qgsprojectionselectorbase.ui	2008-10-16 06:31:25 UTC (rev 9478)
@@ -112,7 +112,7 @@
      </property>
      <layout class="QGridLayout" >
       <item row="0" column="0" >
-       <widget class="QRadioButton" name="radEPSGID" >
+       <widget class="QRadioButton" name="radEpsgCrsId" >
         <property name="text" >
          <string>EPSG ID</string>
         </property>

Modified: trunk/qgis/tests/algorithms/projections/projectioncshandlingtest.h
===================================================================
--- trunk/qgis/tests/algorithms/projections/projectioncshandlingtest.h	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/tests/algorithms/projections/projectioncshandlingtest.h	2008-10-16 06:31:25 UTC (rev 9478)
@@ -159,12 +159,12 @@
     }
     //
     // Test fetch of proj4 parameters from GEOGCS NAD83 OGRSpatialReference object
-    // in EPSG format
+    // in EpsgCrsId format
     // Failure occurs if datum field is not found in the proj4 parameter string
     //
     void testProjEpsgExportToProj4()
     {
-      std::cout << "\n\nGetting NAD83 proj4 parameters from an EPSG format WKT" << std::endl;
+      std::cout << "\n\nGetting NAD83 proj4 parameters from an EpsgCrsId format WKT" << std::endl;
       // set up the spatial ref
       OGRSpatialReference myInputSpatialRefSys;
       char *pWkt = ( char* )wktEpsg.ascii();
@@ -299,7 +299,7 @@
     QString wktDest;
     // WKT for an ESRI style GEOGCS in NAD83 (from states.shp shapefile)
     QString wktDestNad83;
-    // WKT for an EPSG style GEOGCS
+    // WKT for an EpsgCrsId style GEOGCS
     QString wktEpsg;
     // WKT for an ESRI style PROJCS as read from a shapefile
     QString wktAkAlbers;

Modified: trunk/qgis/tests/src/core/testqgsvectorfilewriter.cpp
===================================================================
--- trunk/qgis/tests/src/core/testqgsvectorfilewriter.cpp	2008-10-15 06:55:42 UTC (rev 9477)
+++ trunk/qgis/tests/src/core/testqgsvectorfilewriter.cpp	2008-10-16 06:31:25 UTC (rev 9478)
@@ -333,7 +333,7 @@
   // +proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=250000 
   // +y_0=150000 +ellps=clrk66 +units=m +no_defs
   //
-  mCRS = QgsCoordinateReferenceSystem(1286,QgsCoordinateReferenceSystem::QGIS_CRSID);
+  mCRS = QgsCoordinateReferenceSystem(1286,QgsCoordinateReferenceSystem::InternalCrsId);
   QgsVectorFileWriter myWriter (myFileName,
       mEncoding,
       mFields,



More information about the QGIS-commit mailing list