[Qgis-user] Error while processing "servicearea"

Jean-Baptiste Desbas jb.desbas at gmail.com
Fri May 4 08:06:09 PDT 2018


Solved by myself :

serviceParameter={'INPUT':network,'START_POINTS':depart,'STRATEGY':0,'TRAVEL_COST':travel_cost,'DEFAULT_DIRECTION':2,'DEFAULT_SPEED':5.0,'TOLERANCE':0.0,'INCLUDE_BOUNDS':False,'OUTPUT_LINES':'memory:','DIRECTION_FIELD'
> : '','VALUE_BACKWARD' : '', 'VALUE_BOTH' : '', 'VALUE_FORWARD' : '' }
>
>
> r=processing.run('qgis:serviceareafromlayer',serviceParameter,feedback=feedback)
> l=r['OUTPUT_LINES']
>
for f in l.getFeatures():
>     sink.addFeature(f)
>

2018-05-03 9:33 GMT+02:00 Jean-Baptiste Desbas <jb.desbas at gmail.com>:

> Hello,
>
> I want to use the serviceareafromlayer alg in a python script, but it give
> me an error :
>
> Traceback (most recent call last):
> File "C:/PROGRA~1/QGIS3~1.0/apps/qgis/./python/plugins\
> processing\algs\qgis\ServiceAreaFromLayer.py", line 264, in
> processAlgorithm
> fields, QgsWkbTypes.MultiLineString, network.sourceCrs())
> Exception: unknown
>
> I can successfuly lunch that alg with the same input layer from the GUI,
> so what's wrong with my code ?
>
> Here is the code : http://paste.debian.net/1023040/
>
> Thanks,
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180504/950eb586/attachment.html>


More information about the Qgis-user mailing list