On Mon, Sep 30, 2013 at 8:14 AM, Paolo Cavallini cavall...@faunalia.it wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Il 27/09/2013 12:33, Paolo Cavallini ha scritto:
Hi all.
Using one layer from
http://www.pcn.minambiente.it/PCNDYN/catalogowcs.jsp
e.g.
Try the QgsGeometry::combine() method.
http://www.qgis.org/api/classQgsGeometry.html#a63244d3435cc99794b82a6cbd0af0eb5
Quoting class doc
*Note:*this operation is not called union since its a reserved word in C++.
On Sat, Oct 5, 2013 at 8:07 AM, gene martin.lal...@gmail.com wrote:
I also do
Finally, I found the solution: it is
*geom.combine(another_geom)* and not union, why ?
gLine = QgsGeometry.fromPolyline( [ QgsPoint(1,1), QgsPoint(2,2) ] )
gLine2 = QgsGeometry.fromPolyline( [ QgsPoint(1,2), QgsPoint(2,1) ])
gLine2.combine(gLine).exportToGeoJSON()
u'{ type:
Ok, the reply is
this operation is not called union since its a reserved word in
C++.
Thanks to Daniel-2, we post at the same time.
--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Python-Union-selected-polygons-in-a-layer-tp5081862p5081967.html
Sent from the
Hi Daniel,
Thanks - this should do the trick! And it explains why I did not find
Union.
Will try on Monday when I am back in the office.
Andreas
Am 05.10.2013 11:55, schrieb Daniel:
Try the QgsGeometry::combine() method.
Hi Andreas,
First create a spatial index over layer features (I got this code from
ftools_utils.py)
# Convinience function to create a spatial index for input
QgsVectorDataProvider
def createIndex( provider ):
feat = QgsFeature()
index = QgsSpatialIndex()
fit = provider.getFeatures()
On Sun, Oct 6, 2013 at 9:45 AM, Daniel daniel...@gmail.com wrote:
def createIndex( provider ):
feat = QgsFeature()
index = QgsSpatialIndex()
fit = provider.getFeatures()
while fit.nextFeature( feat ):
index.insertFeature( feat )
return index
Try something like
Using map() is the pythonic way
Maybe ftools need an upgrade :)
Thanks for the tip
On Sat, Oct 5, 2013 at 8:53 PM, Nathan Woodrow madman...@gmail.com wrote:
On Sun, Oct 6, 2013 at 9:45 AM, Daniel daniel...@gmail.com wrote:
def createIndex( provider ):
feat = QgsFeature()
index
Very Nice
+1
--
Daniel Vaz
___
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer