Skip to content

Commit efba2d8

Browse files
author
timlinux
committed
More api cleanups
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9495 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 1fb00d5 commit efba2d8

38 files changed

+177
-173
lines changed

doc/userguide.pdf

0 Bytes
Binary file not shown.

python/core/qgis.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ public:
8989
};
9090

9191

92-
/** WKT string that represents a geographic coord sys */
93-
const QString GEOWKT;
92+
/** Wkt string that represents a geographic coord sys */
93+
const QString GEOWkt;
9494

9595
/** PROJ4 string that represents a geographic coord sys */
9696
const QString GEOPROJ4;

python/core/qgscoordinatereferencesystem.sip

+9-15
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class QgsCoordinateReferenceSystem
2424
~QgsCoordinateReferenceSystem();
2525

2626
/*!
27-
* Constructs a CRS object from a WKT string
27+
* Constructs a CRS object from a Wkt string
2828
* @param theWkt A String containing a valid Wkt def
2929
*/
3030
explicit QgsCoordinateReferenceSystem(QString theWkt);
@@ -59,14 +59,14 @@ class QgsCoordinateReferenceSystem
5959
*/
6060
bool createFromSrid(const long theSrid);
6161

62-
/*! Set up this srs using a WKT spatial ref sys definition.
62+
/*! Set up this srs using a Wkt spatial ref sys definition.
6363
* The wkt will be converted to a proj4 string using OGR helper
6464
* functions. After this the srs databasses will be searched for matches.
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.
6868
* @note SRID and EpsgCrsId may be blank if no match can be found on srs db.
69-
* @param theWkt The WKT for the desired spatial reference system.
69+
* @param theWkt The Wkt for the desired spatial reference system.
7070
* @return bool TRUE if sucess else false
7171
*/
7272
bool createFromWkt(const QString theWkt);
@@ -161,10 +161,6 @@ class QgsCoordinateReferenceSystem
161161
* is inconclusive.
162162
*/
163163
bool equals(QString theProj4String);
164-
/*! A helper to get an wkt representation of this srs
165-
* @return string containing Wkt of the srs
166-
*/
167-
QString toWkt() const;
168164

169165
/*! Restores state from the given Dom node.
170166
* @param theNode The node from which state will be restored
@@ -188,12 +184,6 @@ class QgsCoordinateReferenceSystem
188184
*/
189185
bool writeXML( QDomNode & theNode, QDomDocument & theDoc );
190186

191-
/** A static helper function to find out the proj4 string for a srsid
192-
* @param int theSrsId The srsid used for the lookup
193-
* @return QString The proj4 string
194-
*/
195-
static QString getProj4FromSrsId(const int theSrsId);
196-
197187
/** Sets custom function to force valid CRS
198188
* QGIS uses implementation in QgisGui::customSrsValidation
199189
*/
@@ -229,13 +219,17 @@ class QgsCoordinateReferenceSystem
229219
* @note A zero length string will be returned if the ellipsoidAcronym is uninitialised
230220
*/
231221
QString ellipsoidAcronym () const;
222+
/*! A helper to get an wkt representation of this srs
223+
* @return string containing Wkt of the srs
224+
*/
225+
QString toWkt() const;
232226
/** Get the Proj Proj4String. If proj and ellps keys are found in the parameters,
233227
* they will be stripped out and the Projection and ellipsoid acronyms will be
234228
* overridden with these.
235229
* @return QString theProj4String Proj4 format specifies that define this srs.
236-
* @note A zero length string will be returned if the proj4String is uninitialised
230+
* @note A zero length string will be returned if the toProj4 is uninitialised
237231
*/
238-
QString proj4String() const;
232+
QString toProj4() const;
239233
/*! Get this Geographic? flag
240234
* @return bool theGeoFlag Whether this is a geographic or projected coordinate system
241235
*/

python/core/qgscoordinatetransform.sip

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ class QgsCoordinateTransform : QObject
3535
/*!
3636
* Constructs a QgsCoordinateTransform using the Well Known Text representation
3737
* of the layer and map canvas coordinate systems
38-
* @param theSourceWKT WKT, typically of the layer's coordinate system
39-
* @param theDestWKT WKT, typically of the map canvas coordinate system
38+
* @param theSourceWkt Wkt, typically of the layer's coordinate system
39+
* @param theDestWkt Wkt, typically of the map canvas coordinate system
4040
*/
41-
QgsCoordinateTransform(QString theSourceWKT, QString theDestWKT );
41+
QgsCoordinateTransform(QString theSourceWkt, QString theDestWkt );
4242

4343
/*!
4444
* Constructs a QgsCoordinateTransform using a Spatial Reference Id
4545
* of the layer and map canvas coordinate system as Wkt
4646
* @param theSourceSrid Spatial Ref Id of the layer's coordinate system
47-
* @param theSourceWKT WKT of the map canvas coordinate system
47+
* @param theSourceWkt Wkt of the map canvas coordinate system
4848
* @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CrsType
4949
*/
5050
QgsCoordinateTransform(long theSourceSrid,
51-
QString theDestWKT,
51+
QString theDestWkt,
5252
QgsCoordinateReferenceSystem::CrsType theSourceCRSType = QgsCoordinateReferenceSystem::PostgisCrsId );
5353

5454
//! destructor

python/core/qgsgeometry.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class QgsGeometry
3434
~QgsGeometry();
3535

3636

37-
/** static method that creates geometry from WKT */
37+
/** static method that creates geometry from Wkt */
3838
static QgsGeometry* fromWkt(QString wkt) /Factory/;
3939

4040
/** construct geometry from a point */

python/core/qgsrasterlayer.sip

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ public:
9090
*/
9191
QString identifyAsText(const QgsPoint & point);
9292

93-
/** \brief Query gdal to find out the WKT projection string for this layer. This implements the virtual method of the same name defined in QgsMapLayer*/
94-
QString getProjectionWKT();
93+
/** \brief Query gdal to find out the Wkt projection string for this layer. This implements the virtual method of the same name defined in QgsMapLayer*/
94+
QString getProjectionWkt();
9595

9696
/** \brief Returns the number of raster units per each raster pixel. For rasters with world file, this is normally the first row (without the sign) in that file */
9797
double rasterUnitsPerPixel();

python/core/qgsrect.sip

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class QgsRect
6767
void combineExtentWith(double x, double y);
6868
//! test if rectangle is empty
6969
bool isEmpty() const;
70-
//! returns string representation in WKT form
70+
//! returns string representation in Wkt form
7171
QString asWktCoordinates() const;
7272
//! returns string representation of form xmin,ymin xmax,ymax
7373
QString toString(bool automaticPrecision = false) const;

src/app/qgisapp.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static QgsMessageOutput* messageOutputViewer_()
260260
*/
261261
static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
262262
{
263-
QString proj4String;
263+
QString toProj4;
264264
QSettings mySettings;
265265
QString myDefaultProjectionOption =
266266
mySettings.value( "/Projections/defaultBehaviour" ).toString();
@@ -271,9 +271,9 @@ static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
271271

272272
QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
273273
mySelector->setMessage( srs->validationHint() ); //shows a generic message, if not speficied
274-
proj4String = QgsProject::instance()->readEntry( "SpatialRefSys", "//ProjectCRSProj4String", GEOPROJ4 );
274+
toProj4 = QgsProject::instance()->readEntry( "SpatialRefSys", "//ProjectCRSProj4String", GEOPROJ4 );
275275
QgsCoordinateReferenceSystem defaultCRS;
276-
if ( defaultCRS.createFromProj4( proj4String ) )
276+
if ( defaultCRS.createFromProj4( toProj4 ) )
277277
{
278278
mySelector->setSelectedCrsId( defaultCRS.srsid() );
279279
}
@@ -291,10 +291,10 @@ static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
291291
}
292292
else if ( myDefaultProjectionOption == "useProject" )
293293
{
294-
// XXX TODO: Change project to store selected CS as 'projectCRS' not 'selectedWKT'
295-
proj4String = QgsProject::instance()->readEntry( "SpatialRefSys", "//ProjectCRSProj4String", GEOPROJ4 );
296-
QgsDebugMsg( "Layer srs set from project: " + proj4String );
297-
srs->createFromProj4( proj4String );
294+
// XXX TODO: Change project to store selected CS as 'projectCRS' not 'selectedWkt'
295+
toProj4 = QgsProject::instance()->readEntry( "SpatialRefSys", "//ProjectCRSProj4String", GEOPROJ4 );
296+
QgsDebugMsg( "Layer srs set from project: " + toProj4 );
297+
srs->createFromProj4( toProj4 );
298298
}
299299
else ///Projections/defaultBehaviour==useGlobal
300300
{
@@ -2309,7 +2309,7 @@ void QgisApp::addDatabaseLayer()
23092309
QApplication::setOverrideCursor( Qt::WaitCursor );
23102310

23112311
QString connInfo = dbs->connInfo();
2312-
// for each selected table, connect to the database, parse the WKT geometry,
2312+
// for each selected table, connect to the database, parse the Wkt geometry,
23132313
// and build a canvasitem for it
23142314
// readWKB(connInfo,tables);
23152315
QStringList::Iterator it = tables.begin();

src/app/qgsoptions.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
8080
radUseGlobalProjection->setChecked( true );
8181
}
8282

83-
txtGlobalWKT->setText( settings.value( "/Projections/defaultProjectionString", GEOPROJ4 ).toString() );
83+
txtGlobalWkt->setText( settings.value( "/Projections/defaultProjectionString", GEOPROJ4 ).toString() );
8484

8585
// populate combo box with ellipsoids
8686
getEllipsoidList();
@@ -291,7 +291,7 @@ void QgsOptions::saveOptions()
291291
settings.setValue( "/Projections/defaultBehaviour", "useGlobal" );
292292
}
293293

294-
settings.setValue( "/Projections/defaultProjectionString", txtGlobalWKT->toPlainText() );
294+
settings.setValue( "/Projections/defaultProjectionString", txtGlobalWkt->toPlainText() );
295295

296296
settings.setValue( "/qgis/measure/ellipsoid", getEllipsoidAcronym( cmbEllipsoid->currentText() ) );
297297

@@ -356,16 +356,16 @@ void QgsOptions::on_pbnSelectProjection_clicked()
356356

357357
//find out srs id of current proj4 string
358358
QgsCoordinateReferenceSystem refSys;
359-
if ( refSys.createFromProj4( txtGlobalWKT->toPlainText() ) )
359+
if ( refSys.createFromProj4( txtGlobalWkt->toPlainText() ) )
360360
{
361361
mySelector->setSelectedCrsId( refSys.srsid() );
362362
}
363363

364364
if ( mySelector->exec() )
365365
{
366366
//! @todo changes this control name in gui to txtGlobalProjString
367-
txtGlobalWKT->setText( mySelector->selectedProj4String() );
368-
QgsDebugMsg( QString( "------ Global Default Projection Selection set to ----------\n%1" ).arg( txtGlobalWKT->toPlainText() ) );
367+
txtGlobalWkt->setText( mySelector->selectedProj4String() );
368+
QgsDebugMsg( QString( "------ Global Default Projection Selection set to ----------\n%1" ).arg( txtGlobalWkt->toPlainText() ) );
369369
}
370370
else
371371
{

src/app/qgsprojectproperties.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class QgsProjectProperties : public QDialog, private Ui::QgsProjectPropertiesBas
5757
void title( QString const & title );
5858

5959
/*! Accessor for projection */
60-
QString projectionWKT();
60+
QString projectionWkt();
6161

6262
/*! Indicates that the projection switch is on */
6363
bool isProjected();

src/app/qgsrasterlayerproperties.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p
299299
tabBar->setTabEnabled( tabBar->indexOf( tabPageHistogram ), FALSE );
300300
}
301301

302-
leSpatialRefSys->setText( mRasterLayer->srs().proj4String() );
302+
leSpatialRefSys->setText( mRasterLayer->srs().toProj4() );
303303

304304
// Set text for pyramid info box
305305
QString pyramidFormat( "<h2>%1</h2><p>%2 %3 %4</p><b><font color='red'><p>%5</p><p>%6</p>" );
@@ -1696,7 +1696,7 @@ void QgsRasterLayerProperties::on_pbnChangeSpatialRefSys_clicked()
16961696
}
16971697
delete mySelector;
16981698

1699-
leSpatialRefSys->setText( mRasterLayer->srs().proj4String() );
1699+
leSpatialRefSys->setText( mRasterLayer->srs().toProj4() );
17001700
}
17011701

17021702
void QgsRasterLayerProperties::on_cboxColorMap_currentIndexChanged( const QString& theText )

src/app/qgsvectorlayerproperties.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
129129

130130
updateButtons();
131131

132-
leSpatialRefSys->setText( layer->srs().proj4String() );
132+
leSpatialRefSys->setText( layer->srs().toProj4() );
133133
leSpatialRefSys->setCursorPosition( 0 );
134134

135135
connect( sliderTransparency, SIGNAL( valueChanged( int ) ), this, SLOT( sliderTransparency_valueChanged( int ) ) );
@@ -763,7 +763,7 @@ QString QgsVectorLayerProperties::getMetadata()
763763
myMetadata += tr( "Layer Spatial Reference System:" );
764764
myMetadata += "</td></tr>";
765765
myMetadata += "<tr><td>";
766-
myMetadata += layer->srs().proj4String().replace( QRegExp( "\"" ), " \"" );
766+
myMetadata += layer->srs().toProj4().replace( QRegExp( "\"" ), " \"" );
767767
myMetadata += "</td></tr>";
768768

769769
//
@@ -775,7 +775,7 @@ QString QgsVectorLayerProperties::getMetadata()
775775
myMetadata += tr("Project (Output) Spatial Reference System:");
776776
myMetadata += "</td></tr>";
777777
myMetadata += "<tr><td>";
778-
myMetadata += coordinateTransform->destCRS().proj4String().replace(QRegExp("\"")," \"");
778+
myMetadata += coordinateTransform->destCRS().toProj4().replace(QRegExp("\"")," \"");
779779
myMetadata += "</td></tr>";
780780
*/
781781

@@ -875,7 +875,7 @@ void QgsVectorLayerProperties::on_pbnChangeSpatialRefSys_clicked()
875875
}
876876
delete mySelector;
877877

878-
leSpatialRefSys->setText( layer->srs().proj4String() );
878+
leSpatialRefSys->setText( layer->srs().toProj4() );
879879
leSpatialRefSys->setCursorPosition( 0 );
880880
}
881881

src/core/qgis.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ inline void ( *cast_to_fptr( void *p ) )()
112112
return u.f;
113113
}
114114

115-
/** WKT string that represents a geographic coord sys */
116-
const QString GEOWKT =
115+
/** Wkt string that represents a geographic coord sys */
116+
const QString GEOWkt =
117117
"GEOGCS[\"WGS 84\", "
118118
" DATUM[\"WGS_1984\", "
119119
" SPHEROID[\"WGS 84\",6378137,298.257223563, "

src/core/qgsclipper.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
// Where has all the code gone?
2323

24-
// It's been inlined, so is in the qgsclipper.h file.
24+
// It's been inlined, so its in the qgsclipper.h file.
2525

2626
// But the static members must be initialised outside the class! (or GCC 4 dies)
2727

0 commit comments

Comments
 (0)