[Qgis-user] qgis api

Giuseppe Amatulli giuseppe.amatulli at gmail.com
Mon Aug 19 12:08:27 PDT 2013


Hi,
i'm trying to create a script that use qgis api to do an intersection
between two shp .
The script works fine in the Qgis python console returning "true" and
creating the intersect
shp, instead in the python console returns "false"

from qgis.core import *
from qgis import *
import qgis.utils
from qgis import analysis
from qgis.analysis import *

QgsApplication.initQgis()

shpA = QgsVectorLayer("/home/selv/tmp/for_clip.shp" , "layerA", "ogr")
shpB = QgsVectorLayer("/home/selv/tmp/bug5598.shp"   , "layerB", "ogr")
QgsOverlayAnalyzer().intersection( shpA , shpB  , "/home/selv/tmp/test.shp")

so after this lines i get
true in the qgis python console (the intersect shp is created)
false in the python console        (the intersect shp is not created)

Should i load other modules? or do i missing something else?

Thanks
Regards
Giuseppe


-- 
Giuseppe Amatulli
Web: www.spatial-ecology.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20130819/d2e746c9/attachment.html>


More information about the Qgis-user mailing list