[Qgis-developer] Re : new icons

2013-08-02 Thread denis.rouz...@gmail.com
Hi,
Thanks vinayan for your comments.

Anita, There are still open pull requests with icons.

I can try to do the topology icon next Monday.

Cheers,

Denis

sent from à small touchscreen device next to swimming pool, I ll try to be more 
explicit next week!

- Reply message -
De : "vinayan" 
Pour : 
Objet : [Qgis-developer] new icons
Date : ven., août 2, 2013 06:02


Hi Denis,

It was great work on some of the icons you did recently(particularly the add
layer icons)..

I am on the side of replacing the topology checker icon..I did that while
playing with Inkscape :)
please consider it if you have time..



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/new-icons-tp5063997p5070377.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] get mean of pixel values within defined area around current mouse position

2013-08-02 Thread Otto Dassau
Hi,

I have a question to update the code I sent in a former below to QGIS 2.0.
Again I need the mean value, currently use:

vpoly = QgsVectorLayer("Polygon", "pointbuffer", "memory")
feature = QgsFeature()
feature.setGeometry(QgsGeometry.fromPoint(QgsPoint(3517601,5406205)).buffer(1,5))
provider = vpoly.dataProvider()
provider.addFeatures( [feature] )
vpoly.commitChanges()
stats = QgsZonalStatistics(vpoly,"/path/to/corine2006_z0_test_gk3.tif")
stats.calculateStatistics(None)
allAttrs = provider.attributeIndexes()   
for feature in vpoly.getFeatures():
   for attr in feature.attributes():
  return attr

attr in this case is probably the sum as I can see from the results, but I
need the mean again, as below. 

For QGIS 1.8 k==0 is number of pixels, k==1 is sum, k==2 is mean, see below.
But something like return attr[2] doesn't work. It says TypeError: 'float'
object has no attribute 'getitem'. Maybe someone has an idea how to solve
this?

Thanks a lot

Otto


Am Wed, 17 Jul 2013 09:21:55 +0200
schrieb Otto Dassau :

> Hi,
> 
> I wanted to give a short feedback. Finally my solution for qgis 1.8 with
> some help from Anita was to create a buffer polygon around the point as a
> memory layer and calculated the mean value with QgsZonalStatistics. Here
> is the code I used, maybe useful for others:
> 
> from qgis.analysis import QgsZonalStatistics
> from PyQt4.QtGui import *
> 
> vpoly = QgsVectorLayer("Polygon", "pointbuffer", "memory")
> feature = QgsFeature()
> feature.setGeometry( 
> QgsGeometry.fromPoint(QgsPoint(3517601,5406205)).buffer(1,5))
> provider = vpoly.dataProvider()
> vpoly.startEditing()
> provider.addFeatures( [feature] ) 
> vpoly.commitChanges()
> stats=qgis.analysis.QgsZonalStatistics(vpoly,"/path/to/rasterlayer.tif")
> stats.calculateStatistics(None)
> allAttrs = provider.attributeIndexes()
> provider.select(allAttrs)
> provider.nextFeature(feature)
> attrs = feature.attributeMap()
> for (k,attr) in attrs.iteritems():
>   if k==2:
> 
> QMessageBox.information(qgis.utils.iface.mainWindow(),'Info',attr.toString())
> 
> Regards
> Otto
> 
> Am Wed, 3 Jul 2013 09:36:45 +0200
> schrieb Otto Dassau :
> 
> > Hi Fred,
> > 
> > thanks for the hints, A and B sound interesting - PostGIS is not an
> > option here. 
> > 
> > One more question, because you already used these workarounds. What
> > solution A or B should be more usable (faster) from your opinion, if I
> > need to calculate the mean while moving the mouse over the map canvas?
> > 
> > Regards
> > Otto
> > 
> > Am Tue, 2 Jul 2013 18:05:10 +0100
> > schrieb Fred Lehodey :
> > 
> > > Hi,
> > > 
> > > Not sure it's the best way but I did something similar with these
> > > workarounds:
> > > 
> > > A - with gdal:
> > > 1 - the user click and you get your buffer. (already done)
> > > 2 - use gdalwarp with "-cutline" and "*-*crop_to_cutline" options to
> > > extract a new raster. (python subprocess)
> > > 3 - read the created raster in a numpy array to do all the statistics
> > > you need.
> > > 
> > > B - with matplotlib:
> > > 1 - with the buffer: create an array of the vertices
> > > 2 - read the raster into another numpy array
> > > 3 - use the "points_inside_poly" function of "matplotlib" lib to
> > > create a numpy mask.
> > > 
> > > Not tried but postgis raster should do the job.
> > > 
> > > Hth,
> > > Fred
> > > 
> > > 
> > > On Tue, Jul 2, 2013 at 1:12 PM, Otto Dassau 
> > > wrote:
> > > 
> > > > Hi,
> > > >
> > > > for a qgis 1.8 plugin I would like to query the mean of pixel values
> > > > of a raster layer within a defined buffer for the current mouse
> > > > position (not for
> > > > an existing point layer).
> > > >
> > > > For the buffer it works:
> > > >
> > > > ...
> > > > feat.geometry().asPoint()
> > > > (3.5176e+06,5.4062e+06)
> > > > buff_geom = feat.geometry().buffer(1000, 5)
> > > > buff_geom.asPolygon() [[(3.5186e+06,5.4062e+06),
> > > > (3.51855e+06,5.4059e+06), (3.51841e+06,5.40562e+06),
> > > > (3.51819e+06,5.4054e+06), (3.51791e+06,5.40525e+06),
> > > > (3.5176e+06,5.4052e+06), (3.51729e+06,5.40525e+06),
> > > > (3.51701e+06,5.4054e+06),...]]
> > > >
> > > > but now I try to find a solution to query the raster pixels within
> > > > the buffer zone and calculate the mean, but I don't know how and if
> > > > this is possible in QGIS 1.8 at all. I found QgsZonalStatistics, but
> > > > that doesn't work for my task.
> > > >
> > > > Does anybody have a solution for this or a better idea, how to solve
> > > > this?
> > > >
> > > > Thanks
> > > >
> > > > Otto
> > > > ___
> > > > Qgis-developer mailing list
> > > > Qgis-developer@lists.osgeo.org
> > > > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> > > >
> > 
> > 
> 
> 


-- 
Geoinformatik Büro Dassau - http://www.gbd-consult.de
FOSSGIS consulting , training , support  and analysis
Ackerstrasse 144c  ,  D - 40233 Düsseldorf  , Germany
Tel: +49-(0)211-47468178 , Mobil: +49-(0)171-4687540

--
Community Advis

Re: [Qgis-developer] [SoC] Resource Sharing in QGIS - Weekly Report #6

2013-08-02 Thread Borys Jurgiel
I'm sorry I didn't mention it earlier. Well, now I'd start from writting down 
all the needed metadata tags (for plugins they are in the file I mentioned; 
Victor, could you prepare such list for SEXTANTE?) and all needed API calls.
I believe it may lead to a decision of making qgs classes for data structures, 
like I mentioned. Those structures can be still populated with data by the 
serverside-filtering API, to not invest too much GSoC time into refactoring. A 
new API can be added in version 2 and the old one can be depreciated (or not) 
in a version 3... I must say I don't have much experience with similar 
solutions existing around, so for me your work on styles is still a kind of 
prototypying, and I expect many ideas may change.

Anyway, my next task should be a real versioning for plugins, in order to 
allow downloading (and locking) any previous version of a non working plugin.
As I'd like to avoid downloading all the thousands of plugins x versions in 
each request for local filtering, we'll probably have to add more requests to 
the API. Most likely, there will be an aditional metadata tag 
"alternate_versions" included to the main big request, and also another 
requests for details of the chosen version. I'll think about it for Brighton. 

As you see there is still a lot of details to be precised, so don't be 
disappointed if you find your present work more a prototype than the final long-
term stage :-)

Borys

Dnia czwartek, 1 sierpnia 2013 o 17:47:02 arunthe...@gmail.com napisał(a):
> Hello,
> 
> Thank you for the ideas. And Borys, your idea does make me question a
> lot of things and the approach I have taken. As far as the symbols go,
> I think I am on the right side with server side filtering. But when we
> move towards more complicated stuff with votes, and versioning, it
> does makes sense to have a local cache of meta-data to do the
> filtering. I guess I will have to think more about this and figure out
> the distinction and the way through it. Thank you for giving me the
> other way to do.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Otto Dassau
Hi Etienne and Matthias,

fine - that was missing.

Thanks a lot
Otto

Am Fri, 2 Aug 2013 12:04:09 -0300
schrieb Etienne Tourigny :

> On Fri, Aug 2, 2013 at 11:58 AM, Otto Dassau  wrote:
> > Hi,
> >
> > thanks for the hint. And if I need the value of the raster? If I
> > understand correctly, ident will always be 1, if I have a 1 band raster
> > layer. But how can I get the value at QgsPoint(x,y) of the raster? I
> > don't understand that from the value tool plugin.
> 
> no,  ident will be a dict with an element of key 1
> 
> you get exactly the fist band's value at the point with ident[1] .
> 
> the key of the map is the band number, and the value is the value (or
> None if nodata/out of bounds)
> 
> so without any error checking you would do
> 
> ident =
> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
> return ident[1]
> 
> cheers
> Etienne
> 
> >
> > In QGIS 1.8 I use :
> >
> > success, data = layer.identify(QgsPoint(x,y))
> >for band, value in data.items():
> >return value
> >
> > and in QGIS 2.0:
> >
> > ident =
> > layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
> >  ?
> >
> > Thanks again
> >
> > Otto
> >
> >
> > Am Fri, 2 Aug 2013 08:50:08 -0300
> > schrieb Etienne Tourigny :
> >
> >> from the api
> >> http://www.qgis.org/api/classQgsRasterIdentifyResult.html#a8537d25fdff215e7e9650b71a0a16783
> >>
> >> results() returns a QMap (one item for each band), it
> >> does not return a tuple, so you should actually call
> >>
> >> ident =
> >> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
> >>
> >> and then test that ident is not empty (i,e. ident is not None and
> >> ident.iterkeys() is not None)
> >>
> >> for each band, if the point is outside of the raster extent or is
> >> nodata, the value will be a null QVariant (i.e. QVariant()) which in
> >> python is None.
> >>
> >>
> >> cheers
> >> Etienne
> >>
> >> On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau 
> >> wrote:
> >> >
> >> > Hi,
> >> >
> >> > thanks for your hints, I think I am on the right track now. I had a
> >> > look at the value tool plugin and tried to adapt the method
> >> > accordingly:
> >> >
> >> > def sampleRaster20(self, layer, x, y):
> >> >#success, data = layer.dataProvider().identify(QgsPoint(x,y))
> >> >success, data =
> >> > layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
> >> > for band, value in data.items(): return value
> >> >
> >> > But now I get another error message
> >> >
> >> >  File
> >> >  
> >> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> >  line 448, in printValue self.showValues() File
> >> >  
> >> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> >  line 454, in showValues self.plot() File
> >> >  
> >> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> >  line 526, in plot w =
> >> > float(self.sampleRaster(self.InRastW.currentText(), self.xCoord,
> >> > self.yCoord))/10 File
> >> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> > line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
> >> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> > line 285, in sampleRaster20 success, data =
> >> > layer.dataProvider().identify(QgsPoint(x,y),
> >> > QgsRaster.IdentifyFormatValue ).results() ValueError: need more than 1
> >> > value to unpack
> >> >
> >> > Do you have an idea for this, too?
> >> >
> >> > Thanks
> >> > Otto
> >> >
> >> > Am Thu, 1 Aug 2013 16:00:08 -0300
> >> > schrieb Etienne Tourigny :
> >> >
> >> > > Have a look at the source of the value tool plugin, it calls the
> >> > > identify() method and has been updated to 2.0 api.
> >> > >
> >> > > Etienne
> >> > >
> >> > > On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau 
> >> > > wrote:
> >> > >
> >> > > > Hi,
> >> > > >
> >> > > > I want to update a plugin from 1.8 to QGIS 2.0 and it throws
> >> > > > following error:
> >> > > >
> >> > > > Traceback (most recent call last):
> >> > > > File
> >> > > >
> >> > > >
> >> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> > > > line 447, in printValue self.showValues() File
> >> > > >
> >> > > >
> >> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> > > > line 453, in showValues self.plot() File
> >> > > >
> >> > > >
> >> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> > > > line 514, in plot w =
> >> > > > float(self.sampleRaster(self.InRastW.currentText(), self.xCoord,
> >> > > > self.yCoord))/10 File
> >> > > >
> >> > > >
> >> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >> > > > line 299, in sampleRaster return self.sampleRaster20(layer, x, y)
> >> > > > File
> >> > > >
> >> > > >
> >> > > > "/home/dassau/.qgis2/pyth

Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Etienne Tourigny
On Fri, Aug 2, 2013 at 11:58 AM, Otto Dassau  wrote:
> Hi,
>
> thanks for the hint. And if I need the value of the raster? If I understand
> correctly, ident will always be 1, if I have a 1 band raster layer. But how
> can I get the value at QgsPoint(x,y) of the raster? I don't understand that
> from the value tool plugin.

no,  ident will be a dict with an element of key 1

you get exactly the fist band's value at the point with ident[1] .

the key of the map is the band number, and the value is the value (or
None if nodata/out of bounds)

so without any error checking you would do

ident = 
layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
return ident[1]

cheers
Etienne

>
> In QGIS 1.8 I use :
>
> success, data = layer.identify(QgsPoint(x,y))
>for band, value in data.items():
>return value
>
> and in QGIS 2.0:
>
> ident = 
> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
>?
>
> Thanks again
>
> Otto
>
>
> Am Fri, 2 Aug 2013 08:50:08 -0300
> schrieb Etienne Tourigny :
>
>> from the api
>> http://www.qgis.org/api/classQgsRasterIdentifyResult.html#a8537d25fdff215e7e9650b71a0a16783
>>
>> results() returns a QMap (one item for each band), it
>> does not return a tuple, so you should actually call
>>
>> ident =
>> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
>>
>> and then test that ident is not empty (i,e. ident is not None and
>> ident.iterkeys() is not None)
>>
>> for each band, if the point is outside of the raster extent or is
>> nodata, the value will be a null QVariant (i.e. QVariant()) which in
>> python is None.
>>
>>
>> cheers
>> Etienne
>>
>> On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau  wrote:
>> >
>> > Hi,
>> >
>> > thanks for your hints, I think I am on the right track now. I had a look
>> > at the value tool plugin and tried to adapt the method accordingly:
>> >
>> > def sampleRaster20(self, layer, x, y):
>> >#success, data = layer.dataProvider().identify(QgsPoint(x,y))
>> >success, data =
>> > layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
>> > for band, value in data.items(): return value
>> >
>> > But now I get another error message
>> >
>> >  File
>> >  
>> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> >  line 448, in printValue self.showValues() File
>> >  
>> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> >  line 454, in showValues self.plot() File
>> >  
>> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> >  line 526, in plot w =
>> > float(self.sampleRaster(self.InRastW.currentText(), self.xCoord,
>> > self.yCoord))/10 File
>> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> > line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
>> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> > line 285, in sampleRaster20 success, data =
>> > layer.dataProvider().identify(QgsPoint(x,y),
>> > QgsRaster.IdentifyFormatValue ).results() ValueError: need more than 1
>> > value to unpack
>> >
>> > Do you have an idea for this, too?
>> >
>> > Thanks
>> > Otto
>> >
>> > Am Thu, 1 Aug 2013 16:00:08 -0300
>> > schrieb Etienne Tourigny :
>> >
>> > > Have a look at the source of the value tool plugin, it calls the
>> > > identify() method and has been updated to 2.0 api.
>> > >
>> > > Etienne
>> > >
>> > > On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau 
>> > > wrote:
>> > >
>> > > > Hi,
>> > > >
>> > > > I want to update a plugin from 1.8 to QGIS 2.0 and it throws
>> > > > following error:
>> > > >
>> > > > Traceback (most recent call last):
>> > > > File
>> > > >
>> > > >
>> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> > > > line 447, in printValue self.showValues() File
>> > > >
>> > > >
>> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> > > > line 453, in showValues self.plot() File
>> > > >
>> > > >
>> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> > > > line 514, in plot w =
>> > > > float(self.sampleRaster(self.InRastW.currentText(), self.xCoord,
>> > > > self.yCoord))/10 File
>> > > >
>> > > >
>> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> > > > line 299, in sampleRaster return self.sampleRaster20(layer, x, y)
>> > > > File
>> > > >
>> > > >
>> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> > > > line 284, in sampleRaster20 success, data =
>> > > > layer.dataProvider().identify(QgsPoint(x,y))
>> > > >
>> > > > TypeError:
>> > > > QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,
>> > > > QgsRectangle theExtent=QgsRectangle(), int theWidth=0, int
>> > > > theHeight=0): not enough arguments
>> > > >
>> > > > I found at
>> > > > http://hub.qgis.o

Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Otto Dassau
Hi,

thanks for the hint. And if I need the value of the raster? If I understand
correctly, ident will always be 1, if I have a 1 band raster layer. But how
can I get the value at QgsPoint(x,y) of the raster? I don't understand that
from the value tool plugin.

In QGIS 1.8 I use :

success, data = layer.identify(QgsPoint(x,y))
   for band, value in data.items():
   return value

and in QGIS 2.0:

ident = 
layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
   ?

Thanks again

Otto


Am Fri, 2 Aug 2013 08:50:08 -0300
schrieb Etienne Tourigny :

> from the api
> http://www.qgis.org/api/classQgsRasterIdentifyResult.html#a8537d25fdff215e7e9650b71a0a16783
> 
> results() returns a QMap (one item for each band), it
> does not return a tuple, so you should actually call
> 
> ident =
> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
> 
> and then test that ident is not empty (i,e. ident is not None and
> ident.iterkeys() is not None)
> 
> for each band, if the point is outside of the raster extent or is
> nodata, the value will be a null QVariant (i.e. QVariant()) which in
> python is None.
> 
> 
> cheers
> Etienne
> 
> On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau  wrote:
> >
> > Hi,
> >
> > thanks for your hints, I think I am on the right track now. I had a look
> > at the value tool plugin and tried to adapt the method accordingly:
> >
> > def sampleRaster20(self, layer, x, y):
> >#success, data = layer.dataProvider().identify(QgsPoint(x,y))
> >success, data =
> > layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
> > for band, value in data.items(): return value
> >
> > But now I get another error message
> >
> >  File
> >  
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >  line 448, in printValue self.showValues() File
> >  
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >  line 454, in showValues self.plot() File
> >  
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> >  line 526, in plot w =
> > float(self.sampleRaster(self.InRastW.currentText(), self.xCoord,
> > self.yCoord))/10 File
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > line 285, in sampleRaster20 success, data =
> > layer.dataProvider().identify(QgsPoint(x,y),
> > QgsRaster.IdentifyFormatValue ).results() ValueError: need more than 1
> > value to unpack
> >
> > Do you have an idea for this, too?
> >
> > Thanks
> > Otto
> >
> > Am Thu, 1 Aug 2013 16:00:08 -0300
> > schrieb Etienne Tourigny :
> >
> > > Have a look at the source of the value tool plugin, it calls the
> > > identify() method and has been updated to 2.0 api.
> > >
> > > Etienne
> > >
> > > On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau 
> > > wrote:
> > >
> > > > Hi,
> > > >
> > > > I want to update a plugin from 1.8 to QGIS 2.0 and it throws
> > > > following error:
> > > >
> > > > Traceback (most recent call last):
> > > > File
> > > >
> > > >
> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > > line 447, in printValue self.showValues() File
> > > >
> > > >
> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > > line 453, in showValues self.plot() File
> > > >
> > > >
> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > > line 514, in plot w =
> > > > float(self.sampleRaster(self.InRastW.currentText(), self.xCoord,
> > > > self.yCoord))/10 File
> > > >
> > > >
> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > > line 299, in sampleRaster return self.sampleRaster20(layer, x, y)
> > > > File
> > > >
> > > >
> > > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > > line 284, in sampleRaster20 success, data =
> > > > layer.dataProvider().identify(QgsPoint(x,y))
> > > >
> > > > TypeError:
> > > > QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,
> > > > QgsRectangle theExtent=QgsRectangle(), int theWidth=0, int
> > > > theHeight=0): not enough arguments
> > > >
> > > > I found at
> > > > http://hub.qgis.org/wiki/quantum-gis/API_changes_for_version_20 the
> > > > section QgsRasterDataProvider which should fit. And the Method,
> > > > where I assume the error occurs should be this
> > > >
> > > > # get value at mouse position QGIS <= 1.8 (working for 1.8)
> > > > def sampleRaster18(self, layer, x, y):
> > > >success, data = layer.identify(QgsPoint(x,y))
> > > >for band, value in data.items():
> > > >  return value
> > > >
> > > > now what I tried but doesn't work (see error above)
> > > >
> > > > # get value at mouse position QGIS >= 2.0 (not working yet :()
> > > > def sample

Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Matthias Kuhn
On Fre 02 Aug 2013 15:52:19 CEST, Etienne Tourigny wrote:
> On Fri, Aug 2, 2013 at 10:22 AM, Matthias Kuhn  wrote:
>> On Fre 02 Aug 2013 15:13:04 CEST, Etienne Tourigny wrote:
>>> On Fri, Aug 2, 2013 at 9:37 AM, Matthias Kuhn  wrote:
 Hi

 On Fre 02 Aug 2013 13:50:08 CEST, Etienne Tourigny wrote:
>
> for each band, if the point is outside of the raster extent or is
> nodata, the value will be a null QVariant (i.e. QVariant()) which in
> python is None.

 It will be a QPyNullVariant so doing

 value = QPyNullVariant( int )
 if not value:
 print 'Is NULL'
 else:
 print 'Is not NULL'

 if value is None:
 print 'Is None'
 else:
 print 'Is NOT None'

 will print:
 Is NULL
 Is NOT None
>>>
>>> Hi,
>>>
>>> I was not referring to the value of QPyNullVariant( int ), but the
>>> value that results() would return in the case of nodata (which is
>>> QVariant() in the c++ code)
>>>
>>> unless mistaken, that would be converted to None by Sip - or am I wrong?
>>>
>>
>> The SIP API v2 for QVariant defines:
>>
>> An Invalid QVariant will be represented as None
>> A Null QVariant will be represented as QPyNullVariant [1]
>>
>> Except for feature attributes (e.g. for a vectorlayer: feature['attr'])
>> which is patched by QGIS to become None in case of a Null value.
>
> thanks for the clarification
>
> Although it seems that testing for None does the trick,,. In the case
> of nodata pixels this test does seem to work:
>
>   bandvalue = ident[iband]
>   if bandvalue is None:
>   bandvalue = "no data"
>

Ah, now I see.

QVariant() constructs an invalid QVariant and not a NULL QVariant. [1]

Glad we could sort this out :-)

Kind Regards
Matthias

[1] http://qt-project.org/doc/qt-4.8/qvariant.html#QVariant

> and in c++ nodata pixels are defined as QVariant() (i.e. a null QVariant)
>
>>
>> Matthias
>>
>> [1]
>> http://pyqt.sourceforge.net/Docs/PyQt4/python_v3.html#qvariant
>>

 Sorry for the smart-arsing ;)

 -- Matthias

>
>
> cheers
> Etienne
>
> On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau  wrote:
>>
>> Hi,
>>
>> thanks for your hints, I think I am on the right track now. I had a look 
>> at
>> the value tool plugin and tried to adapt the method accordingly:
>>
>> def sampleRaster20(self, layer, x, y):
>>#success, data = layer.dataProvider().identify(QgsPoint(x,y))
>>success, data = 
>> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
>>for band, value in data.items():
>>   return value
>>
>> But now I get another error message
>>
>>  File
>>  
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 448, in printValue self.showValues() File
>>  
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 454, in showValues self.plot() File
>>  
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 526, in plot w = 
>> float(self.sampleRaster(self.InRastW.currentText(),
>>  self.xCoord, self.yCoord))/10 File
>>  
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
>>  
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 285, in sampleRaster20 success, data =
>>  layer.dataProvider().identify(QgsPoint(x,y), 
>> QgsRaster.IdentifyFormatValue
>>  ).results() ValueError: need more than 1 value to unpack
>>
>> Do you have an idea for this, too?
>>
>> Thanks
>> Otto
>>
>> Am Thu, 1 Aug 2013 16:00:08 -0300
>> schrieb Etienne Tourigny :
>>
>>> Have a look at the source of the value tool plugin, it calls the 
>>> identify()
>>> method and has been updated to 2.0 api.
>>>
>>> Etienne
>>>
>>> On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau  
>>> wrote:
>>>
 Hi,

 I want to update a plugin from 1.8 to QGIS 2.0 and it throws following
 error:

 Traceback (most recent call last):
 File


 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 447, in printValue self.showValues() File


 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 453, in showValues self.plot() File


 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 514, in plot w = 
 float(self.sampleRaster(self.InRastW.currentText(),
 self.xCoord, self.yCoord))/10 File


 "/home/dassau/.qgis2/python/plug

Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Etienne Tourigny
On Fri, Aug 2, 2013 at 10:22 AM, Matthias Kuhn  wrote:
> On Fre 02 Aug 2013 15:13:04 CEST, Etienne Tourigny wrote:
>> On Fri, Aug 2, 2013 at 9:37 AM, Matthias Kuhn  wrote:
>>> Hi
>>>
>>> On Fre 02 Aug 2013 13:50:08 CEST, Etienne Tourigny wrote:

 for each band, if the point is outside of the raster extent or is
 nodata, the value will be a null QVariant (i.e. QVariant()) which in
 python is None.
>>>
>>> It will be a QPyNullVariant so doing
>>>
>>> value = QPyNullVariant( int )
>>> if not value:
>>> print 'Is NULL'
>>> else:
>>> print 'Is not NULL'
>>>
>>> if value is None:
>>> print 'Is None'
>>> else:
>>> print 'Is NOT None'
>>>
>>> will print:
>>> Is NULL
>>> Is NOT None
>>
>> Hi,
>>
>> I was not referring to the value of QPyNullVariant( int ), but the
>> value that results() would return in the case of nodata (which is
>> QVariant() in the c++ code)
>>
>> unless mistaken, that would be converted to None by Sip - or am I wrong?
>>
>
> The SIP API v2 for QVariant defines:
>
> An Invalid QVariant will be represented as None
> A Null QVariant will be represented as QPyNullVariant [1]
>
> Except for feature attributes (e.g. for a vectorlayer: feature['attr'])
> which is patched by QGIS to become None in case of a Null value.

thanks for the clarification

Although it seems that testing for None does the trick,,. In the case
of nodata pixels this test does seem to work:

  bandvalue = ident[iband]
  if bandvalue is None:
  bandvalue = "no data"

and in c++ nodata pixels are defined as QVariant() (i.e. a null QVariant)

>
> Matthias
>
> [1]
> http://pyqt.sourceforge.net/Docs/PyQt4/python_v3.html#qvariant
>
>>>
>>> Sorry for the smart-arsing ;)
>>>
>>> -- Matthias
>>>


 cheers
 Etienne

 On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau  wrote:
>
> Hi,
>
> thanks for your hints, I think I am on the right track now. I had a look 
> at
> the value tool plugin and tried to adapt the method accordingly:
>
> def sampleRaster20(self, layer, x, y):
>#success, data = layer.dataProvider().identify(QgsPoint(x,y))
>success, data = 
> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
>for band, value in data.items():
>   return value
>
> But now I get another error message
>
>  File
>  
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 448, in printValue self.showValues() File
>  
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 454, in showValues self.plot() File
>  
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 526, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
>  self.xCoord, self.yCoord))/10 File
>  
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
>  
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 285, in sampleRaster20 success, data =
>  layer.dataProvider().identify(QgsPoint(x,y), 
> QgsRaster.IdentifyFormatValue
>  ).results() ValueError: need more than 1 value to unpack
>
> Do you have an idea for this, too?
>
> Thanks
> Otto
>
> Am Thu, 1 Aug 2013 16:00:08 -0300
> schrieb Etienne Tourigny :
>
>> Have a look at the source of the value tool plugin, it calls the 
>> identify()
>> method and has been updated to 2.0 api.
>>
>> Etienne
>>
>> On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau  
>> wrote:
>>
>>> Hi,
>>>
>>> I want to update a plugin from 1.8 to QGIS 2.0 and it throws following
>>> error:
>>>
>>> Traceback (most recent call last):
>>> File
>>>
>>>
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>> line 447, in printValue self.showValues() File
>>>
>>>
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>> line 453, in showValues self.plot() File
>>>
>>>
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>> line 514, in plot w = 
>>> float(self.sampleRaster(self.InRastW.currentText(),
>>> self.xCoord, self.yCoord))/10 File
>>>
>>>
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>> line 299, in sampleRaster return self.sampleRaster20(layer, x, y) File
>>>
>>>
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>> line 284, in sampleRaster20 success, data =
>>> layer.dataProvider().identify(QgsPoint(x,y))
>>>
>>> TypeError:
>>> QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,

Re: [Qgis-developer] WMS/WMTS

2013-08-02 Thread Borys Jurgiel
Dnia piątek, 2 sierpnia 2013 o 15:02:26 Werner Macho napisał(a):
> Hi!
> Translators are aware that there will be some changes/bugfixes. So I
> have no Problem to add this in the GUI as it seems to be very useful.
> Actually it is the first time translators are actively reporting back
> issues in original language and I very welcome that.
> 
> The only thing is that I promised to do a String update ONE WEEK before
> the final release (That should give enough time to do the 25-50 changes).

Ooookay, I haven't realized it and thought we're completely frozen. I forget 
all the reports. Sorry for bothering :-)
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Bug 7941 : workaround ?

2013-08-02 Thread Régis Haubourg
Hien TRAN-QUANG wrote
> Hello,
> 
> Can you check that you have a file named ntf_r93.gsb in the
> OSgeo4W/share/proj folder ? That file is a datum shift grid provided by
> french IGN and is called by the  "+nadgrids=ntf_r93.gsb" parameter in the
> proj.4 call.
> 
> 
> Hien.

the ntf_r93.gsb grid is there (bug reproduced here)



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Bug-7941-workaround-tp5070472p5070492.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] Bug 7941 : workaround ?

2013-08-02 Thread Hien TRAN-QUANG
Hello,

Can you check that you have a file named ntf_r93.gsb in the
OSgeo4W/share/proj folder ? That file is a datum shift grid provided by
french IGN and is called by the  "+nadgrids=ntf_r93.gsb" parameter in the
proj.4 call.


Hien.



> -- Message transféré --
> From: "Benoît Laurent" 
> To: QGIS Developer List 
> Cc:
> Date: Fri, 02 Aug 2013 14:47:20 +0200
> Subject: [Qgis-developer] Bug 7941 : workaround ?
> Hello,
>
> I am facing bug 7941 
> (http://hub.qgis.org/issues/**7941)
> which has not been corrected yet.
>
> I have many shapefiles in Lambert 93 and a raster file (.tif) in Lambert I
> which I would fit together. Because of the bug, I can't. Is there a
> workaround ? I tried to change the coordinates in the .tfw file but I does
> not work properly.
>
> Any help would be appreciated.
>
> Benoīt
>
>
> ___
> Qgis-developer mailing list
> Qgis-developer@lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Matthias Kuhn
On Fre 02 Aug 2013 15:13:04 CEST, Etienne Tourigny wrote:
> On Fri, Aug 2, 2013 at 9:37 AM, Matthias Kuhn  wrote:
>> Hi
>>
>> On Fre 02 Aug 2013 13:50:08 CEST, Etienne Tourigny wrote:
>>>
>>> for each band, if the point is outside of the raster extent or is
>>> nodata, the value will be a null QVariant (i.e. QVariant()) which in
>>> python is None.
>>
>> It will be a QPyNullVariant so doing
>>
>> value = QPyNullVariant( int )
>> if not value:
>> print 'Is NULL'
>> else:
>> print 'Is not NULL'
>>
>> if value is None:
>> print 'Is None'
>> else:
>> print 'Is NOT None'
>>
>> will print:
>> Is NULL
>> Is NOT None
>
> Hi,
>
> I was not referring to the value of QPyNullVariant( int ), but the
> value that results() would return in the case of nodata (which is
> QVariant() in the c++ code)
>
> unless mistaken, that would be converted to None by Sip - or am I wrong?
>

The SIP API v2 for QVariant defines:

An Invalid QVariant will be represented as None
A Null QVariant will be represented as QPyNullVariant [1]

Except for feature attributes (e.g. for a vectorlayer: feature['attr']) 
which is patched by QGIS to become None in case of a Null value.

Matthias

[1]
http://pyqt.sourceforge.net/Docs/PyQt4/python_v3.html#qvariant

>>
>> Sorry for the smart-arsing ;)
>>
>> -- Matthias
>>
>>>
>>>
>>> cheers
>>> Etienne
>>>
>>> On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau  wrote:

 Hi,

 thanks for your hints, I think I am on the right track now. I had a look at
 the value tool plugin and tried to adapt the method accordingly:

 def sampleRaster20(self, layer, x, y):
#success, data = layer.dataProvider().identify(QgsPoint(x,y))
success, data = 
 layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
for band, value in data.items():
   return value

 But now I get another error message

  File
  
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
  line 448, in printValue self.showValues() File
  
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
  line 454, in showValues self.plot() File
  
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
  line 526, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
  self.xCoord, self.yCoord))/10 File
  
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
  line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
  
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
  line 285, in sampleRaster20 success, data =
  layer.dataProvider().identify(QgsPoint(x,y), QgsRaster.IdentifyFormatValue
  ).results() ValueError: need more than 1 value to unpack

 Do you have an idea for this, too?

 Thanks
 Otto

 Am Thu, 1 Aug 2013 16:00:08 -0300
 schrieb Etienne Tourigny :

> Have a look at the source of the value tool plugin, it calls the 
> identify()
> method and has been updated to 2.0 api.
>
> Etienne
>
> On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau  wrote:
>
>> Hi,
>>
>> I want to update a plugin from 1.8 to QGIS 2.0 and it throws following
>> error:
>>
>> Traceback (most recent call last):
>> File
>>
>>
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> line 447, in printValue self.showValues() File
>>
>>
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> line 453, in showValues self.plot() File
>>
>>
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> line 514, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
>> self.xCoord, self.yCoord))/10 File
>>
>>
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> line 299, in sampleRaster return self.sampleRaster20(layer, x, y) File
>>
>>
>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>> line 284, in sampleRaster20 success, data =
>> layer.dataProvider().identify(QgsPoint(x,y))
>>
>> TypeError:
>> QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,
>> QgsRectangle theExtent=QgsRectangle(), int theWidth=0, int theHeight=0):
>> not enough arguments
>>
>> I found at
>> http://hub.qgis.org/wiki/quantum-gis/API_changes_for_version_20 the
>> section QgsRasterDataProvider which should fit. And the Method, where I
>> assume the error occurs should be this
>>
>> # get value at mouse position QGIS <= 1.8 (working for 1.8)
>> def sampleRaster18(self, layer, x, y):
>>success, data = layer.identify(QgsPoint(x,y))
>>for band, value in data.items():
>>  return value
>>
>>>

Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Etienne Tourigny
On Fri, Aug 2, 2013 at 9:37 AM, Matthias Kuhn  wrote:
> Hi
>
> On Fre 02 Aug 2013 13:50:08 CEST, Etienne Tourigny wrote:
>>
>> for each band, if the point is outside of the raster extent or is
>> nodata, the value will be a null QVariant (i.e. QVariant()) which in
>> python is None.
>
> It will be a QPyNullVariant so doing
>
> value = QPyNullVariant( int )
> if not value:
> print 'Is NULL'
> else:
> print 'Is not NULL'
>
> if value is None:
> print 'Is None'
> else:
> print 'Is NOT None'
>
> will print:
> Is NULL
> Is NOT None

Hi,

I was not referring to the value of QPyNullVariant( int ), but the
value that results() would return in the case of nodata (which is
QVariant() in the c++ code)

unless mistaken, that would be converted to None by Sip - or am I wrong?

>
> Sorry for the smart-arsing ;)
>
> -- Matthias
>
>>
>>
>> cheers
>> Etienne
>>
>> On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau  wrote:
>>>
>>> Hi,
>>>
>>> thanks for your hints, I think I am on the right track now. I had a look at
>>> the value tool plugin and tried to adapt the method accordingly:
>>>
>>> def sampleRaster20(self, layer, x, y):
>>>#success, data = layer.dataProvider().identify(QgsPoint(x,y))
>>>success, data = 
>>> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
>>>for band, value in data.items():
>>>   return value
>>>
>>> But now I get another error message
>>>
>>>  File
>>>  
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>>  line 448, in printValue self.showValues() File
>>>  
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>>  line 454, in showValues self.plot() File
>>>  
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>>  line 526, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
>>>  self.xCoord, self.yCoord))/10 File
>>>  
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>>  line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
>>>  
>>> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>>  line 285, in sampleRaster20 success, data =
>>>  layer.dataProvider().identify(QgsPoint(x,y), QgsRaster.IdentifyFormatValue
>>>  ).results() ValueError: need more than 1 value to unpack
>>>
>>> Do you have an idea for this, too?
>>>
>>> Thanks
>>> Otto
>>>
>>> Am Thu, 1 Aug 2013 16:00:08 -0300
>>> schrieb Etienne Tourigny :
>>>
 Have a look at the source of the value tool plugin, it calls the identify()
 method and has been updated to 2.0 api.

 Etienne

 On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau  wrote:

> Hi,
>
> I want to update a plugin from 1.8 to QGIS 2.0 and it throws following
> error:
>
> Traceback (most recent call last):
> File
>
>
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> line 447, in printValue self.showValues() File
>
>
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> line 453, in showValues self.plot() File
>
>
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> line 514, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
> self.xCoord, self.yCoord))/10 File
>
>
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> line 299, in sampleRaster return self.sampleRaster20(layer, x, y) File
>
>
> "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> line 284, in sampleRaster20 success, data =
> layer.dataProvider().identify(QgsPoint(x,y))
>
> TypeError:
> QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,
> QgsRectangle theExtent=QgsRectangle(), int theWidth=0, int theHeight=0):
> not enough arguments
>
> I found at
> http://hub.qgis.org/wiki/quantum-gis/API_changes_for_version_20 the
> section QgsRasterDataProvider which should fit. And the Method, where I
> assume the error occurs should be this
>
> # get value at mouse position QGIS <= 1.8 (working for 1.8)
> def sampleRaster18(self, layer, x, y):
>success, data = layer.identify(QgsPoint(x,y))
>for band, value in data.items():
>  return value
>
> now what I tried but doesn't work (see error above)
>
> # get value at mouse position QGIS >= 2.0 (not working yet :()
> def sampleRaster20(self, layer, x, y):
>success, data = layer.dataProvider().identify(QgsPoint(x,y))
>for band, value in data.items():
>  return value
>
> my problem is, that I don't understand how to implement in sampleRaster20
> the new method from the API_changes_for_version_20 website which says:
>
> QMap identify( const QgsPoint & thePoint, IdentifyFormat
> theFormat, const QgsRectan

[Qgis-developer] WMS/WMTS

2013-08-02 Thread Werner Macho
On 08/02/2013 02:37 PM, Borys Jurgiel wrote:
> Dnia piątek, 2 sierpnia 2013 o 13:31:21 Andreas Neumann napisał(a):
>>  The translation into any language is easy and possible for everyone,
>>  even if you don't know the language - you just add the /WMTS.
>>
>>  Or are people translating the acronym WMS? Hopefully not.
> 
> Ok, you're right. So just let's don't forget to replace it manually after the 
> last translation is accepted. Werner, will you remember? I can do it.
> 

Hi!
Translators are aware that there will be some changes/bugfixes. So I
have no Problem to add this in the GUI as it seems to be very useful.
Actually it is the first time translators are actively reporting back
issues in original language and I very welcome that.

The only thing is that I promised to do a String update ONE WEEK before
the final release (That should give enough time to do the 25-50 changes).

So if you want .. change it right now in the GUI so that active
translators can catch up with it.

Thanks for pointing this out

kind regards
Werner

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


[Qgis-developer] Bug 7941 : workaround ?

2013-08-02 Thread Benoît Laurent

Hello,

I am facing bug 7941 (http://hub.qgis.org/issues/7941) which has not 
been corrected yet.


I have many shapefiles in Lambert 93 and a raster file (.tif) in Lambert 
I which I would fit together. Because of the bug, I can't. Is there a 
workaround ? I tried to change the coordinates in the .tfw file but I 
does not work properly.


Any help would be appreciated.

Benoît
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Matthias Kuhn
Hi

On Fre 02 Aug 2013 13:50:08 CEST, Etienne Tourigny wrote:
>
> for each band, if the point is outside of the raster extent or is
> nodata, the value will be a null QVariant (i.e. QVariant()) which in
> python is None.

It will be a QPyNullVariant so doing

value = QPyNullVariant( int )
if not value:
print 'Is NULL'
else:
print 'Is not NULL'

if value is None:
print 'Is None'
else:
print 'Is NOT None'

will print:
Is NULL
Is NOT None

Sorry for the smart-arsing ;)

-- Matthias

>
>
> cheers
> Etienne
>
> On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau  wrote:
>>
>> Hi,
>>
>> thanks for your hints, I think I am on the right track now. I had a look at
>> the value tool plugin and tried to adapt the method accordingly:
>>
>> def sampleRaster20(self, layer, x, y):
>>#success, data = layer.dataProvider().identify(QgsPoint(x,y))
>>success, data = 
>> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
>>for band, value in data.items():
>>   return value
>>
>> But now I get another error message
>>
>>  File
>>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 448, in printValue self.showValues() File
>>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 454, in showValues self.plot() File
>>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 526, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
>>  self.xCoord, self.yCoord))/10 File
>>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
>>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>>  line 285, in sampleRaster20 success, data =
>>  layer.dataProvider().identify(QgsPoint(x,y), QgsRaster.IdentifyFormatValue
>>  ).results() ValueError: need more than 1 value to unpack
>>
>> Do you have an idea for this, too?
>>
>> Thanks
>> Otto
>>
>> Am Thu, 1 Aug 2013 16:00:08 -0300
>> schrieb Etienne Tourigny :
>>
>>> Have a look at the source of the value tool plugin, it calls the identify()
>>> method and has been updated to 2.0 api.
>>>
>>> Etienne
>>>
>>> On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau  wrote:
>>>
 Hi,

 I want to update a plugin from 1.8 to QGIS 2.0 and it throws following
 error:

 Traceback (most recent call last):
 File


 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 447, in printValue self.showValues() File


 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 453, in showValues self.plot() File


 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 514, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
 self.xCoord, self.yCoord))/10 File


 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 299, in sampleRaster return self.sampleRaster20(layer, x, y) File


 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 284, in sampleRaster20 success, data =
 layer.dataProvider().identify(QgsPoint(x,y))

 TypeError:
 QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,
 QgsRectangle theExtent=QgsRectangle(), int theWidth=0, int theHeight=0):
 not enough arguments

 I found at
 http://hub.qgis.org/wiki/quantum-gis/API_changes_for_version_20 the
 section QgsRasterDataProvider which should fit. And the Method, where I
 assume the error occurs should be this

 # get value at mouse position QGIS <= 1.8 (working for 1.8)
 def sampleRaster18(self, layer, x, y):
success, data = layer.identify(QgsPoint(x,y))
for band, value in data.items():
  return value

 now what I tried but doesn't work (see error above)

 # get value at mouse position QGIS >= 2.0 (not working yet :()
 def sampleRaster20(self, layer, x, y):
success, data = layer.dataProvider().identify(QgsPoint(x,y))
for band, value in data.items():
  return value

 my problem is, that I don't understand how to implement in sampleRaster20
 the new method from the API_changes_for_version_20 website which says:

 QMap identify( const QgsPoint & thePoint, IdentifyFormat
 theFormat, const QgsRectangle &theExtent = QgsRectangle(), int theWidth =
 0, int theHeight = 0 )

 can anybody help?

 Thanks

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

>>
>>
>> --
>> Geoinformatik Büro Dassau - http://www.gbd-consult.de
>> FOSSGIS consulting , training , support  and analysis
>> Ackerstrasse 144c  ,  D -

[Qgis-developer] JP2 jpeg2000 crashes qgis master

2013-08-02 Thread Régis Haubourg
Hi, 
I just tried opening jpeg 2000 sample images from pleiade sat (see
http://www.astrium-geo.com/en/23-sample-imagery fro samples) and get a
crash. 
I installed ecw support following faunalia's instructions.  
Shall I file a bug or is this a known issue of the temporary patch to bring
ecw in master ? 
can I do something playing with gdal drivers? 
Régis



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/JP2-jpeg2000-crashes-qgis-master-tp5070459.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Etienne Tourigny
from the api 
http://www.qgis.org/api/classQgsRasterIdentifyResult.html#a8537d25fdff215e7e9650b71a0a16783

results() returns a QMap (one item for each band), it
does not return a tuple, so you should actually call

ident = 
layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()

and then test that ident is not empty (i,e. ident is not None and
ident.iterkeys() is not None)

for each band, if the point is outside of the raster extent or is
nodata, the value will be a null QVariant (i.e. QVariant()) which in
python is None.


cheers
Etienne

On Fri, Aug 2, 2013 at 7:13 AM, Otto Dassau  wrote:
>
> Hi,
>
> thanks for your hints, I think I am on the right track now. I had a look at
> the value tool plugin and tried to adapt the method accordingly:
>
> def sampleRaster20(self, layer, x, y):
>#success, data = layer.dataProvider().identify(QgsPoint(x,y))
>success, data = 
> layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
>for band, value in data.items():
>   return value
>
> But now I get another error message
>
>  File
>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 448, in printValue self.showValues() File
>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 454, in showValues self.plot() File
>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 526, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
>  self.xCoord, self.yCoord))/10 File
>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
>  "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
>  line 285, in sampleRaster20 success, data =
>  layer.dataProvider().identify(QgsPoint(x,y), QgsRaster.IdentifyFormatValue
>  ).results() ValueError: need more than 1 value to unpack
>
> Do you have an idea for this, too?
>
> Thanks
> Otto
>
> Am Thu, 1 Aug 2013 16:00:08 -0300
> schrieb Etienne Tourigny :
>
> > Have a look at the source of the value tool plugin, it calls the identify()
> > method and has been updated to 2.0 api.
> >
> > Etienne
> >
> > On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau  wrote:
> >
> > > Hi,
> > >
> > > I want to update a plugin from 1.8 to QGIS 2.0 and it throws following
> > > error:
> > >
> > > Traceback (most recent call last):
> > > File
> > >
> > >
> > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > line 447, in printValue self.showValues() File
> > >
> > >
> > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > line 453, in showValues self.plot() File
> > >
> > >
> > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > line 514, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
> > > self.xCoord, self.yCoord))/10 File
> > >
> > >
> > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > line 299, in sampleRaster return self.sampleRaster20(layer, x, y) File
> > >
> > >
> > > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > > line 284, in sampleRaster20 success, data =
> > > layer.dataProvider().identify(QgsPoint(x,y))
> > >
> > > TypeError:
> > > QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,
> > > QgsRectangle theExtent=QgsRectangle(), int theWidth=0, int theHeight=0):
> > > not enough arguments
> > >
> > > I found at
> > > http://hub.qgis.org/wiki/quantum-gis/API_changes_for_version_20 the
> > > section QgsRasterDataProvider which should fit. And the Method, where I
> > > assume the error occurs should be this
> > >
> > > # get value at mouse position QGIS <= 1.8 (working for 1.8)
> > > def sampleRaster18(self, layer, x, y):
> > >success, data = layer.identify(QgsPoint(x,y))
> > >for band, value in data.items():
> > >  return value
> > >
> > > now what I tried but doesn't work (see error above)
> > >
> > > # get value at mouse position QGIS >= 2.0 (not working yet :()
> > > def sampleRaster20(self, layer, x, y):
> > >success, data = layer.dataProvider().identify(QgsPoint(x,y))
> > >for band, value in data.items():
> > >  return value
> > >
> > > my problem is, that I don't understand how to implement in sampleRaster20
> > > the new method from the API_changes_for_version_20 website which says:
> > >
> > > QMap identify( const QgsPoint & thePoint, IdentifyFormat
> > > theFormat, const QgsRectangle &theExtent = QgsRectangle(), int theWidth =
> > > 0, int theHeight = 0 )
> > >
> > > can anybody help?
> > >
> > > Thanks
> > >
> > > Otto
> > > ___
> > > Qgis-developer mailing list
> > > Qgis-developer@lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> > >
>
>
> --
> Geoinformatik Büro Dassau - http://www.gbd-consult.de
> FOSSGI

Re: [Qgis-developer] update plugin to QGIS 2.0

2013-08-02 Thread Otto Dassau
Hi,

thanks for your hints, I think I am on the right track now. I had a look at
the value tool plugin and tried to adapt the method accordingly:

def sampleRaster20(self, layer, x, y):
   #success, data = layer.dataProvider().identify(QgsPoint(x,y))
   success, data = 
layer.dataProvider().identify(QgsPoint(x,y),QgsRaster.IdentifyFormatValue).results()
 
   for band, value in data.items(): 
  return value

But now I get another error message 

 File
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 448, in printValue self.showValues() File
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 454, in showValues self.plot() File
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 526, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
 self.xCoord, self.yCoord))/10 File
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 300, in sampleRaster return self.sampleRaster20(layer, x, y) File
 "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
 line 285, in sampleRaster20 success, data =
 layer.dataProvider().identify(QgsPoint(x,y), QgsRaster.IdentifyFormatValue
 ).results() ValueError: need more than 1 value to unpack

Do you have an idea for this, too?

Thanks 
Otto

Am Thu, 1 Aug 2013 16:00:08 -0300
schrieb Etienne Tourigny :

> Have a look at the source of the value tool plugin, it calls the identify()
> method and has been updated to 2.0 api.
> 
> Etienne
> 
> On Thu, Aug 1, 2013 at 1:58 PM, Otto Dassau  wrote:
> 
> > Hi,
> >
> > I want to update a plugin from 1.8 to QGIS 2.0 and it throws following
> > error:
> >
> > Traceback (most recent call last):
> > File
> >
> >
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > line 447, in printValue self.showValues() File
> >
> >
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > line 453, in showValues self.plot() File
> >
> >
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > line 514, in plot w = float(self.sampleRaster(self.InRastW.currentText(),
> > self.xCoord, self.yCoord))/10 File
> >
> >
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > line 299, in sampleRaster return self.sampleRaster20(layer, x, y) File
> >
> >
> > "/home/dassau/.qgis2/python/plugins/weibullanalyse/weibullanalysedialog.py",
> > line 284, in sampleRaster20 success, data =
> > layer.dataProvider().identify(QgsPoint(x,y))
> >
> > TypeError:
> > QgsRasterDataProvider.identify(QgsPoint, QgsRaster.IdentifyFormat,
> > QgsRectangle theExtent=QgsRectangle(), int theWidth=0, int theHeight=0):
> > not enough arguments
> >
> > I found at
> > http://hub.qgis.org/wiki/quantum-gis/API_changes_for_version_20 the
> > section QgsRasterDataProvider which should fit. And the Method, where I
> > assume the error occurs should be this
> >
> > # get value at mouse position QGIS <= 1.8 (working for 1.8)
> > def sampleRaster18(self, layer, x, y):
> >success, data = layer.identify(QgsPoint(x,y))
> >for band, value in data.items():
> >  return value
> >
> > now what I tried but doesn't work (see error above)
> >
> > # get value at mouse position QGIS >= 2.0 (not working yet :()
> > def sampleRaster20(self, layer, x, y):
> >success, data = layer.dataProvider().identify(QgsPoint(x,y))
> >for band, value in data.items():
> >  return value
> >
> > my problem is, that I don't understand how to implement in sampleRaster20
> > the new method from the API_changes_for_version_20 website which says:
> >
> > QMap identify( const QgsPoint & thePoint, IdentifyFormat
> > theFormat, const QgsRectangle &theExtent = QgsRectangle(), int theWidth =
> > 0, int theHeight = 0 )
> >
> > can anybody help?
> >
> > Thanks
> >
> > Otto
> > ___
> > Qgis-developer mailing list
> > Qgis-developer@lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> >


-- 
Geoinformatik Büro Dassau - http://www.gbd-consult.de
FOSSGIS consulting , training , support  and analysis
Ackerstrasse 144c  ,  D - 40233 Düsseldorf  , Germany
Tel: +49-(0)211-47468178 , Mobil: +49-(0)171-4687540

--
Community Advisor - QGIS Project Steering Committee
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer