Re: [Qgis-developer] How to get feat.geometry() from SpatiaLite in pyQGis ?

2013-12-06 Thread giulianc51
Il giorno Thu, 5 Dec 2013 11:10:03 +0100
Geo DrinX geodr...@gmail.com ha scritto:

 Hello all,

Hi Roberto (sorry for my bad english :-)

 as in object, within pyQGis  I need to read the geometry of a
 SpatiaLite vector layer.
 
 This is my source code:
 
 layer = iface.mapCanvas().currentLayer()
 iter = layer.getFeatures()
 for feat in iter:
 geom = feat.geometry()
 elem = geom.asPolyline()
 print(ELEM %s\n) %(elem)
 for p1 in elem:
 x1,y1 = p1.x(),p1.y()
 print(XY= %lf %lf\n) %(x1, y1)
 
 
 But... it returns only:
 
 ELEM []
 ELEM []
 ELEM []
 ELEM []
 .
 Somebody can help me to understand how to get geometry from
 SpatiaLite ?
 

I tried in python console on a Spatialite linestring layer:
cLayer=iface.activeLayer()
iter=cLayer.getFeatures()
feat=iter.next()
geom=feat.geometry()
ln=geom.asPolyline()
pnt=ln[0]
print pnt.x(),pnt.y()
with the correct answer:
1511590.31375 5099925.78455
(but I'm on a old 1.9.0-Master)


 Thank you in advance
 
 Roberto

bye,
giuliano

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


Re: [Qgis-developer] How to get feat.geometry() from SpatiaLite in pyQGis ?

2013-12-06 Thread Geo DrinX
Hi Christos (!),


sorry but your code works only in QGis 1.8 version.
I am using the 2.0.1 version and pyQGis methods are changed:

http://hub.qgis.org/wiki/quantum-gis/Python_plugin_API_changes_from_18_to_20


BTW, my problem is:

- using a SHP file layer,  elements are returned
- using SpatiaLite layer,  elements are returned, but each is empty.


It 'a known issue?
Someone in the list has tried it?


Roberto


2013/12/6 mmekuria sail...@yahoo.com

 Hi, Roberto:

 I think the query from layer.getFeatures() returns an iterator and that
 means you use the nextFeature(feat) to get the next feature until it fails
 to return a feature, then it means you have reached the end of the iterator
 list.

 iter = layer.getFeatures()
 while iter.nextFeature(feat):
 geom = feat.geometry()
 elem = geom.asPolyline()
 print(ELEM %s\n) %(elem)
 for p1 in elem:
 x1,y1 = p1.x(),p1.y()
 print(XY= %lf %lf\n) %(x1, y1)


 Should work for you,





 -
 Maaza Christos, PhD
 www.Axumcorp.com

 --
 View this message in context:
 http://osgeo-org.1560.x6.nabble.com/How-to-get-feat-geometry-from-SpatiaLite-in-pyQGis-tp5092891p5093041.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

[Qgis-developer] W*S obtain only the server url

2013-12-06 Thread Luca Delucchi
Hi everybody,

I have a WFS layer and I would like to obtain the server url using pyqgis.
Now I'm using layer.source(), but it return the entire url with all
the parameters.
Is there a way to abtain only the server url?
When QGIS create the string for the request it append every time
REQUEST parameter for first? Could I split the string using it?

Thanks

-- 
ciao
Luca

http://gis.cri.fmach.it/delucchi/
www.lucadelu.org
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer


Re: [Qgis-developer] [Qgis-user] GarminCustomMap-plugin version update to 1.0

2013-12-06 Thread Blumentrath, Stefan
Hi

Good to hear that the plugin is of use.
I am not sure if I understood what you want to achieve.
In general it should be possible to remove the lower limit of the zoom-factor.
However, zooming out and then exporting the Garmin Custom Map / KMZ would give 
the same result.

Btw, the zoom-factor does not affect the possibility to zoom on your Garmin 
unit.

Or did you mean something else?

Cheers
Stefan


From: Harish [mailto:harry.om2...@gmail.com]
Sent: 6. desember 2013 14:21
To: Blumentrath, Stefan
Cc: rich...@duif.net; qgis-developer@lists.osgeo.org; qgis-u...@lists.osgeo.org
Subject: Re: [Qgis-user] GarminCustomMap-plugin version update to 1.0

Great plugin! thanks!
Can the Zoom factor be less than 1.0 so that the map can be viewed on lesser 
scales also?
Regards
Harish
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

[Qgis-developer] Video Uav Tracker

2013-12-06 Thread salvatore

Hi to all,
i already developed a plugin for qgis, on 64 bit (linux and windows) it 
runs smoothly. on 32 bit windows it crash qgis at startup. it is 
possible to update it on the repository only for 64 bit? if you want to 
test it you can find it at 
https://sourceforge.net/projects/videouavtrackerqgisplugin/ .


if you want some data to test it for real, ask to me and i will send it 
to you.  sag...@katamail.com

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


[Qgis-developer] Shortcut changes in QGIS; call for opinions

2013-12-06 Thread A Huarte
Fixing Feature #9094 (http://hub.qgis.org/issues/9094) we have implemented 
several shortcut changes in QGIS desktop application in order to make more 
agile editing geometries:

QgisApp / MapCanvas:

+ By default, 'Delete' and 'Backspace' keys are used to delete the current 
selected features. Now, no message for confirmation is showed (It is an 
undoable action), but a new status message shows the number of deleted 
features. 'Delete' key does the same in attribute table dialog, as heretofore.

To avoid key conflicts, we have implemented that active MapTool can override 
the default behavior of shortcut keys.


+ 'Ctrl+D' removes seleted layer[s] in legend. Now, it ask for confirmation 
because of it is not an undoable action.


Node tool:

+ 'Delete' and 'Backspace' keys delete the selected node[s]. This tool, as 
'capture tool', ... override the default behavior of these keys. Also, it is 
automatically selected the adjacent node to last removed node.

+ '' key activates the next node to current selected node.


+ '' key activates the previous node to current selected node.


PR 1010 (https://github.com/qgis/QGIS/pull/1010) contains these changes.

Thank your very much!
Best regards___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer