<html><head></head><body>Hi otto,<br>
<br>
A super wild guess: whats the value of IdentifyFormat in your call?<br>
<br>
Hth,<br>
Marc<br><br><div class="gmail_quote"><br>
<br>
Otto Dassau <dassau@gbd-consult.de> schrieb:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">Hi,<br /><br />I want to update a plugin from 1.8 to QGIS 2.0 and it throws following error:<br /><br />Traceback (most recent call last):<br />File<br /><br />"/home/dassau/.qgis2/python/plugins/weibullanalyse/<a href="http://weibullanalysedialog.py">weibullanalysedialog.py</a>",  <br />line 447, in printValue self.showValues() File<br /><br />"/home/dassau/.qgis2/python/plugins/weibullanalyse/<a href="http://weibullanalysedialog.py">weibullanalysedialog.py</a>",  <br />line 453, in showValues self.plot() File<br /><br />"/home/dassau/.qgis2/python/plugins/weibullanalyse/<a href="http://weibullanalysedialog.py">weibullanalysedialog.py</a>",  <br />line 514, in plot w = float(self.sampleRaster(self.InRastW.currentText(),<br />self.xCoord, self.yCoord))/10 File<br /><br />"/home/dassau/.qgis2/python/plugins/weibullanalyse/<a href="http://weibullanalysedialog.py">weibullanalysedialog.py</a>",  <br />line 299, in sampleRaster return self.sampleRaster20(layer,
  x, y)
File<br /><br />"/home/dassau/.qgis2/python/plugins/weibullanalyse/<a href="http://weibullanalysedialog.py">weibullanalysedialog.py</a>",  <br />line 284, in sampleRaster20 success, data =<br />layer.dataProvider().identify(QgsPoint(x,y))<br /><br />TypeError:<br />QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,<br />QgsRectangle theExtent=QgsRectangle(), int theWidth=0, int theHeight=0):<br />not enough arguments<br /><br />I found at <a href="http://hub.qgis.org/wiki/quantum-gis/API_changes_for_version_20">http://hub.qgis.org/wiki/quantum-gis/API_changes_for_version_20</a><br />the section QgsRasterDataProvider which should fit. And the Method, where I<br />assume the error occurs should be this<br /><br /># get value at mouse position QGIS <= 1.8 (working for 1.8)<br />def sampleRaster18(self, layer, x, y):<br />success, data = layer.identify(QgsPoint(x,y))<br />for band, value in data.items():<br />return value<br /><br />now what I tried but doesn't
  work
(see error above)<br /><br /># get value at mouse position QGIS >= 2.0 (not working yet :()<br />def sampleRaster20(self, layer, x, y):<br />success, data = layer.dataProvider().identify(QgsPoint(x,y))<br />for band, value in data.items():<br />return value<br /><br />my problem is, that I don't understand how to implement in sampleRaster20<br />the new method from the API_changes_for_version_20 website which says:<br /><br />QMap<int, QVariant> identify( const QgsPoint & thePoint, IdentifyFormat<br />theFormat, const QgsRectangle &theExtent = QgsRectangle(), int theWidth =<br />0, int theHeight = 0 )<br /><br />can anybody help?<br /><br />Thanks <br /><br />Otto<br /><hr /><br />Qgis-developer mailing list<br />Qgis-developer@lists.osgeo.org<br /><a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br /></pre></blockquote></div></body></html>