[Qgis-developer] Extending QgsMapToolIdentify and QgsIdentifyResults

Martin Dobias wonder.sk at gmail.com
Sat Jan 27 07:20:49 EST 2007

On 1/26/07, Peter Ersts <ersts at amnh.org> wrote:
> Martin,
> For the most part the results that are displayed now are sufficient but
> here is a list of things that could be useful
> All Results to include:
> Map coordinate (projected)
> Map coordinate (geographic)
> Display coordinates, i.e., X,Y within the display (lower priority)
> Layer type
> Vector Specific:
> Feature ID + all associated attributes (table values)
> length or area of feature if not already in table (lower priority)
> Raster Specific:
> Pixel Coordinate
> Pixel values (all bands)
> Pixel count (for classified/categorical data)
> WMS Specific:
> ???
> For simplicity the result set could include more meta-data type
> information about the layer, but that is not necessarily needed as that
> information is readily available using QgsInterface::getActiveLayer().
> For the actual storage of the results an xml document would be robust,
> but could add a little overhead.  Or, for everything but the vector
> feature attributes and the pixel values, a simple struct could be used.
> Vector feature and Pixel values could be a QList of another struct that
> is just an attribute name and value, so for raster it would be
> attribute=Band1 value=50 etc.

For me, using meta-data seems to be a complication which is not
needed. I like the idea of having a generic (probably abstract)
QgsIdentifyResult that will contain only basic information, e.g. map
and screen coordinates. Then we can have derived objects for vector
and raster layers (that would contain the stuff you've written above).

> Anyway, thanks for thinking about this. I know there are a lot of other
> things to do but I think this would be a useful modification that would,
> for example, allow a plugin to respond differently to points based on a
> particular attribute i.e., loading an external file (path/url in
> attribute) with the correct application (depending the file type stored
> in another attribute).

I appreciate that you think about impacts of your additions to QGIS
architecture and I'm looking forward to see the patches from you :-)


More information about the Qgis-developer mailing list