Skip to content
Permalink
Browse files
More api cleanups
git-svn-id: http://svn.osgeo.org/qgis/trunk@9495 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Oct 19, 2008
1 parent a896fee commit 1ca4f2365b43ab316389f543ff8f0bf884967b3b
Showing with 177 additions and 173 deletions.
  1. BIN doc/userguide.pdf
  2. +2 −2 python/core/qgis.sip
  3. +9 −15 python/core/qgscoordinatereferencesystem.sip
  4. +5 −5 python/core/qgscoordinatetransform.sip
  5. +1 −1 python/core/qgsgeometry.sip
  6. +2 −2 python/core/qgsrasterlayer.sip
  7. +1 −1 python/core/qgsrect.sip
  8. +8 −8 src/app/qgisapp.cpp
  9. +5 −5 src/app/qgsoptions.cpp
  10. +1 −1 src/app/qgsprojectproperties.h
  11. +2 −2 src/app/qgsrasterlayerproperties.cpp
  12. +4 −4 src/app/qgsvectorlayerproperties.cpp
  13. +2 −2 src/core/qgis.h
  14. +1 −1 src/core/qgsclipper.cpp
  15. +19 −19 src/core/qgsclipper.h
  16. +15 −15 src/core/qgscoordinatereferencesystem.cpp
  17. +28 −18 src/core/qgscoordinatereferencesystem.h
  18. +8 −8 src/core/qgscoordinatetransform.cpp
  19. +5 −5 src/core/qgscoordinatetransform.h
  20. +1 −1 src/core/qgsgeometry.cpp
  21. +4 −4 src/core/qgsgeometry.h
  22. +2 −2 src/core/qgsmaprenderer.cpp
  23. +1 −1 src/core/qgsrect.h
  24. +12 −12 src/core/raster/qgsrasterlayer.cpp
  25. +2 −2 src/core/raster/qgsrasterlayer.h
  26. +2 −2 src/gui/qgsgenericprojectionselector.cpp
  27. +1 −1 src/plugins/grass/modules/g.proj.ascii.new.qgm
  28. +1 −1 src/plugins/grass/modules/g.proj.ascii.qgm
  29. +1 −1 src/plugins/grass/qgsgrassnewmapset.cpp
  30. +2 −2 src/plugins/grid_maker/graticulecreator.cpp
  31. +1 −1 src/plugins/spit/qgsshapefile.cpp
  32. +3 −3 src/providers/grass/qgsgrassprovider.cpp
  33. +9 −9 src/providers/ogr/qgsogrprovider.cpp
  34. +2 −2 src/ui/qgsoptionsbase.ui
  35. +9 −9 tests/algorithms/projections/projectioncshandlingtest.h
  36. +2 −2 tests/src/core/regression1141.cpp
  37. +2 −2 tests/src/core/testqgsmaprenderer.cpp
  38. +2 −2 tests/src/core/testqgsvectorfilewriter.cpp
BIN +0 Bytes (100%) doc/userguide.pdf
Binary file not shown.
@@ -89,8 +89,8 @@ public:
};


/** WKT string that represents a geographic coord sys */
const QString GEOWKT;
/** Wkt string that represents a geographic coord sys */
const QString GEOWkt;

/** PROJ4 string that represents a geographic coord sys */
const QString GEOPROJ4;
@@ -24,7 +24,7 @@ class QgsCoordinateReferenceSystem
~QgsCoordinateReferenceSystem();

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

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

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

/** A static helper function to find out the proj4 string for a srsid
* @param int theSrsId The srsid used for the lookup
* @return QString The proj4 string
*/
static QString getProj4FromSrsId(const int theSrsId);

/** Sets custom function to force valid CRS
* QGIS uses implementation in QgisGui::customSrsValidation
*/
@@ -229,13 +219,17 @@ class QgsCoordinateReferenceSystem
* @note A zero length string will be returned if the ellipsoidAcronym is uninitialised
*/
QString ellipsoidAcronym () const;
/*! A helper to get an wkt representation of this srs
* @return string containing Wkt of the srs
*/
QString toWkt() const;
/** Get the Proj Proj4String. If proj and ellps keys are found in the parameters,
* they will be stripped out and the Projection and ellipsoid acronyms will be
* overridden with these.
* @return QString theProj4String Proj4 format specifies that define this srs.
* @note A zero length string will be returned if the proj4String is uninitialised
* @note A zero length string will be returned if the toProj4 is uninitialised
*/
QString proj4String() const;
QString toProj4() const;
/*! Get this Geographic? flag
* @return bool theGeoFlag Whether this is a geographic or projected coordinate system
*/
@@ -35,20 +35,20 @@ class QgsCoordinateTransform : QObject
/*!
* Constructs a QgsCoordinateTransform using the Well Known Text representation
* of the layer and map canvas coordinate systems
* @param theSourceWKT WKT, typically of the layer's coordinate system
* @param theDestWKT WKT, typically of the map canvas coordinate system
* @param theSourceWkt Wkt, typically of the layer's coordinate system
* @param theDestWkt Wkt, typically of the map canvas coordinate system
*/
QgsCoordinateTransform(QString theSourceWKT, QString theDestWKT );
QgsCoordinateTransform(QString theSourceWkt, QString theDestWkt );

/*!
* Constructs a QgsCoordinateTransform using a Spatial Reference Id
* 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 theSourceWkt Wkt of the map canvas coordinate system
* @param theSourceCRSType On of the enum members defined in QgsCoordinateReferenceSystem::CrsType
*/
QgsCoordinateTransform(long theSourceSrid,
QString theDestWKT,
QString theDestWkt,
QgsCoordinateReferenceSystem::CrsType theSourceCRSType = QgsCoordinateReferenceSystem::PostgisCrsId );

//! destructor
@@ -34,7 +34,7 @@ class QgsGeometry
~QgsGeometry();


/** static method that creates geometry from WKT */
/** static method that creates geometry from Wkt */
static QgsGeometry* fromWkt(QString wkt) /Factory/;

/** construct geometry from a point */
@@ -90,8 +90,8 @@ public:
*/
QString identifyAsText(const QgsPoint & point);

/** \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*/
QString getProjectionWKT();
/** \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*/
QString getProjectionWkt();

/** \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 */
double rasterUnitsPerPixel();
@@ -67,7 +67,7 @@ class QgsRect
void combineExtentWith(double x, double y);
//! test if rectangle is empty
bool isEmpty() const;
//! returns string representation in WKT form
//! returns string representation in Wkt form
QString asWktCoordinates() const;
//! returns string representation of form xmin,ymin xmax,ymax
QString toString(bool automaticPrecision = false) const;
@@ -260,7 +260,7 @@ static QgsMessageOutput* messageOutputViewer_()
*/
static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
{
QString proj4String;
QString toProj4;
QSettings mySettings;
QString myDefaultProjectionOption =
mySettings.value( "/Projections/defaultBehaviour" ).toString();
@@ -271,9 +271,9 @@ static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )

QgsGenericProjectionSelector * mySelector = new QgsGenericProjectionSelector();
mySelector->setMessage( srs->validationHint() ); //shows a generic message, if not speficied
proj4String = QgsProject::instance()->readEntry( "SpatialRefSys", "//ProjectCRSProj4String", GEOPROJ4 );
toProj4 = QgsProject::instance()->readEntry( "SpatialRefSys", "//ProjectCRSProj4String", GEOPROJ4 );
QgsCoordinateReferenceSystem defaultCRS;
if ( defaultCRS.createFromProj4( proj4String ) )
if ( defaultCRS.createFromProj4( toProj4 ) )
{
mySelector->setSelectedCrsId( defaultCRS.srsid() );
}
@@ -291,10 +291,10 @@ static void customSrsValidation_( QgsCoordinateReferenceSystem* srs )
}
else if ( myDefaultProjectionOption == "useProject" )
{
// XXX TODO: Change project to store selected CS as 'projectCRS' not 'selectedWKT'
proj4String = QgsProject::instance()->readEntry( "SpatialRefSys", "//ProjectCRSProj4String", GEOPROJ4 );
QgsDebugMsg( "Layer srs set from project: " + proj4String );
srs->createFromProj4( proj4String );
// XXX TODO: Change project to store selected CS as 'projectCRS' not 'selectedWkt'
toProj4 = QgsProject::instance()->readEntry( "SpatialRefSys", "//ProjectCRSProj4String", GEOPROJ4 );
QgsDebugMsg( "Layer srs set from project: " + toProj4 );
srs->createFromProj4( toProj4 );
}
else ///Projections/defaultBehaviour==useGlobal
{
@@ -2309,7 +2309,7 @@ void QgisApp::addDatabaseLayer()
QApplication::setOverrideCursor( Qt::WaitCursor );

QString connInfo = dbs->connInfo();
// for each selected table, connect to the database, parse the WKT geometry,
// for each selected table, connect to the database, parse the Wkt geometry,
// and build a canvasitem for it
// readWKB(connInfo,tables);
QStringList::Iterator it = tables.begin();
@@ -80,7 +80,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
radUseGlobalProjection->setChecked( true );
}

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

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

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

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

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

//find out srs id of current proj4 string
QgsCoordinateReferenceSystem refSys;
if ( refSys.createFromProj4( txtGlobalWKT->toPlainText() ) )
if ( refSys.createFromProj4( txtGlobalWkt->toPlainText() ) )
{
mySelector->setSelectedCrsId( refSys.srsid() );
}

if ( mySelector->exec() )
{
//! @todo changes this control name in gui to txtGlobalProjString
txtGlobalWKT->setText( mySelector->selectedProj4String() );
QgsDebugMsg( QString( "------ Global Default Projection Selection set to ----------\n%1" ).arg( txtGlobalWKT->toPlainText() ) );
txtGlobalWkt->setText( mySelector->selectedProj4String() );
QgsDebugMsg( QString( "------ Global Default Projection Selection set to ----------\n%1" ).arg( txtGlobalWkt->toPlainText() ) );
}
else
{
@@ -57,7 +57,7 @@ class QgsProjectProperties : public QDialog, private Ui::QgsProjectPropertiesBas
void title( QString const & title );

/*! Accessor for projection */
QString projectionWKT();
QString projectionWkt();

/*! Indicates that the projection switch is on */
bool isProjected();
@@ -299,7 +299,7 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QWidget *p
tabBar->setTabEnabled( tabBar->indexOf( tabPageHistogram ), FALSE );
}

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

// Set text for pyramid info box
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()
}
delete mySelector;

leSpatialRefSys->setText( mRasterLayer->srs().proj4String() );
leSpatialRefSys->setText( mRasterLayer->srs().toProj4() );
}

void QgsRasterLayerProperties::on_cboxColorMap_currentIndexChanged( const QString& theText )
@@ -129,7 +129,7 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(

updateButtons();

leSpatialRefSys->setText( layer->srs().proj4String() );
leSpatialRefSys->setText( layer->srs().toProj4() );
leSpatialRefSys->setCursorPosition( 0 );

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

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

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

leSpatialRefSys->setText( layer->srs().proj4String() );
leSpatialRefSys->setText( layer->srs().toProj4() );
leSpatialRefSys->setCursorPosition( 0 );
}

@@ -112,8 +112,8 @@ inline void ( *cast_to_fptr( void *p ) )()
return u.f;
}

/** WKT string that represents a geographic coord sys */
const QString GEOWKT =
/** Wkt string that represents a geographic coord sys */
const QString GEOWkt =
"GEOGCS[\"WGS 84\", "
" DATUM[\"WGS_1984\", "
" SPHEROID[\"WGS 84\",6378137,298.257223563, "
@@ -21,7 +21,7 @@

// Where has all the code gone?

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

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

Loading

0 comments on commit 1ca4f23

Please sign in to comment.