anitagraser / QGIS-Processing-tools

This is a collection of scripts and models for QGIS Processing
89 stars 55 forks source link

Any adjustments are needed for QGIS 3? #18

Open shaief opened 6 years ago

shaief commented 6 years ago

Thanks for writing these scripts. What is needed in order to use them in QGIS 3?

anitagraser commented 6 years ago

They have to be completely rewritten in Python 3 with the new Processing Scripts API, see https://anitagraser.com/2018/03/25/processing-script-template-for-qgis3/

Pyatkova commented 5 years ago

Hey Anita, it works wonderfully in 2.18. However, I am now trying to make it run in QGIS 3.6 and I am completely stuck. Can you please advice how to translate this bit:

writer = VectorWriter(output, None, [QgsField("order", QVariant.Int)], network_layer.dataProvider().geometryType(), network_layer.crs() )

anitagraser commented 5 years ago

The above link contains the necessary code for writing output using a feature sink (that's a new concept that replaces the old writer).

However, since you are using QGIS 3.6, you can use a simpler version instead, which I've written about in https://anitagraser.com/2019/03/02/easy-processing-scripts-comeback-in-qgis-3-6/

Pyatkova commented 5 years ago

Hey Anita, Thanks a lot for your reply. I couldn't figure out how to use the decorators. As I was trying to snap GPS coordinates to streets, I decided maybe a more sophisticated method should be used. Now I am focusing on Offline Map-matching :)