Skip to content

Commit

Permalink
changed std::map to QMap in QgsRasterLayer::identify(), updated PyQGIS
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8443 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
wonder committed May 15, 2008
1 parent f59b118 commit 49e19e6
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
3 changes: 1 addition & 2 deletions python/core/qgsrasterlayer.sip
Expand Up @@ -78,8 +78,7 @@ public:
*
* \param point[in] a coordinate in the CRS of this layer.
*/
// TODO: wrap
//void identify(const QgsPoint & point, std::map<QString,QString>& results);
void identify(const QgsPoint & point, QMap<QString,QString>& results /Out/);

/** \brief Identify arbitrary details from the WMS server found on the point position
*
Expand Down
6 changes: 3 additions & 3 deletions src/app/qgsmaptoolidentify.cpp
Expand Up @@ -131,7 +131,7 @@ void QgsMapToolIdentify::identifyRasterLayer(QgsRasterLayer* layer, const QgsPoi
if (!layer)
return;

std::map<QString, QString> attributes;
QMap<QString, QString> attributes;
layer->identify(point, attributes);

if(!mResults)
Expand All @@ -152,10 +152,10 @@ void QgsMapToolIdentify::identifyRasterLayer(QgsRasterLayer* layer, const QgsPoi
mResults->setTitle( layer->name() );
mResults->setColumnText ( 0, QObject::tr("Band") );

std::map<QString, QString>::iterator it;
QMap<QString, QString>::iterator it;
for (it = attributes.begin(); it != attributes.end(); it++)
{
mResults->addAttribute(it->first, it->second);
mResults->addAttribute(it.key(), it.value());
}

mResults->addAttribute( tr("(clicked coordinate)"), point.stringRep() );
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterlayer.cpp
Expand Up @@ -4804,7 +4804,7 @@ bool QgsRasterLayer::readXML_( QDomNode & layer_node )



void QgsRasterLayer::identify(const QgsPoint& point, std::map<QString,QString>& results)
void QgsRasterLayer::identify(const QgsPoint& point, QMap<QString,QString>& results)
{
double x = point.x();
double y = point.y();
Expand Down
3 changes: 2 additions & 1 deletion src/core/raster/qgsrasterlayer.h
Expand Up @@ -128,6 +128,7 @@
#include <QDateTime>
#include <QVector>
#include <QList>
#include <QMap>

#include "qgis.h"
#include "qgspoint.h"
Expand Down Expand Up @@ -247,7 +248,7 @@ class CORE_EXPORT QgsRasterLayer : public QgsMapLayer
*
* \param point[in] a coordinate in the CRS of this layer.
*/
void identify(const QgsPoint & point, std::map<QString,QString>& results);
void identify(const QgsPoint & point, QMap<QString,QString>& results);

/** \brief Identify arbitrary details from the WMS server found on the point position
*
Expand Down

0 comments on commit 49e19e6

Please sign in to comment.