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 <[email protected]>:
> 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,
>
_______________________________________________
Qgis-user mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user