[Qgis-developer] Chain Temporary Algorithms

Bjorn Nyberg bjorn.burr.nyberg at gmail.com
Fri Jul 26 22:26:44 PDT 2013


Sorry I posted the wrong code in the previous post it should read

import sextante as st
    
densify = st.runalg("qgis:densifygeometries"),Polygon,Detail,None)
extractNodes = st.runalg("qgis:extractnodes",densify,None)
voronoi = st.runalg("qgis:voronoipolygons",extractNodes,None)
voronoi_lines = st.runalg("qgis:polygonstolines",voronoi,None)
polygon_lines = st.runalg("qgis:polygonstolines",Polygon,None)
clip = st.runalg("qgis:clip",Polygon,voronoi_lines,None)
outData = st.runalg("qgis:difference",clip,polygon_lines,None)

The error I receive follows:
Oooops! SEXTANTE could not open the following output layers

Output:/var/folders/jk/2kj1gpl15d1747rkn7sl_mkh0000gn/T/sextante/scriptexamplescript521deca6725e4911ab0ecebf719f4bdf.shp
The above files could not be opened, which probably indicates that they were not correctly produced by the executed algorithm

Checking the log information might help you see why those layers were not created as expected

Cheers,
Bjorn

On Jul 27, 2013, at 13:29 PM, bjorn.burr.nyberg at gmail.com wrote:

> Hej Everyone,
> New to the mailing list here... and I am having some trouble writing a
> script that I was hoping someone could lend me a hand with. Mainly this is a
> script I use to get centerline's of a polygon that I used in ArcGIS before
> and I want to adapt it to work in QGIS. Anyways there are a sequence of
> algorithms from qgis that I want to use in memory before getting the final
> output as a series of points (which then need to be processed further)
> however chaining these algorithms simply fails after the first one where the
> output is simply not being created for the next step to process.
> 
> Here is a snippet of that code - any help would be appreciated!
> Cheers,
> Bjorn
> 
> #Definition of inputs and outputs
> #==================================
> ##[Example scripts]=group
> ##Polygon=vector
> ##Detail=number 1000
> ##Scale=boolean True
> ##All_Paths=boolean False
> ##Output=output vector
> 
> #Algorithm body
> #==================================
> import sextante as st
> 
> densify = st.runalg("qgis:densifygeometries"),inFC,Detail,None)
> extractNodes = st.runalg("qgis:extractnodes",densify,None)
> voronoi = st.runalg("qgis:voronoipolygons",extractNodes,None)
> voronoi_lines = st.runalg("qgis:polygonstolines",voronoi,None)
> polygon_lines = st.runalg("qgis:polygonstolines",inFC,None)
> clip = st.runalg("qgis:clip",inFC,voronoi_lines,None)
> out = st.runalg("qgis:difference",clip,polygon_lines,None)
> 
> layer = st.getobject(out)
> features: = st.getfeatures(layer)
> Points = []
> for feature in features:
>    Points.append(features.geometry().asMultiPolyline())
> 
> 
> 
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/Chain-Temporary-Algorithms-tp5069057.html
> Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130727/6b9ef01b/attachment-0001.html>


More information about the Qgis-developer mailing list