Re: [Qgis-user] How to probe raster values?

2008-05-16 Thread Borys Jurgiel
> I've decided not to wait and have done the necessary changes, so from
> SVN r8443 you're able to use identify() for rasters. A simple example
> to print bands and the values at specified point:

Wow! Huge thanks! I'm running for coffee and then to SVN! :)
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] How to probe raster values?

2008-05-15 Thread Richard Duivenvoorde


Good Work Martin, Thanks !

Richard Duivenvoorde

Martin Dobias wrote:

On Thu, May 15, 2008 at 12:12 PM, Borys Jurgiel <[EMAIL PROTECTED]> wrote:

Martin, so may we expect, that the identify() method will be rewritten to
match QMap-type arguments in the near future?


I've decided not to wait and have done the necessary changes, so from
SVN r8443 you're able to use identify() for rasters. A simple example
to print bands and the values at specified point:

ident = rlayer.identify(QgsPoint(15.30,40.98))
for (k,v) in ident.iteritems():
print str(k),":",str(v)

cheers,
Martin
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] How to probe raster values?

2008-05-15 Thread cfarmer
Great move!

I've been looking for this functionality for python!

Thanks Martin.

Carson

> On Thu, May 15, 2008 at 12:12 PM, Borys Jurgiel <[EMAIL PROTECTED]>
> wrote:
>>
>> Martin, so may we expect, that the identify() method will be rewritten
>> to
>> match QMap-type arguments in the near future?
>
> I've decided not to wait and have done the necessary changes, so from
> SVN r8443 you're able to use identify() for rasters. A simple example
> to print bands and the values at specified point:
>
> ident = rlayer.identify(QgsPoint(15.30,40.98))
> for (k,v) in ident.iteritems():
> print str(k),":",str(v)
>
> cheers,
> Martin
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>


Carson Farmer
Spatial Pattern Analysis & Research Lab (SPAR)
Department of Geography, University of Victoria
www.geog.uvic.ca/spar/carson
[EMAIL PROTECTED]


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] How to probe raster values?

2008-05-15 Thread Martin Dobias
On Thu, May 15, 2008 at 12:12 PM, Borys Jurgiel <[EMAIL PROTECTED]> wrote:
>
> Martin, so may we expect, that the identify() method will be rewritten to
> match QMap-type arguments in the near future?

I've decided not to wait and have done the necessary changes, so from
SVN r8443 you're able to use identify() for rasters. A simple example
to print bands and the values at specified point:

ident = rlayer.identify(QgsPoint(15.30,40.98))
for (k,v) in ident.iteritems():
print str(k),":",str(v)

cheers,
Martin
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] How to probe raster values?

2008-05-15 Thread Borys Jurgiel
Thanks a lot, guys!

Carson, I'll use GDAL, as there is no other way out ;) but I strongly prefer 
to read values directly from QGis's object due to compatibility with any data 
source - but this is also subject for another topic. Wait a moment ;)

Martin, so may we expect, that the identify() method will be rewritten to 
match QMap-type arguments in the near future?

Cheers,
Borys
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] How to probe raster values?

2008-05-13 Thread Carson Farmer

Borys,

What about using GDAL to access your raster values? Your plugin could 
get all the needed info (i.e. path, name, etc), load the data using 
GDAL, and read the data as needed using ReadRaster.


Check out: http://www.gdal.org/gdal_tutorial.html  or  
http://www.nabble.com/beginners-programming-questions-td15498345.html 
for details.


Cheers,

Carson

Borys Jurgiel wrote:
Hi Everybody! 

I'm working on a plugin in Python and I can't find any way to read values (at 
specified coordinates) from raster layers. 

I've tried with "identify" method of QgsRasterLayer object, but it's 
unavailable in my QGIS 0.10. Is this method depreciated, or only there is no 
Python binding for it yet? 


Is there any other way, or is that my time for switch to C? :)

Regards,

Borys.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user

  

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] How to probe raster values?

2008-05-13 Thread Martin Dobias
On Tue, May 13, 2008 at 7:10 PM, Borys Jurgiel <[EMAIL PROTECTED]> wrote:
> Hi Everybody!
>
>  I'm working on a plugin in Python and I can't find any way to read values (at
>  specified coordinates) from raster layers.
>
>  I've tried with "identify" method of QgsRasterLayer object, but it's
>  unavailable in my QGIS 0.10. Is this method depreciated, or only there is no
>  Python binding for it yet?
>
>  Is there any other way, or is that my time for switch to C? :)

Hi,

identify() method does exist, however it's not included in PyQGIS
because of use of std::map as an argument (which is currently
discouraged in favour of QMap). I'm affraid there's not other way in
Python to do read values from raster layer.

Martin
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] How to probe raster values?

2008-05-13 Thread Borys Jurgiel
Hi Everybody! 

I'm working on a plugin in Python and I can't find any way to read values (at 
specified coordinates) from raster layers. 

I've tried with "identify" method of QgsRasterLayer object, but it's 
unavailable in my QGIS 0.10. Is this method depreciated, or only there is no 
Python binding for it yet? 

Is there any other way, or is that my time for switch to C? :)

Regards,

Borys.
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-user