Re: [QGIS-Developer] EditInPlace Processing script

2020-04-24 Thread matteo
Hi Germàn,

> the sample script I mentioned in my previous e-mail in this thread
> should be working on master now. Nyall fixed the bug reported.

awesome! Thanks to you and to Nyall!

Cheers

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-23 Thread Germán Carrillo
Hi Matteo,

the sample script I mentioned in my previous e-mail in this thread
should be working on master now. Nyall fixed the bug reported.

Regards,

Germán

El mar., 21 abr. 2020 a las 1:45, matteo ()
escribió:

> Hi Stefanos,
>
> yep, but digging into this I was wondering how to use the EditInPlace
> also for scripts :)
>
> Cheers and thanks for the hint
>
> Matteo
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer


-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres 

https://twitter.com/GeoTux2 

Grupo de Usuarios QGIS Colombia 

https://twitter.com/qgiscolombia
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-21 Thread matteo
Hi Stefanos,

yep, but digging into this I was wondering how to use the EditInPlace
also for scripts :)

Cheers and thanks for the hint

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-19 Thread uclaros
Hi Matteo,
not sure what exactly you want to achieve, but you can do a union and
dissolve by doing a buffer with zero buffer distance and enabling the
dissolve result checkbox.

Regards,
Stefanos




--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Developer-f4099106.html
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-18 Thread Germán Carrillo
Hi Matteo,

confirmed! Then, we've found a bug:

https://github.com/qgis/QGIS/issues/35844

Regards,

Germán

El vie., 17 abr. 2020 a las 2:29, matteo ()
escribió:

> Hola Germàn,
>
> thanks for the hint. While it is perfectly working on QGIS 3.10
> installed from repository. QGIS is crashing with the same data and the
> same script in QGIS master (compiled yesterday). Are there any API
> problems?
>
> Cheers and thanks!
>
> Matteo
>

-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres 

https://twitter.com/GeoTux2 

Grupo de Usuarios QGIS Colombia 

https://twitter.com/qgiscolombia
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-17 Thread matteo
Hola Germàn,

thanks for the hint. While it is perfectly working on QGIS 3.10
installed from repository. QGIS is crashing with the same data and the
same script in QGIS master (compiled yesterday). Are there any API problems?

Cheers and thanks!

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-14 Thread Germán Carrillo
Hi Matteo,

yes, it's possible to write custom Processing scripts for editing layers
in-place.

Here you can find an example (buffer):
https://github.com/gacarrillor/QGIS-Resources/blob/master/collections/processing_scripts/processing/processing_script_edit_in_place.py

>From the example we can see:

   - We need to set the QgsProcessingAlgorithm.FlagSupportsInPlaceEdits
   flag for our algorithm.
   - It's not required that our algorithm inherits from
   QgsProcessingFeatureBasedAlgorithm for it to support edit-in-place[*].
   - The supportInPlaceEdit() method allows us to specify for which layers
   our algorithm can be offered as edit-in-place.

Regards,

Germán

[*] As a demo, the buffer example is OK. However, since each feature
generates a new feature without needing other source features, the buffer
example could also be written as a QgsProcessingFeatureBasedAlgorithm. :)

El mar., 14 abr. 2020 a las 3:22, matteo ()
escribió:

> Hi Arnaud,
>
> I explored the QgsProcessingFeatureBasedAlgorithm but unfortunately is
> not the case of what I'm looking for. From what I understood
> QgsProcessingFeatureBasedAlgorithm is the class to use when the
> algorithm performs "feature-by-feature" operations like buffers.
>
> In my case I would like to "change" the geometry of the input layer
> (union and dissolve).
>
> Cheers and thanks for the input anyway!
>
> Matteo
> ___
> QGIS-Developer mailing list
> QGIS-Developer@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer



-- 
---
   |\__
(:>__)(
   |/
Soluciones Geoinformáticas Libres 

https://twitter.com/GeoTux2 

Grupo de Usuarios QGIS Colombia 

https://twitter.com/qgiscolombia
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-14 Thread matteo
Hi Arnaud,

I explored the QgsProcessingFeatureBasedAlgorithm but unfortunately is
not the case of what I'm looking for. From what I understood
QgsProcessingFeatureBasedAlgorithm is the class to use when the
algorithm performs "feature-by-feature" operations like buffers.

In my case I would like to "change" the geometry of the input layer
(union and dissolve).

Cheers and thanks for the input anyway!

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-09 Thread matteo
Thanks Arnaud, will try and let you know!

Cheers

Matteo
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-09 Thread Arnaud Morvan

Note that when heriting form QgsProcessingFeatureBasedAlgorithm,

you do not have to implement processAlgorithm method which is already 
implemented in QgsProcessingFeatureBasedAlgorithm


but should implement the processFeature method.

Arnaud Morvan
Ingénieur logiciel
Tél: +33 (0)4 58 48 20 32

Camptocamp France SAS
18 rue du Lac Saint André
Savoie Technolac - Bâtiment Le Dauphin
F-73370 Le Bourget du Lac
http://www.camptocamp.com

Le 09/04/2020 à 13:35, Arnaud Morvan a écrit :

Hello Matteo,

As far as I know, if your algorithm :

    does not change the table structure (geometry type, fields list 
and their types)


    is an instance of QgsProcessingFeatureBasedAlgorithm (output one 
feature for each input feature)


In brief:

    - If your algorithm output one feature for each input feature:

       => your should inherit from QgsProcessingFeatureBasedAlgorithm.

    - If your outputs features have same geometry type and same fields 
with same types:


       => you can put the flag on your algorithm as it can be used for 
in place editing.


When in place editing is checked in dialog, output features replace 
input features in source instead of being appended to an output.


Arnaud Morvan
Ingénieur logiciel
Tél: +33 (0)4 58 48 20 32

Camptocamp France SAS
18 rue du Lac Saint André
Savoie Technolac - Bâtiment Le Dauphin
F-73370 Le Bourget du Lac
http://www.camptocamp.com

Le 09/04/2020 à 10:53, matteo a écrit :

Hi all,

is it possible to write a custom Processing script that can edit the
input layer in place (with the core functionality of course)?

In the documentation I found the method to check if the algorithm
supports the in place editing [0] but not the method to set the script
to support the functionality.

There are a few python core algorithms with

Thanks for any hint!

Cheers

Matteo


[0]
https://qgis.org/pyqgis/3.10/core/QgsProcessingAlgorithm.html#qgis.core.QgsProcessingAlgorithm.supportInPlaceEdit 


___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Re: [QGIS-Developer] EditInPlace Processing script

2020-04-09 Thread Arnaud Morvan

Hello Matteo,

As far as I know, if your algorithm :

    does not change the table structure (geometry type, fields list and 
their types)


    is an instance of QgsProcessingFeatureBasedAlgorithm (output one 
feature for each input feature)


In brief:

    - If your algorithm output one feature for each input feature:

       => your should inherit from QgsProcessingFeatureBasedAlgorithm.

    - If your outputs features have same geometry type and same fields 
with same types:


       => you can put the flag on your algorithm as it can be used for 
in place editing.


When in place editing is checked in dialog, output features replace 
input features in source instead of being appended to an output.


Arnaud Morvan
Ingénieur logiciel
Tél: +33 (0)4 58 48 20 32

Camptocamp France SAS
18 rue du Lac Saint André
Savoie Technolac - Bâtiment Le Dauphin
F-73370 Le Bourget du Lac
http://www.camptocamp.com

Le 09/04/2020 à 10:53, matteo a écrit :

Hi all,

is it possible to write a custom Processing script that can edit the
input layer in place (with the core functionality of course)?

In the documentation I found the method to check if the algorithm
supports the in place editing [0] but not the method to set the script
to support the functionality.

There are a few python core algorithms with

Thanks for any hint!

Cheers

Matteo


[0]
https://qgis.org/pyqgis/3.10/core/QgsProcessingAlgorithm.html#qgis.core.QgsProcessingAlgorithm.supportInPlaceEdit
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

[QGIS-Developer] EditInPlace Processing script

2020-04-09 Thread matteo
Hi all,

is it possible to write a custom Processing script that can edit the
input layer in place (with the core functionality of course)?

In the documentation I found the method to check if the algorithm
supports the in place editing [0] but not the method to set the script
to support the functionality.

There are a few python core algorithms with

Thanks for any hint!

Cheers

Matteo


[0]
https://qgis.org/pyqgis/3.10/core/QgsProcessingAlgorithm.html#qgis.core.QgsProcessingAlgorithm.supportInPlaceEdit
___
QGIS-Developer mailing list
QGIS-Developer@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer