Skip to content

Commit 874a7c2

Browse files

33 files changed

+180
-244
lines changed
 

‎python/core/qgis.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ public:
9898
const long GEOSRID;
9999
/** Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id */
100100
const long GEOCRS_ID;
101-
/** Magic number for a geographic coord sys in EPSG ID format */
102-
const long GEOEPSG_ID;
101+
/** Magic number for a geographic coord sys in EpsgCrsId ID format */
102+
const long GEO_EPSG_CRS_ID;
103103
/** The length of teh string "+proj=" */
104104
const int PROJ_PREFIX_LEN;
105105
/** The length of teh string "+ellps=" */

‎python/core/qgscoordinatereferencesystem.sip

Lines changed: 20 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ class QgsCoordinateReferenceSystem
1212

1313
// typedef void (*CUSTOM_CRS_VALIDATION)(QgsCoordinateReferenceSystem*);
1414

15-
enum CRS_TYPE {
16-
QGIS_CRSID,
17-
POSTGIS_SRID,
18-
EPSG
15+
enum CrsType {
16+
InternalCrsId,
17+
PostgisCrsId,
18+
EpsgCrsId
1919
};
2020

2121
//! Default constructor
@@ -30,24 +30,24 @@ class QgsCoordinateReferenceSystem
3030
explicit QgsCoordinateReferenceSystem(QString theWkt);
3131

3232
/*! Use this constructor when you want to create a CRS object using
33-
* a postgis SRID, an EPSG id or a QGIS CRS_ID.
33+
* a postgis SRID, an Epsg Id id or a QGIS CRS_ID.
3434
* @param theId The ID no valid for the chosen coordinate system id type
35-
* @param theType One of the types described in QgsCoordinateReferenceSystem::CRS_TYPE
35+
* @param theType One of the types described in QgsCoordinateReferenceSystem::CrsType
3636
*/
37-
QgsCoordinateReferenceSystem(const long theId, CRS_TYPE theType=POSTGIS_SRID);
37+
QgsCoordinateReferenceSystem(const long theId, CrsType theType=PostgisCrsId);
3838

3939
// Misc helper functions -----------------------
4040

41-
void createFromId(const long theId, CRS_TYPE theType=POSTGIS_SRID);
41+
void createFromId(const long theId, CrsType theType=PostgisCrsId);
4242

4343
/**
4444
* \brief Set up this CRS from the given OGC CRS
4545
*
4646
* Sets this CRS to the given OGC WMS-format Coordinate Reference Systems.
4747
*
48-
* \note This function only deals with EPSG labels only at this time.
48+
* \note This function only deals with Epsg Id labels only at this time.
4949
*
50-
* \retval FALSE if not given an EPSG label
50+
* \retval FALSE if not given an Epsg Id label
5151
*/
5252
bool createFromOgcWmsCrs(QString theCrs);
5353

@@ -65,7 +65,7 @@ class QgsCoordinateReferenceSystem
6565
* First the system level read only srs.db will be checked
6666
* and then the users ~/.qgis/qgis.db database will be checked for a match.
6767
* @note Any members will be overwritten during this process.
68-
* @note SRID and EPSG may be blank if no match can be found on srs db.
68+
* @note SRID and EpsgCrsId may be blank if no match can be found on srs db.
6969
* @param theWkt The WKT for the desired spatial reference system.
7070
* @return bool TRUE if sucess else false
7171
*/
@@ -75,7 +75,7 @@ class QgsCoordinateReferenceSystem
7575
* sqlite backend. First the system level read only srs.db will be checked
7676
* and then the users ~/.qgis/qgis.db database will be checked for a match.
7777
* @note Any members will be overwritten during this process.
78-
* @param theEpsg The EPSG for the desired spatial reference system.
78+
* @param theEpsg The EpsgCrsId for the desired spatial reference system.
7979
* @return bool TRUE if sucess else false
8080
*/
8181
bool createFromEpsg(const long theEpsg);
@@ -206,10 +206,14 @@ class QgsCoordinateReferenceSystem
206206
* @return long theSrsId The internal sqlite3 srs.db primary key for this srs
207207
*/
208208
long srsid() const;
209-
/*! Get the Postgis SRID - if possible.
210-
* @return long theSRID The internal postgis SRID for this CRS
211-
*/
212-
long srid() const;
209+
/*! Get the postgis srid for this srs
210+
* @return long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
211+
*/
212+
long postgisSrid () const;
213+
/*! Get the EpsgCrsId identifier for this srs
214+
* @return long theEpsg the ESPG identifier for this srs (defaults to 0)
215+
*/
216+
long epsg () const;
213217
/*! Get the Description
214218
* @return QString the Description A textual description of the srs.
215219
* @note A zero length string will be returned if the description is uninitialised
@@ -241,49 +245,7 @@ class QgsCoordinateReferenceSystem
241245
*/
242246
QGis::UnitType mapUnits() const;
243247

244-
/*! Set the postgis srid for this srs
245-
* @return long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
246-
*/
247-
long postgisSrid () const;
248-
/*! Set the EPSG identifier for this srs
249-
* @return long theEpsg the ESPG identifier for this srs (defaults to 0)
250-
*/
251-
long epsg () const;
252-
253-
// Mutators -----------------------------------
254248

255-
/*! Set the QGIS SrsId
256-
* @param long theSrsId The internal sqlite3 srs.db primary key for this srs
257-
*/
258-
void setSrsId(long theSrsId);
259-
/*! Set the postgis srid
260-
* @param long theSrsId The postgis spatial_ref_sys key for this srs
261-
*/
262-
void setSrid(long theSrid);
263-
/*! Set the Description
264-
* @param QString the Description A textual description of the srs.
265-
*/
266-
void setDescription (QString theDescription);
267-
/* Set the Proj Proj4String.
268-
* @param QString theProj4String Proj4 format specifies (excluding proj and ellips) that define this srs.
269-
*/
270-
void setProj4String (QString theProj4String);
271-
/*! Set this Geographic? flag
272-
* @param bool theGeoFlag Whether this is a geographic or projected coordinate system
273-
*/
274-
void setGeographicFlag (bool theGeoFlag);
275-
/*! Set the EPSG identifier for this srs
276-
* @param long theEpsg the ESPG identifier for this srs (defaults to 0)
277-
*/
278-
void setEpsg (long theEpsg);
279-
/*! Set the projection acronym
280-
* @param QString the acronym (must be a valid proj4 projection acronym)
281-
*/
282-
void setProjectionAcronym(QString theProjectionAcronym);
283-
/*! Set the ellipsoid acronym
284-
* @param QString the acronym (must be a valid proj4 ellipsoid acronym)
285-
*/
286-
void setEllipsoidAcronym(QString theEllipsoidAcronym);
287249
};
288250

289251

‎python/core/qgscoordinatetransform.sip

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ class QgsCoordinateTransform : QObject
4545
* of the layer and map canvas coordinate system as Wkt
4646
* @param theSourceSrid Spatial Ref Id of the layer's coordinate system
4747
* @param theSourceWKT WKT of the map canvas coordinate system
48-
* @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CRS_TYPE
48+
* @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CrsType
4949
*/
5050
QgsCoordinateTransform(long theSourceSrid,
5151
QString theDestWKT,
52-
QgsCoordinateReferenceSystem::CRS_TYPE theSourceCRSType = QgsCoordinateReferenceSystem::POSTGIS_SRID );
52+
QgsCoordinateReferenceSystem::CrsType theSourceCRSType = QgsCoordinateReferenceSystem::PostgisCrsId );
5353

5454
//! destructor
5555
~QgsCoordinateTransform();
5656

5757
//! Enum used to indicate the direction (forward or inverse) of the transform
5858
enum TransformDirection{
59-
FORWARD, /*!< Transform from source to destination CRS. */
59+
ForwardTransform, /*!< Transform from source to destination CRS. */
6060
INVERSE /*!< Transform from destination to source CRS. */
6161
};
6262

@@ -85,63 +85,63 @@ class QgsCoordinateTransform : QObject
8585
QgsCoordinateReferenceSystem& destCRS();
8686

8787
/*! Transform the point from Source Coordinate System to Destination Coordinate System
88-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
88+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
8989
* otherwise points are transformed from map canvas CS to layerCS.
9090
* @param p Point to transform
91-
* @param direction TransformDirection (defaults to FORWARD)
91+
* @param direction TransformDirection (defaults to ForwardTransform)
9292
* @return QgsPoint in Destination Coordinate System
9393
*/
94-
QgsPoint transform(const QgsPoint p,TransformDirection direction=FORWARD);
94+
QgsPoint transform(const QgsPoint p,TransformDirection direction=ForwardTransform);
9595

9696
/*! Transform the point specified by x,y from Source Coordinate System to Destination Coordinate System
97-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
97+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
9898
* otherwise points are transformed from map canvas CS to layerCS.
9999
* @param x x cordinate of point to transform
100100
* @param y y coordinate of point to transform
101-
* @param direction TransformDirection (defaults to FORWARD)
101+
* @param direction TransformDirection (defaults to ForwardTransform)
102102
* @return QgsPoint in Destination Coordinate System
103103
*/
104-
QgsPoint transform(const double x, const double y,TransformDirection direction=FORWARD);
104+
QgsPoint transform(const double x, const double y,TransformDirection direction=ForwardTransform);
105105

106106
/*! Transform a QgsRect to the dest Coordinate system
107-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
107+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
108108
* otherwise points are transformed from map canvas CS to layerCS.
109109
* It assumes that rect is a bounding box, and creates a bounding box
110110
* in the proejcted CS, so that all points in source rectangle is within
111111
* returned rectangle.
112112
* @param QgsRect rect to transform
113-
* @param direction TransformDirection (defaults to FORWARD)
113+
* @param direction TransformDirection (defaults to ForwardTransform)
114114
* @return QgsRect in Destination Coordinate System
115115
*/
116-
QgsRect transformBoundingBox(const QgsRect theRect,TransformDirection direction=FORWARD);
116+
QgsRect transformBoundingBox(const QgsRect theRect,TransformDirection direction=ForwardTransform);
117117

118118
// Same as for the other transform() functions, but alters the x
119119
// and y variables in place. The second one works with good old-fashioned
120120
// C style arrays.
121-
void transformInPlace(double& x, double& y, double &z, TransformDirection direction = FORWARD);
121+
void transformInPlace(double& x, double& y, double &z, TransformDirection direction = ForwardTransform);
122122

123123
// TODO: argument not supported
124124
//void transformInPlace(std::vector<double>& x, std::vector<double>& y, std::vector<double>& z,
125-
// TransformDirection direction = FORWARD);
125+
// TransformDirection direction = ForwardTransform);
126126

127127
/*! Transform a QgsRect to the dest Coordinate system
128-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
128+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
129129
* otherwise points are transformed from map canvas CS to layerCS.
130130
* @param QgsRect rect to transform
131-
* @param direction TransformDirection (defaults to FORWARD)
131+
* @param direction TransformDirection (defaults to ForwardTransform)
132132
* @return QgsRect in Destination Coordinate System
133133
*/
134-
QgsRect transform(const QgsRect theRect,TransformDirection direction=FORWARD);
134+
QgsRect transform(const QgsRect theRect,TransformDirection direction=ForwardTransform);
135135

136136
/*! Transform an array of coordinates to a different Coordinate System
137-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
137+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
138138
* otherwise points are transformed from map canvas CS to layerCS.
139139
* @param x x cordinate of point to transform
140140
* @param y y coordinate of point to transform
141-
* @param direction TransformDirection (defaults to FORWARD)
141+
* @param direction TransformDirection (defaults to ForwardTransform)
142142
* @return QgsRect in Destination Coordinate System
143143
*/
144-
void transformCoords( const int &numPoint, double *x, double *y, double *z,TransformDirection direction=FORWARD);
144+
void transformCoords( const int &numPoint, double *x, double *y, double *z,TransformDirection direction=ForwardTransform);
145145

146146
/*!
147147
* Flag to indicate whether the coordinate systems have been initialised

‎python/core/qgsdistancearea.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class QgsDistanceArea
2222
//! sets source spatial reference system (by QGIS CRS)
2323
void setSourceCRS(long srsid);
2424

25-
//! sets source spatial reference system (by EPSG)
26-
void setSourceEPSG(long epsgId);
25+
//! sets source spatial reference system (by EpsgCrsId)
26+
void setSourceEpsgCrsId(long epsgId);
2727

2828
//! returns source spatial reference system
2929
long sourceCRS();

‎python/gui/qgsgenericprojectionselector.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class QgsGenericProjectionSelector : QDialog //, private Ui::QgsGenericProjectio
4343
* list of projections by. This is useful in (e.g.) WMS situations
4444
* where you just want to offer what the WMS server can support.
4545
*
46-
* \note This function only deals with EPSG labels only at this time.
46+
* \note This function only deals with EpsgCrsId labels only at this time.
4747
*
4848
* \warning This function's behaviour is undefined if it is called after the dialog is shown.
4949
*/

‎python/gui/qgsprojectionselector.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class QgsProjectionSelector: QWidget //, private Ui::QgsProjectionSelectorBase
5353
*/
5454
const QString sqlSafeString(const QString theSQL);
5555

56-
//! Gets the current EPSG-style projection identifier
56+
//! Gets the current EpsgCrsId-style projection identifier
5757
long selectedEpsg();
5858

5959
public slots:
@@ -83,7 +83,7 @@ class QgsProjectionSelector: QWidget //, private Ui::QgsProjectionSelectorBase
8383
* list of projections by. This is useful in (e.g.) WMS situations
8484
* where you just want to offer what the WMS server can support.
8585
*
86-
* \note This function only deals with EPSG labels only at this time.
86+
* \note This function only deals with EpsgCrsId labels only at this time.
8787
*
8888
* \warning This function's behaviour is undefined if it is called after the widget is shown.
8989
*/

‎resources/qgis_help.db

10 Bytes
Binary file not shown.

‎src/app/legend/qgslegendlayerfile.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@ void QgsLegendLayerFile::saveAsShapefileGeneral( bool saveOnlySelection )
282282

283283
if ( mySelector->exec() )
284284
{
285-
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::QGIS_CRSID );
285+
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
286286
destCRS = srs;
287-
// destCRS->createFromId(mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::QGIS_CRSID)
287+
// destCRS->createFromId(mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId)
288288
}
289289
else
290290
{

‎src/app/qgsprojectproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ void QgsProjectProperties::apply()
248248
long myCRSID = projectionSelector->selectedCrsId();
249249
if ( myCRSID )
250250
{
251-
QgsCoordinateReferenceSystem srs( myCRSID, QgsCoordinateReferenceSystem::QGIS_CRSID );
251+
QgsCoordinateReferenceSystem srs( myCRSID, QgsCoordinateReferenceSystem::InternalCrsId );
252252
myRender->setDestinationSrs( srs );
253253

254254
// write the currently selected projections _proj string_ to project settings

‎src/app/qgsrasterlayerproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1687,7 +1687,7 @@ void QgsRasterLayerProperties::on_pbnChangeSpatialRefSys_clicked()
16871687
mySelector->setSelectedCrsId( mRasterLayer->srs().srsid() );
16881688
if ( mySelector->exec() )
16891689
{
1690-
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::QGIS_CRSID );
1690+
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
16911691
mRasterLayer->setSrs( srs );
16921692
}
16931693
else

‎src/app/qgsserversourceselect.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@
3838
#include <QMap>
3939
#include <QImageReader>
4040
#include "qgslogger.h"
41+
#include "qgis.h" // GEO_EPSG_CRS_ID
4142

4243

43-
static long DEFAULT_WMS_EPSG = 4326; // WGS 84
4444

4545

4646
QgsServerSourceSelect::QgsServerSourceSelect( QWidget * parent, Qt::WFlags fl )
4747
: QDialog( parent, fl ),
48-
m_Epsg( DEFAULT_WMS_EPSG ),
48+
m_Epsg( GEO_EPSG_CRS_ID ),
4949
mWmsProvider( 0 )
5050
{
5151
setupUi( this );
@@ -97,7 +97,7 @@ QgsServerSourceSelect::QgsServerSourceSelect( QWidget * parent, Qt::WFlags fl )
9797
if ( currentCRS != -1 )
9898
{
9999
//convert CRS id to epsg
100-
QgsCoordinateReferenceSystem currentRefSys( currentCRS, QgsCoordinateReferenceSystem::QGIS_CRSID );
100+
QgsCoordinateReferenceSystem currentRefSys( currentCRS, QgsCoordinateReferenceSystem::InternalCrsId );
101101
if ( currentRefSys.isValid() )
102102
{
103103
m_Epsg = currentRefSys.epsg();
@@ -496,8 +496,8 @@ void QgsServerSourceSelect::on_lstLayers_itemSelectionChanged()
496496
// save first CRS in case we current m_Epsg is not available
497497
if ( i == crsFilter.begin() )
498498
defaultEpsg = epsg;
499-
// prefer value of DEFAULT_WMS_EPSG if available
500-
if ( epsg == DEFAULT_WMS_EPSG )
499+
// prefer value of DEFAULT_GEO_EPSG_CRS_ID if available
500+
if ( epsg == GEO_EPSG_CRS_ID )
501501
defaultEpsg = epsg;
502502
}
503503
}
@@ -653,7 +653,7 @@ QString QgsServerSourceSelect::descriptionForEpsg( long epsg )
653653
// We'll assume this function isn't called very often,
654654
// so please forgive the lack of caching of results
655655

656-
QgsCoordinateReferenceSystem qgisSrs = QgsCoordinateReferenceSystem( epsg, QgsCoordinateReferenceSystem::EPSG );
656+
QgsCoordinateReferenceSystem qgisSrs = QgsCoordinateReferenceSystem( epsg, QgsCoordinateReferenceSystem::EpsgCrsId );
657657

658658
return qgisSrs.description();
659659
}

‎src/app/qgsserversourceselect.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ class QgsServerSourceSelect : public QDialog, private Ui::QgsServerSourceSelectB
140140
//! Populate the image encoding button group - private for now.
141141
void populateImageEncodingGroup( QgsWmsProvider* wmsProvider );
142142

143-
//! Returns a textual description for the EPSG number
143+
//! Returns a textual description for the EpsgCrsId number
144144
QString descriptionForEpsg( long epsg );
145145

146146
//! Name for selected connection

‎src/app/qgsvectorlayerproperties.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,7 +866,7 @@ void QgsVectorLayerProperties::on_pbnChangeSpatialRefSys_clicked()
866866
mySelector->setSelectedCrsId( layer->srs().srsid() );
867867
if ( mySelector->exec() )
868868
{
869-
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::QGIS_CRSID );
869+
QgsCoordinateReferenceSystem srs( mySelector->selectedCrsId(), QgsCoordinateReferenceSystem::InternalCrsId );
870870
layer->setSrs( srs );
871871
}
872872
else

‎src/core/qgis.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ const QString GEOPROJ4 = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs";
131131
const long GEOSRID = 4326;
132132
/** Magic number for a geographic coord sys in QGIS srs.db tbl_srs.srs_id */
133133
const long GEOCRS_ID = 3344;
134-
/** Magic number for a geographic coord sys in EPSG ID format */
135-
const long GEOEPSG_ID = 4326;
134+
/** Magic number for a geographic coord sys in EpsgCrsId ID format */
135+
const long GEO_EPSG_CRS_ID = 4326;
136136
/** The length of the string "+proj=" */
137137
const int PROJ_PREFIX_LEN = 6;
138138
/** The length of the string "+ellps=" */

‎src/core/qgscoordinatereferencesystem.cpp

Lines changed: 27 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( QString theWkt )
6161
}
6262

6363

64-
QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( const long theId, CRS_TYPE theType )
64+
QgsCoordinateReferenceSystem::QgsCoordinateReferenceSystem( const long theId, CrsType theType )
6565
: mMapUnits( QGis::UnknownUnit ),
6666
mIsValidFlag( 0 ),
6767
mValidationHint( 0 )
@@ -75,17 +75,17 @@ QgsCoordinateReferenceSystem::~QgsCoordinateReferenceSystem()
7575
OSRDestroySpatialReference( mCRS );
7676
}
7777

78-
void QgsCoordinateReferenceSystem::createFromId( const long theId, CRS_TYPE theType )
78+
void QgsCoordinateReferenceSystem::createFromId( const long theId, CrsType theType )
7979
{
8080
switch ( theType )
8181
{
82-
case QGIS_CRSID:
82+
case InternalCrsId:
8383
createFromSrsId( theId );
8484
break;
85-
case POSTGIS_SRID:
85+
case PostgisCrsId:
8686
createFromSrid( theId );
8787
break;
88-
case EPSG:
88+
case EpsgCrsId:
8989
createFromEpsg( theId );
9090
break;
9191
default:
@@ -180,7 +180,8 @@ bool QgsCoordinateReferenceSystem::createFromEpsg( long id )
180180

181181
bool QgsCoordinateReferenceSystem::createFromSrsId( long id )
182182
{
183-
return loadFromDb( id < 100000 ? QgsApplication::srsDbFilePath() : QgsApplication::qgisUserDbFilePath(), "srs_id", id );
183+
return loadFromDb( id < 100000 ? QgsApplication::srsDbFilePath() :
184+
QgsApplication::qgisUserDbFilePath(), "srs_id", id );
184185
}
185186

186187
bool QgsCoordinateReferenceSystem::loadFromDb( QString db, QString field, long id )
@@ -434,6 +435,7 @@ bool QgsCoordinateReferenceSystem::createFromProj4( const QString theProj4String
434435
return mIsValidFlag;
435436
}
436437

438+
//private method meant for internal use by this class only
437439
QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord( QString theSql )
438440
{
439441
QString myDatabaseFileName;
@@ -537,25 +539,24 @@ QgsCoordinateReferenceSystem::RecordMap QgsCoordinateReferenceSystem::getRecord(
537539
}
538540

539541
// Accessors -----------------------------------
540-
/*! Get the SrsId
541-
* @return long theSrsId The internal sqlite3 srs.db primary key for this srs
542-
*/
542+
543543
long QgsCoordinateReferenceSystem::srsid() const
544544
{
545545
return mSrsId;
546546
}
547-
/*! Get the Postgis SRID - if possible
548-
* @return long theSRID The internal postgis SRID for this CRS
549-
*/
550-
long QgsCoordinateReferenceSystem::srid() const
547+
548+
long QgsCoordinateReferenceSystem::postgisSrid() const
551549
{
552550

553551
return mSRID;
554552

555553
}
556-
/*! Get the Description
557-
* @return QString the Description A textual description of the srs.
558-
*/
554+
555+
long QgsCoordinateReferenceSystem::epsg() const
556+
{
557+
return mEpsg;
558+
}
559+
559560
QString QgsCoordinateReferenceSystem::description() const
560561
{
561562
if ( mDescription.isNull() )
@@ -567,9 +568,7 @@ QString QgsCoordinateReferenceSystem::description() const
567568
return mDescription;
568569
}
569570
}
570-
/*! Get the Projection Acronym
571-
* @return QString theProjectionAcronym The official proj4 acronym for the projection family
572-
*/
571+
573572
QString QgsCoordinateReferenceSystem::projectionAcronym() const
574573
{
575574
if ( mProjectionAcronym.isNull() )
@@ -581,9 +580,7 @@ QString QgsCoordinateReferenceSystem::projectionAcronym() const
581580
return mProjectionAcronym;
582581
}
583582
}
584-
/*! Get the Ellipsoid Acronym
585-
* @return QString theEllipsoidAcronym The official proj4 acronym for the ellipoid
586-
*/
583+
587584
QString QgsCoordinateReferenceSystem::ellipsoidAcronym() const
588585
{
589586
if ( mEllipsoidAcronym.isNull() )
@@ -595,9 +592,7 @@ QString QgsCoordinateReferenceSystem::ellipsoidAcronym() const
595592
return mEllipsoidAcronym;
596593
}
597594
}
598-
/* Get the Proj Proj4String.
599-
* @return QString theProj4String Proj4 format specifies that define this srs.
600-
*/
595+
601596
QString QgsCoordinateReferenceSystem::proj4String() const
602597
{
603598
if ( !mIsValidFlag )
@@ -611,40 +606,22 @@ QString QgsCoordinateReferenceSystem::proj4String() const
611606

612607
return proj4String;
613608
}
614-
/*! Get this Geographic? flag
615-
* @return bool theGeoFlag Whether this is a geographic or projected coordinate system
616-
*/
609+
617610
bool QgsCoordinateReferenceSystem::geographicFlag() const
618611
{
619612
return mGeoFlag;
620613
}
621-
/*! Get the units that the projection is in
622-
* @return QGis::UnitType
623-
*/
614+
624615
QGis::UnitType QgsCoordinateReferenceSystem::mapUnits() const
625616
{
626617
return mMapUnits;
627618
}
628619

629-
/*! Set the postgis srid for this srs
630-
* @return long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
631-
*/
632-
long QgsCoordinateReferenceSystem::postgisSrid() const
633-
{
634-
return mSRID ;
635-
}
636-
/*! Set the EPSG identifier for this srs
637-
* @return long theEpsg the ESPG identifier for this srs (defaults to 0)
638-
*/
639-
long QgsCoordinateReferenceSystem::epsg() const
640-
{
641-
return mEpsg;
642-
}
643620

644621
// Mutators -----------------------------------
645622

646623

647-
void QgsCoordinateReferenceSystem::setSrsId( long theSrsId )
624+
void QgsCoordinateReferenceSystem::setInternalId( long theSrsId )
648625
{
649626
mSrsId = theSrsId;
650627
}
@@ -685,9 +662,7 @@ void QgsCoordinateReferenceSystem::setEllipsoidAcronym( QString theEllipsoidAcr
685662
{
686663
mEllipsoidAcronym = theEllipsoidAcronym;
687664
}
688-
/*! Work out the projection units and set the appropriate local variable
689-
*
690-
*/
665+
691666
void QgsCoordinateReferenceSystem::setMapUnits()
692667
{
693668
if ( !mIsValidFlag )
@@ -912,7 +887,7 @@ bool QgsCoordinateReferenceSystem::readXML( QDomNode & theNode )
912887

913888
myNode = srsNode.namedItem( "srsid" );
914889
myElement = myNode.toElement();
915-
setSrsId( myElement.text().toLong() );
890+
setInternalId( myElement.text().toLong() );
916891

917892
myNode = srsNode.namedItem( "srid" );
918893
myElement = myNode.toElement();
@@ -954,7 +929,7 @@ bool QgsCoordinateReferenceSystem::readXML( QDomNode & theNode )
954929
else
955930
{
956931
// Return default CRS if none was found in the XML.
957-
createFromEpsg( GEOEPSG_ID );
932+
createFromEpsg( GEO_EPSG_CRS_ID );
958933
}
959934
return true;
960935
}
@@ -974,7 +949,7 @@ bool QgsCoordinateReferenceSystem::writeXML( QDomNode & theNode, QDomDocument &
974949
mySrsElement.appendChild( mySrsIdElement );
975950

976951
QDomElement mySridElement = theDoc.createElement( "srid" );
977-
mySridElement.appendChild( theDoc.createTextNode( QString::number( srid() ) ) );
952+
mySridElement.appendChild( theDoc.createTextNode( QString::number( postgisSrid() ) ) );
978953
mySrsElement.appendChild( mySridElement );
979954

980955
QDomElement myEpsgElement = theDoc.createElement( "epsg" );

‎src/core/qgscoordinatereferencesystem.h

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
4444
{
4545
public:
4646

47-
enum CRS_TYPE
47+
enum CrsType
4848
{
49-
QGIS_CRSID,
50-
POSTGIS_SRID,
51-
EPSG
49+
InternalCrsId,
50+
PostgisCrsId,
51+
EpsgCrsId
5252
};
5353

5454
//! Default constructor
@@ -63,13 +63,13 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
6363
explicit QgsCoordinateReferenceSystem( QString theWkt );
6464

6565
/*! Use this constructor when you want to create a CRS object using
66-
* a postgis SRID, an EPSG id or a QGIS CRS_ID.
67-
* @note We encourage you to use EPSG, WKT or Proj4 to describe CRS's in your code
66+
* a postgis SRID, an EpsgCrsId id or a QGIS CRS_ID.
67+
* @note We encourage you to use EpsgCrsId, WKT or Proj4 to describe CRS's in your code
6868
* wherever possible. QGSI CRS_IDs are not guaranteed to be permanent / involatile.
6969
* @param theId The ID no valid for the chosen coordinate system id type
70-
* @param theType One of the types described in QgsCoordinateReferenceSystem::CRS_TYPE
70+
* @param theType One of the types described in QgsCoordinateReferenceSystem::CrsType
7171
*/
72-
QgsCoordinateReferenceSystem( const long theId, CRS_TYPE theType = POSTGIS_SRID );
72+
QgsCoordinateReferenceSystem( const long theId, CrsType theType = PostgisCrsId );
7373

7474
//! copy constructor
7575
QgsCoordinateReferenceSystem( const QgsCoordinateReferenceSystem& srs );
@@ -79,16 +79,16 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
7979

8080
// Misc helper functions -----------------------
8181

82-
void createFromId( const long theId, CRS_TYPE theType = POSTGIS_SRID );
82+
void createFromId( const long theId, CrsType theType = PostgisCrsId );
8383

8484
/**
8585
* \brief Set up this CRS from the given OGC CRS
8686
*
8787
* Sets this CRS to the given OGC WMS-format Coordinate Reference Systems.
8888
*
89-
* \note This function only deals with EPSG labels only at this time.
89+
* \note This function only deals with EpsgCrsId labels only at this time.
9090
*
91-
* \retval FALSE if not given an EPSG label
91+
* \retval FALSE if not given an EpsgCrsId label
9292
*/
9393
bool createFromOgcWmsCrs( QString theCrs );
9494

@@ -106,7 +106,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
106106
* First the system level read only srs.db will be checked
107107
* and then the users ~/.qgis/qgis.db database will be checked for a match.
108108
* @note Any members will be overwritten during this process.
109-
* @note SRID and EPSG may be blank if no match can be found on srs db.
109+
* @note SRID and EpsgCrsId may be blank if no match can be found on srs db.
110110
* @param theWkt The WKT for the desired spatial reference system.
111111
* @return bool TRUE if sucess else false
112112
*/
@@ -116,7 +116,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
116116
* sqlite backend. First the system level read only srs.db will be checked
117117
* and then the users ~/.qgis/qgis.db database will be checked for a match.
118118
* @note Any members will be overwritten during this process.
119-
* @param theEpsg The EPSG for the desired spatial reference system.
119+
* @param theEpsg The EpsgCrsId for the desired spatial reference system.
120120
* @return bool TRUE if sucess else false
121121
*/
122122
bool createFromEpsg( const long theEpsg );
@@ -251,10 +251,14 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
251251
* @return long theSrsId The internal sqlite3 srs.db primary key for this srs
252252
*/
253253
long srsid() const;
254-
/*! Get the Postgis SRID - if possible.
255-
* @return long theSRID The internal postgis SRID for this CRS
256-
*/
257-
long srid() const;
254+
/*! Get the postgis srid for this srs
255+
* @return long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
256+
*/
257+
long postgisSrid() const;
258+
/*! Get the EpsgCrsId identifier for this srs
259+
* @return long theEpsg the ESPG identifier for this srs (defaults to 0)
260+
*/
261+
long epsg() const;
258262
/*! Get the Description
259263
* @return QString the Description A textual description of the srs.
260264
* @note A zero length string will be returned if the description is uninitialised
@@ -286,21 +290,24 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
286290
*/
287291
QGis::UnitType mapUnits() const;
288292

289-
/*! Set the postgis srid for this srs
290-
* @return long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
291-
*/
292-
long postgisSrid() const;
293-
/*! Set the EPSG identifier for this srs
294-
* @return long theEpsg the ESPG identifier for this srs (defaults to 0)
293+
294+
// Mutators -----------------------------------
295+
/*! Set user hint for validation
295296
*/
296-
long epsg() const;
297+
void setValidationHint( QString html );
297298

299+
/*! Get user hint for validation
300+
*/
301+
QString validationHint();
298302
// Mutators -----------------------------------
303+
// We dont want to expose these to the public api since they wont create
304+
// a fully valid crs. Programmers should use the createFrom* methods rather
305+
private:
299306

300307
/*! Set the QGIS SrsId
301308
* @param long theSrsId The internal sqlite3 srs.db primary key for this srs
302309
*/
303-
void setSrsId( long theSrsId );
310+
void setInternalId( long theSrsId );
304311
/*! Set the postgis srid
305312
* @param long theSrsId The postgis spatial_ref_sys key for this srs
306313
*/
@@ -317,7 +324,7 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
317324
* @param bool theGeoFlag Whether this is a geographic or projected coordinate system
318325
*/
319326
void setGeographicFlag( bool theGeoFlag );
320-
/*! Set the EPSG identifier for this srs
327+
/*! Set the EpsgCrsId identifier for this srs
321328
* @param long theEpsg the ESPG identifier for this srs (defaults to 0)
322329
*/
323330
void setEpsg( long theEpsg );
@@ -330,14 +337,6 @@ class CORE_EXPORT QgsCoordinateReferenceSystem
330337
*/
331338
void setEllipsoidAcronym( QString theEllipsoidAcronym );
332339

333-
/*! Set user hint for validation
334-
*/
335-
void setValidationHint( QString html );
336-
337-
/*! Get user hint for validation
338-
*/
339-
QString validationHint();
340-
private:
341340
/*! Print the description if debugging
342341
*/
343342
void debugPrint();

‎src/core/qgscoordinatetransform.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ QgsCoordinateTransform::QgsCoordinateTransform( const QgsCoordinateReferenceSyst
5252
}
5353

5454
QgsCoordinateTransform::QgsCoordinateTransform( long theSourceSrsId, long theDestSrsId )
55-
: mSourceCRS( theSourceSrsId, QgsCoordinateReferenceSystem::QGIS_CRSID ),
56-
mDestCRS( theDestSrsId, QgsCoordinateReferenceSystem::QGIS_CRSID )
55+
: mSourceCRS( theSourceSrsId, QgsCoordinateReferenceSystem::InternalCrsId ),
56+
mDestCRS( theDestSrsId, QgsCoordinateReferenceSystem::InternalCrsId )
5757
{
5858
initialise();
5959
}
@@ -73,7 +73,7 @@ QgsCoordinateTransform::QgsCoordinateTransform( QString theSourceCRS, QString th
7373

7474
QgsCoordinateTransform::QgsCoordinateTransform( long theSourceSrid,
7575
QString theDestWKT,
76-
QgsCoordinateReferenceSystem::CRS_TYPE theSourceCRSType ): QObject()
76+
QgsCoordinateReferenceSystem::CrsType theSourceCRSType ): QObject()
7777
{
7878
setFinder();
7979

@@ -437,7 +437,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d
437437
// if the source/destination projection is lat/long, convert the points to radians
438438
// prior to transforming
439439
if (( pj_is_latlong( mDestinationProjection ) && ( direction == INVERSE ) )
440-
|| ( pj_is_latlong( mSourceProjection ) && ( direction == FORWARD ) ) )
440+
|| ( pj_is_latlong( mSourceProjection ) && ( direction == ForwardTransform ) ) )
441441
{
442442
for ( int i = 0; i < numPoints; ++i )
443443
{
@@ -462,7 +462,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d
462462
else
463463
{
464464
#if 0
465-
QgsDebugMsg( "!!!! FORWARD PROJ4 TRANSFORM !!!!" );
465+
QgsDebugMsg( "!!!! ForwardTransform PROJ4 TRANSFORM !!!!" );
466466
QgsDebugMsg( QString( " numPoint: %1" ).arg( numPoints ) );
467467
QgsDebugMsg( QString( " x : %1" ).arg( x ) );
468468
QgsDebugMsg( QString( " y : %1" ).arg( y ) );
@@ -483,7 +483,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d
483483
pjErr << tr( "Failed" ) << " " << dir << " " << tr( "transform of" ) << '\n';
484484
for ( int i = 0; i < numPoints; ++i )
485485
{
486-
if ( direction == FORWARD )
486+
if ( direction == ForwardTransform )
487487
{
488488
pjErr << "(" << x[i] << ", " << y[i] << ")\n";
489489
}
@@ -504,7 +504,7 @@ void QgsCoordinateTransform::transformCoords( const int& numPoints, double *x, d
504504
}
505505
// if the result is lat/long, convert the results from radians back
506506
// to degrees
507-
if (( pj_is_latlong( mDestinationProjection ) && ( direction == FORWARD ) )
507+
if (( pj_is_latlong( mDestinationProjection ) && ( direction == ForwardTransform ) )
508508
|| ( pj_is_latlong( mSourceProjection ) && ( direction == INVERSE ) ) )
509509
{
510510
for ( int i = 0; i < numPoints; ++i )

‎src/core/qgscoordinatetransform.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,19 @@ class CORE_EXPORT QgsCoordinateTransform: public QObject
7979
* of the layer and map canvas coordinate system as Wkt
8080
* @param theSourceSrid Spatial Ref Id of the layer's coordinate system
8181
* @param theSourceWKT WKT of the map canvas coordinate system
82-
* @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CRS_TYPE
82+
* @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CrsType
8383
*/
8484
QgsCoordinateTransform( long theSourceSrid,
8585
QString theDestWKT,
86-
QgsCoordinateReferenceSystem::CRS_TYPE theSourceCRSType = QgsCoordinateReferenceSystem::POSTGIS_SRID );
86+
QgsCoordinateReferenceSystem::CrsType theSourceCRSType = QgsCoordinateReferenceSystem::PostgisCrsId );
8787

8888
//! destructor
8989
~QgsCoordinateTransform();
9090

9191
//! Enum used to indicate the direction (forward or inverse) of the transform
9292
enum TransformDirection
9393
{
94-
FORWARD, /*!< Transform from source to destination CRS. */
94+
ForwardTransform, /*!< Transform from source to destination CRS. */
9595
INVERSE /*!< Transform from destination to source CRS. */
9696
};
9797

@@ -120,62 +120,62 @@ class CORE_EXPORT QgsCoordinateTransform: public QObject
120120
QgsCoordinateReferenceSystem& destCRS() { return mDestCRS; }
121121

122122
/*! Transform the point from Source Coordinate System to Destination Coordinate System
123-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
123+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
124124
* otherwise points are transformed from map canvas CS to layerCS.
125125
* @param p Point to transform
126-
* @param direction TransformDirection (defaults to FORWARD)
126+
* @param direction TransformDirection (defaults to ForwardTransform)
127127
* @return QgsPoint in Destination Coordinate System
128128
*/
129-
QgsPoint transform( const QgsPoint p, TransformDirection direction = FORWARD ) const;
129+
QgsPoint transform( const QgsPoint p, TransformDirection direction = ForwardTransform ) const;
130130

131131
/*! Transform the point specified by x,y from Source Coordinate System to Destination Coordinate System
132-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
132+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
133133
* otherwise points are transformed from map canvas CS to layerCS.
134134
* @param x x cordinate of point to transform
135135
* @param y y coordinate of point to transform
136-
* @param direction TransformDirection (defaults to FORWARD)
136+
* @param direction TransformDirection (defaults to ForwardTransform)
137137
* @return QgsPoint in Destination Coordinate System
138138
*/
139-
QgsPoint transform( const double x, const double y, TransformDirection direction = FORWARD ) const;
139+
QgsPoint transform( const double x, const double y, TransformDirection direction = ForwardTransform ) const;
140140

141141
/*! Transform a QgsRect to the dest Coordinate system
142-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
142+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
143143
* otherwise points are transformed from map canvas CS to layerCS.
144144
* It assumes that rect is a bounding box, and creates a bounding box
145145
* in the proejcted CS, so that all points in source rectangle is within
146146
* returned rectangle.
147147
* @param QgsRect rect to transform
148-
* @param direction TransformDirection (defaults to FORWARD)
148+
* @param direction TransformDirection (defaults to ForwardTransform)
149149
* @return QgsRect in Destination Coordinate System
150150
*/
151-
QgsRect transformBoundingBox( const QgsRect theRect, TransformDirection direction = FORWARD ) const;
151+
QgsRect transformBoundingBox( const QgsRect theRect, TransformDirection direction = ForwardTransform ) const;
152152

153153
// Same as for the other transform() functions, but alters the x
154154
// and y variables in place. The second one works with good old-fashioned
155155
// C style arrays.
156-
void transformInPlace( double& x, double& y, double &z, TransformDirection direction = FORWARD ) const;
156+
void transformInPlace( double& x, double& y, double &z, TransformDirection direction = ForwardTransform ) const;
157157

158158
void transformInPlace( std::vector<double>& x, std::vector<double>& y, std::vector<double>& z,
159-
TransformDirection direction = FORWARD ) const;
159+
TransformDirection direction = ForwardTransform ) const;
160160

161161
/*! Transform a QgsRect to the dest Coordinate system
162-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
162+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
163163
* otherwise points are transformed from map canvas CS to layerCS.
164164
* @param QgsRect rect to transform
165-
* @param direction TransformDirection (defaults to FORWARD)
165+
* @param direction TransformDirection (defaults to ForwardTransform)
166166
* @return QgsRect in Destination Coordinate System
167167
*/
168-
QgsRect transform( const QgsRect theRect, TransformDirection direction = FORWARD ) const;
168+
QgsRect transform( const QgsRect theRect, TransformDirection direction = ForwardTransform ) const;
169169

170170
/*! Transform an array of coordinates to a different Coordinate System
171-
* If the direction is FORWARD then coordinates are transformed from layer CS --> map canvas CS,
171+
* If the direction is ForwardTransform then coordinates are transformed from layer CS --> map canvas CS,
172172
* otherwise points are transformed from map canvas CS to layerCS.
173173
* @param x x cordinate of point to transform
174174
* @param y y coordinate of point to transform
175-
* @param direction TransformDirection (defaults to FORWARD)
175+
* @param direction TransformDirection (defaults to ForwardTransform)
176176
* @return QgsRect in Destination Coordinate System
177177
*/
178-
void transformCoords( const int &numPoint, double *x, double *y, double *z, TransformDirection direction = FORWARD ) const;
178+
void transformCoords( const int &numPoint, double *x, double *y, double *z, TransformDirection direction = ForwardTransform ) const;
179179

180180
/*!
181181
* Flag to indicate whether the coordinate systems have been initialised

‎src/core/qgsdistancearea.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ QgsDistanceArea::QgsDistanceArea()
4444
// init with default settings
4545
mProjectionsEnabled = FALSE;
4646
mCoordTransform = new QgsCoordinateTransform;
47-
setSourceEPSG( GEOEPSG_ID ); // WGS 84
47+
setSourceEpsgCrsId( GEO_EPSG_CRS_ID ); // WGS 84
4848
setEllipsoid( "WGS84" );
4949
}
5050

@@ -67,7 +67,7 @@ void QgsDistanceArea::setSourceCRS( long srsid )
6767
mCoordTransform->setSourceCRS( srcCRS );
6868
}
6969

70-
void QgsDistanceArea::setSourceEPSG( long epsgId )
70+
void QgsDistanceArea::setSourceEpsgCrsId( long epsgId )
7171
{
7272
QgsCoordinateReferenceSystem srcCRS;
7373
srcCRS.createFromEpsg( epsgId );

‎src/core/qgsdistancearea.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class CORE_EXPORT QgsDistanceArea
5050
//! sets source spatial reference system (by QGIS CRS)
5151
void setSourceCRS( long srsid );
5252

53-
//! sets source spatial reference system (by EPSG)
54-
void setSourceEPSG( long epsgId );
53+
//! sets source spatial reference system (by EpsgCrsId)
54+
void setSourceEpsgCrsId( long epsgId );
5555

5656
//! returns source spatial reference system
5757
long sourceCRS() { return mSourceRefSys; }

‎src/core/qgsmaprenderer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ QgsMapRenderer::QgsMapRenderer()
4949
mSize = QSize( 0, 0 );
5050

5151
mProjectionsEnabled = FALSE;
52-
mDestCRS = new QgsCoordinateReferenceSystem( GEOEPSG_ID, QgsCoordinateReferenceSystem::EPSG ); //WGS 84
52+
mDestCRS = new QgsCoordinateReferenceSystem( GEO_EPSG_CRS_ID, QgsCoordinateReferenceSystem::EpsgCrsId ); //WGS 84
5353

5454
mOutputUnits = QgsMapRenderer::MM;
5555
}
@@ -580,7 +580,7 @@ QgsPoint QgsMapRenderer::layerToMapCoordinates( QgsMapLayer* theLayer, QgsPoint
580580
try
581581
{
582582
QgsCoordinateTransform tr( theLayer->srs(), *mDestCRS );
583-
point = tr.transform( point, QgsCoordinateTransform::FORWARD );
583+
point = tr.transform( point, QgsCoordinateTransform::ForwardTransform );
584584
}
585585
catch ( QgsCsException &cse )
586586
{

‎src/gui/qgsgenericprojectionselector.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class GUI_EXPORT QgsGenericProjectionSelector : public QDialog, private Ui::QgsG
7979
* list of projections by. This is useful in (e.g.) WMS situations
8080
* where you just want to offer what the WMS server can support.
8181
*
82-
* \note This function only deals with EPSG labels only at this time.
82+
* \note This function only deals with EpsgCrsId labels only at this time.
8383
*
8484
* \warning This function's behaviour is undefined if it is called after the dialog is shown.
8585
*/

‎src/gui/qgsprojectionselector.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ QString QgsProjectionSelector::ogcWmsCrsFilterAsSqlExpression( QSet<QString> * c
118118
Label: The identifier includes a namespace prefix, a colon, a numeric or
119119
string code, and in some instances a comma followed by additional
120120
parameters. This International Standard defines three namespaces:
121-
CRS, EPSG and AUTO2 [...]
121+
CRS, EpsgCrsId and AUTO2 [...]
122122
123123
URL: The identifier is a fully-qualified Uniform Resource Locator that
124124
references a publicly-accessible file containing a definition of the CRS
@@ -541,7 +541,7 @@ void QgsProjectionSelector::loadUserCrsList( QSet<QString> * crsFilter )
541541
while ( sqlite3_step( myPreparedStatement ) == SQLITE_ROW )
542542
{
543543
newItem = new QTreeWidgetItem( mUserProjList, QStringList( QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 0 ) ) ) );
544-
// EPSG for user projections is not always defined in some dbases.
544+
// EpsgCrsId for user projections is not always defined in some dbases.
545545
// It's also not written from customprojections dialog.
546546
// display the epsg (field 2) in the second column of the list view
547547
// newItem->setText( EPSG_COLUMN, QString::fromUtf8(( char * )sqlite3_column_text( myPreparedStatement, 2 ) ) );
@@ -733,7 +733,7 @@ void QgsProjectionSelector::on_pbnFind_clicked()
733733
QString mySearchString( sqlSafeString( leSearch->text() ) );
734734
// Set up the query to retreive the projection information needed to populate the list
735735
QString mySql;
736-
if ( radEPSGID->isChecked() )
736+
if ( radEpsgCrsId->isChecked() )
737737
{
738738
mySql = "select srs_id from tbl_srs where epsg=" + mySearchString;
739739
}

‎src/gui/qgsprojectionselector.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProjectio
6666
*/
6767
const QString sqlSafeString( const QString theSQL );
6868

69-
//! Gets the current EPSG-style projection identifier
69+
//! Gets the current EpsgCrsId-style projection identifier
7070
long selectedEpsg();
7171

7272
public slots:
@@ -96,7 +96,7 @@ class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProjectio
9696
* list of projections by. This is useful in (e.g.) WMS situations
9797
* where you just want to offer what the WMS server can support.
9898
*
99-
* \note This function only deals with EPSG labels only at this time.
99+
* \note This function only deals with EpsgCrsId labels only at this time.
100100
*
101101
* \warning This function's behaviour is undefined if it is called after the widget is shown.
102102
*/
@@ -122,7 +122,7 @@ class GUI_EXPORT QgsProjectionSelector: public QWidget, private Ui::QgsProjectio
122122
* list of projections by. This is useful in (e.g.) WMS situations
123123
* where you just want to offer what the WMS server can support.
124124
*
125-
* \note This function only deals with EPSG labels only at this time.
125+
* \note This function only deals with EpsgCrsId labels only at this time.
126126
*/
127127
QString ogcWmsCrsFilterAsSqlExpression( QSet<QString> * crsFilter );
128128

‎src/plugins/coordinate_capture/coordinatecapture.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ CoordinateCapture::~CoordinateCapture()
8080
*/
8181
void CoordinateCapture::initGui()
8282
{
83-
mEpsgId = GEOEPSG_ID;
83+
mEpsgId = GEO_EPSG_CRS_ID;
8484
// Create the action for tool
8585
mQActionPointer = new QAction( QIcon( ":/coordinatecapture/coordinate_capture.png" ), tr( "Coordinate Capture" ), this );
8686
// Set the what's this text

‎src/plugins/grass/qgsgrassnewmapset.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,9 @@ void QgsGrassNewMapset::setSelectedRegion()
857857
// Warning: seems that crashes if source == dest
858858
if ( mProjectionSelector->selectedCrsId() != GEOCRS_ID )
859859
{
860-
// Warning: QgsCoordinateReferenceSystem::EPSG is broken (using epsg_id)
861-
//QgsCoordinateReferenceSystem source ( 4326, QgsCoordinateReferenceSystem::EPSG );
862-
QgsCoordinateReferenceSystem source( GEOCRS_ID, QgsCoordinateReferenceSystem::QGIS_CRSID );
860+
// Warning: QgsCoordinateReferenceSystem::EpsgCrsId is broken (using epsg_id)
861+
//QgsCoordinateReferenceSystem source ( 4326, QgsCoordinateReferenceSystem::EpsgCrsId );
862+
QgsCoordinateReferenceSystem source( GEOCRS_ID, QgsCoordinateReferenceSystem::InternalCrsId );
863863

864864
if ( !source.isValid() )
865865
{
@@ -869,7 +869,7 @@ void QgsGrassNewMapset::setSelectedRegion()
869869
}
870870

871871
QgsCoordinateReferenceSystem dest( mProjectionSelector->selectedCrsId(),
872-
QgsCoordinateReferenceSystem::QGIS_CRSID );
872+
QgsCoordinateReferenceSystem::InternalCrsId );
873873

874874
if ( !dest.isValid() )
875875
{
@@ -952,7 +952,7 @@ void QgsGrassNewMapset::setCurrentRegion()
952952
int srsid = QgsProject::instance()->readNumEntry(
953953
"SpatialRefSys", "/ProjectCRSID", 0 );
954954

955-
QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::QGIS_CRSID );
955+
QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::InternalCrsId );
956956
QgsDebugMsg( QString( "current project srsid = %1" ).arg( srsid ) );
957957
QgsDebugMsg( QString( "srs.isValid() = %1" ).arg( srs.isValid() ) );
958958

@@ -1070,7 +1070,7 @@ void QgsGrassNewMapset::drawRegion()
10701070
if ( mProjectionSelector->selectedCrsId() != GEOCRS_ID )
10711071
{
10721072
QgsCoordinateReferenceSystem source( mProjectionSelector->selectedCrsId(),
1073-
QgsCoordinateReferenceSystem::QGIS_CRSID );
1073+
QgsCoordinateReferenceSystem::InternalCrsId );
10741074

10751075
if ( !source.isValid() )
10761076
{
@@ -1079,7 +1079,7 @@ void QgsGrassNewMapset::drawRegion()
10791079
return;
10801080
}
10811081

1082-
QgsCoordinateReferenceSystem dest( GEOCRS_ID, QgsCoordinateReferenceSystem::QGIS_CRSID );
1082+
QgsCoordinateReferenceSystem dest( GEOCRS_ID, QgsCoordinateReferenceSystem::InternalCrsId );
10831083

10841084
if ( !dest.isValid() )
10851085
{
@@ -1426,7 +1426,7 @@ void QgsGrassNewMapset::pageSelected( int index )
14261426
int srsid = QgsProject::instance()->readNumEntry(
14271427
"SpatialRefSys", "/ProjectCRSID", 0 );
14281428

1429-
QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::QGIS_CRSID );
1429+
QgsCoordinateReferenceSystem srs( srsid, QgsCoordinateReferenceSystem::InternalCrsId );
14301430
QgsDebugMsg( QString( "current project srsid = %1" ).arg( srsid ) );
14311431
QgsDebugMsg( QString( "srs.isValid() = %1" ).arg( srs.isValid() ) );
14321432
if ( srs.isValid() )

‎src/plugins/wfs/qgswfssourceselect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ long QgsWFSSourceSelect::getPreferredCrs( const QSet<long>& crsSet ) const
9797
//first: project CRS
9898
long ProjectCRSID = QgsProject::instance()->readNumEntry( "SpatialRefSys", "/ProjectCRSID", -1 );
9999
//convert to EPSG
100-
QgsCoordinateReferenceSystem projectRefSys( ProjectCRSID, QgsCoordinateReferenceSystem::QGIS_CRSID );
100+
QgsCoordinateReferenceSystem projectRefSys( ProjectCRSID, QgsCoordinateReferenceSystem::InternalCrsId );
101101
int ProjectCRS = -1;
102102
if ( projectRefSys.isValid() )
103103
{

‎src/providers/wfs/qgswfsdata.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class QgsWFSData: public QObject
9494
}
9595

9696
//helper routines
97-
/**Reads attribute srsName="EPSG:..."
97+
/**Reads attribute srsName="EpsgCrsId:..."
9898
@param epsgNr result
9999
@param attr attribute strings
100100
@return 0 in case of success*/

‎src/providers/wfs/qgswfsprovider.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ int QgsWFSProvider::setCRSFromGML2( const QDomElement& wfsCollectionElement )
699699
QgsDebugMsg( "srsName is: " + srsName );
700700

701701

702-
//extract the EPSG id
702+
//extract the EpsgCrsId id
703703
int epsgId;
704704
bool conversionSuccess;
705705
if ( srsName.contains( "#" ) )//geoserver has "http://www.opengis.net/gml/srs/epsg.xml#4326"
@@ -719,7 +719,7 @@ int QgsWFSProvider::setCRSFromGML2( const QDomElement& wfsCollectionElement )
719719
}
720720
}
721721
else
722-
epsgId = GEOEPSG_ID;
722+
epsgId = GEO_EPSG_CRS_ID;
723723

724724
if ( !mSourceCRS.createFromEpsg( epsgId ) )
725725
{

‎src/providers/wms/qgswmsprovider.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1749,7 +1749,7 @@ bool QgsWmsProvider::calculateExtent()
17491749
// Convert to the user's CRS as required
17501750
try
17511751
{
1752-
extent = mCoordinateTransform->transformBoundingBox( extent, QgsCoordinateTransform::FORWARD );
1752+
extent = mCoordinateTransform->transformBoundingBox( extent, QgsCoordinateTransform::ForwardTransform );
17531753
}
17541754
catch ( QgsCsException &cse )
17551755
{

‎src/ui/qgsprojectionselectorbase.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
</property>
113113
<layout class="QGridLayout" >
114114
<item row="0" column="0" >
115-
<widget class="QRadioButton" name="radEPSGID" >
115+
<widget class="QRadioButton" name="radEpsgCrsId" >
116116
<property name="text" >
117117
<string>EPSG ID</string>
118118
</property>

‎tests/algorithms/projections/projectioncshandlingtest.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ class ProjectionCsHandlingTest : public CppUnit::TestCase
159159
}
160160
//
161161
// Test fetch of proj4 parameters from GEOGCS NAD83 OGRSpatialReference object
162-
// in EPSG format
162+
// in EpsgCrsId format
163163
// Failure occurs if datum field is not found in the proj4 parameter string
164164
//
165165
void testProjEpsgExportToProj4()
166166
{
167-
std::cout << "\n\nGetting NAD83 proj4 parameters from an EPSG format WKT" << std::endl;
167+
std::cout << "\n\nGetting NAD83 proj4 parameters from an EpsgCrsId format WKT" << std::endl;
168168
// set up the spatial ref
169169
OGRSpatialReference myInputSpatialRefSys;
170170
char *pWkt = ( char* )wktEpsg.ascii();
@@ -299,7 +299,7 @@ class ProjectionCsHandlingTest : public CppUnit::TestCase
299299
QString wktDest;
300300
// WKT for an ESRI style GEOGCS in NAD83 (from states.shp shapefile)
301301
QString wktDestNad83;
302-
// WKT for an EPSG style GEOGCS
302+
// WKT for an EpsgCrsId style GEOGCS
303303
QString wktEpsg;
304304
// WKT for an ESRI style PROJCS as read from a shapefile
305305
QString wktAkAlbers;

‎tests/src/core/testqgsvectorfilewriter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void TestQgsVectorFileWriter::projectedPlygonGridTest()
333333
// +proj=lcc +lat_1=18 +lat_0=18 +lon_0=-77 +k_0=1 +x_0=250000
334334
// +y_0=150000 +ellps=clrk66 +units=m +no_defs
335335
//
336-
mCRS = QgsCoordinateReferenceSystem(1286,QgsCoordinateReferenceSystem::QGIS_CRSID);
336+
mCRS = QgsCoordinateReferenceSystem(1286,QgsCoordinateReferenceSystem::InternalCrsId);
337337
QgsVectorFileWriter myWriter (myFileName,
338338
mEncoding,
339339
mFields,

0 commit comments

Comments
 (0)
Please sign in to comment.