Opened 13 years ago

Last modified 13 years ago

#3807 new bug

QgsRasterLayer.identify() is always True

Reported by: ricardogsilva Owned by: borysiasty
Priority: major: does not work as expected Milestone: Version 2.0.0
Component: Python plugins and bindings Version:
Keywords: Cc:
Must Fix for Release: No Platform: Debian
Platform Version: Awaiting user input: no

Description

Using the python bindings, when trying to identify a point outside of current raster layer, The QgsRasterLayer.identify() method is returning:

(True, {PyQt4.QtCore.QString(u'Band 1'): PyQt4.QtCore.QString(u'out of extent')})

which doesn't make much sense IMO. If the result is the "out of extent" string, then the identifying has failed, so the first entry of the tuple should be False, instead of True.

Change History (1)

comment:1 by ricardogsilva, 13 years ago

This is always true if the identified point is inside the extents of the raster layer, but in an area that is not part of the layer itself, in which case QgsRasterLayer.identify() returns:

(True, {PyQt4.QtCore.QString(u'Band 1'): PyQt4.QtCore.QString(u'null (no data)')})

I guess this is not intended behavior as well, because the tuple's first value is always True.

Note: See TracTickets for help on using tickets.