Re: [QGIS-Developer] segmentation fault in standalone script using PyQGIS

2022-11-03 Thread Mélanie Dol via QGIS-Developer

Hi Jacky,

Thank you, it's working.

Best regards,

Mélanie

On 11/2/22 4:50 PM, Jacky Volpes via QGIS-Developer wrote:

Hi,

See answers below.

Best regards.
Jacky


Le 31/10/2022 à 17:26, Mélanie Dol via QGIS-Developer a écrit :

Hi Jacky,

Thank you so much, the segmentation fault has disappeared.

However, my styles don't work. I guess my script can't access to my 
symbols pre-configured. Is there a path to add or anything else ?


You have to specify the QGIS profile directory path in which the 
symbols are saved.

For example :
qgs = QgsApplication([], False, 
'/home/jacky/.local/share/QGIS/QGIS3/profiles/default')




Another question, how to force a label placement mode to "horizontal" ?


the line "layer_settings.LabelPlacement = 4" should be changed to 
"layer_settings.placement = 4"
you can also use the enum : "layer_settings.LabelPlacement = 
QgsPalLayerSettings.Placement.Horizontal"





Many thanks and regards,

Mélanie

On 10/31/22 12:14 PM, Jacky Volpes via QGIS-Developer wrote:

Hi Mélanie,

Thanks for the script, I was able to reproduce the segmentation 
fault with a dummy gpkg I made.


After some investigations, it seems that the symbol named 
"style_layer" used in

    1. the addSymbol() method for the first layer
    2. & 3. the QgsRendererCategory() constructor for the second and 
third layer

is None (nullptr -> hence  the segfault).

If I add the following

    if style_layer is None:
        style_layer = 
QgsSymbol.defaultSymbol(Layer_Pressure_Center.geometryType())


just before using style_layer as a safe check (for each layer of 
course) everything works fine.
Maybe it's simply because I don't have these symbols pre-configured, 
but it's worth the check on your side.


Also, I encapsulated the code like this, which prevents another  
segfault to occur due to local/global scope stuff I think:


---

all imports

def main():
    the main code

if__name__ == '__main__':
    set prefix path
    create qgs application
    append plugins path to sys.path and import processing stuff
    main()
    qgs.exitQgis()

---


Regards,
Jacky



Le 28/10/2022 à 17:10, Mélanie Dol via QGIS-Developer a écrit :

Hi Jacky,

Yes of course. Please find attached my script.

Regards,

Mélanie

On 10/28/22 4:55 PM, Jacky Volpes via QGIS-Developer wrote:

Hi Mélanie,

Have you initialized your standalone script as shown in 
https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts 
?


Best regards,
Jacky


Le 28/10/2022 à 16:40, Mélanie Dol via QGIS-Developer a écrit :

Hi Andrea,

Thank you. I've updated with QGIS 3.26 Buenos Aires. The warning 
message have disappeared. Unfortunately, the script still 
generates a segmentation fault.


Best regards,

Mélanie Dol

On 10/28/22 11:47 AM, Andrea Giudiceandrea via QGIS-Developer wrote:

Il 27/10/2022 16:34, Mélanie Dol via QGIS-Developer ha scritto:
/usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py:191: 
SyntaxWarning: "is" with a literal. Did you mean "=="?

  if path is '':


Hi Mélanie,
while I don't know why that script generates a segmentation 
fault, It seems you are using QGIS 3.10 which is a three years 
old version. The QGIS repository for Ubuntu 20.04 currently 
offers the latest available QGIS LTR 3.22.12.


Best regards.

Andrea Giudiceandrea

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
QGIS-Developer mailing 

Re: [QGIS-Developer] segmentation fault in standalone script using PyQGIS

2022-11-02 Thread Jacky Volpes via QGIS-Developer

Hi,

See answers below.

Best regards.
Jacky


Le 31/10/2022 à 17:26, Mélanie Dol via QGIS-Developer a écrit :

Hi Jacky,

Thank you so much, the segmentation fault has disappeared.

However, my styles don't work. I guess my script can't access to my 
symbols pre-configured. Is there a path to add or anything else ?


You have to specify the QGIS profile directory path in which the symbols 
are saved.

For example :
qgs = QgsApplication([], False, 
'/home/jacky/.local/share/QGIS/QGIS3/profiles/default')




Another question, how to force a label placement mode to "horizontal" ?


the line "layer_settings.LabelPlacement = 4" should be changed to 
"layer_settings.placement = 4"
you can also use the enum : "layer_settings.LabelPlacement = 
QgsPalLayerSettings.Placement.Horizontal"





Many thanks and regards,

Mélanie

On 10/31/22 12:14 PM, Jacky Volpes via QGIS-Developer wrote:

Hi Mélanie,

Thanks for the script, I was able to reproduce the segmentation fault 
with a dummy gpkg I made.


After some investigations, it seems that the symbol named 
"style_layer" used in

    1. the addSymbol() method for the first layer
    2. & 3. the QgsRendererCategory() constructor for the second and 
third layer

is None (nullptr -> hence  the segfault).

If I add the following

    if style_layer is None:
        style_layer = 
QgsSymbol.defaultSymbol(Layer_Pressure_Center.geometryType())


just before using style_layer as a safe check (for each layer of 
course) everything works fine.
Maybe it's simply because I don't have these symbols pre-configured, 
but it's worth the check on your side.


Also, I encapsulated the code like this, which prevents another  
segfault to occur due to local/global scope stuff I think:


---

all imports

def main():
    the main code

if__name__ == '__main__':
    set prefix path
    create qgs application
    append plugins path to sys.path and import processing stuff
    main()
    qgs.exitQgis()

---


Regards,
Jacky



Le 28/10/2022 à 17:10, Mélanie Dol via QGIS-Developer a écrit :

Hi Jacky,

Yes of course. Please find attached my script.

Regards,

Mélanie

On 10/28/22 4:55 PM, Jacky Volpes via QGIS-Developer wrote:

Hi Mélanie,

Have you initialized your standalone script as shown in 
https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts 
?


Best regards,
Jacky


Le 28/10/2022 à 16:40, Mélanie Dol via QGIS-Developer a écrit :

Hi Andrea,

Thank you. I've updated with QGIS 3.26 Buenos Aires. The warning 
message have disappeared. Unfortunately, the script still 
generates a segmentation fault.


Best regards,

Mélanie Dol

On 10/28/22 11:47 AM, Andrea Giudiceandrea via QGIS-Developer wrote:

Il 27/10/2022 16:34, Mélanie Dol via QGIS-Developer ha scritto:
/usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py:191: 
SyntaxWarning: "is" with a literal. Did you mean "=="?

  if path is '':


Hi Mélanie,
while I don't know why that script generates a segmentation 
fault, It seems you are using QGIS 3.10 which is a three years 
old version. The QGIS repository for Ubuntu 20.04 currently 
offers the latest available QGIS LTR 3.22.12.


Best regards.

Andrea Giudiceandrea

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
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


--
Jacky Volpes

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

Re: [QGIS-Developer] segmentation fault in standalone script using PyQGIS

2022-10-31 Thread Mélanie Dol via QGIS-Developer

Hi Jacky,

Thank you so much, the segmentation fault has disappeared.

However, my styles don't work. I guess my script can't access to my 
symbols pre-configured. Is there a path to add or anything else ?


Another question, how to force a label placement mode to "horizontal" ?

Many thanks and regards,

Mélanie

On 10/31/22 12:14 PM, Jacky Volpes via QGIS-Developer wrote:

Hi Mélanie,

Thanks for the script, I was able to reproduce the segmentation fault 
with a dummy gpkg I made.


After some investigations, it seems that the symbol named 
"style_layer" used in

    1. the addSymbol() method for the first layer
    2. & 3. the QgsRendererCategory() constructor for the second and 
third layer

is None (nullptr -> hence  the segfault).

If I add the following

    if style_layer is None:
        style_layer = 
QgsSymbol.defaultSymbol(Layer_Pressure_Center.geometryType())


just before using style_layer as a safe check (for each layer of 
course) everything works fine.
Maybe it's simply because I don't have these symbols pre-configured, 
but it's worth the check on your side.


Also, I encapsulated the code like this, which prevents another 
segfault to occur due to local/global scope stuff I think:


---

all imports

def main():
    the main code

if__name__ == '__main__':
    set prefix path
    create qgs application
    append plugins path to sys.path and import processing stuff
    main()
    qgs.exitQgis()

---


Regards,
Jacky



Le 28/10/2022 à 17:10, Mélanie Dol via QGIS-Developer a écrit :

Hi Jacky,

Yes of course. Please find attached my script.

Regards,

Mélanie

On 10/28/22 4:55 PM, Jacky Volpes via QGIS-Developer wrote:

Hi Mélanie,

Have you initialized your standalone script as shown in 
https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts 
?


Best regards,
Jacky


Le 28/10/2022 à 16:40, Mélanie Dol via QGIS-Developer a écrit :

Hi Andrea,

Thank you. I've updated with QGIS 3.26 Buenos Aires. The warning 
message have disappeared. Unfortunately, the script still generates 
a segmentation fault.


Best regards,

Mélanie Dol

On 10/28/22 11:47 AM, Andrea Giudiceandrea via QGIS-Developer wrote:

Il 27/10/2022 16:34, Mélanie Dol via QGIS-Developer ha scritto:
/usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py:191: 
SyntaxWarning: "is" with a literal. Did you mean "=="?

  if path is '':


Hi Mélanie,
while I don't know why that script generates a segmentation fault, 
It seems you are using QGIS 3.10 which is a three years old 
version. The QGIS repository for Ubuntu 20.04 currently offers the 
latest available QGIS LTR 3.22.12.


Best regards.

Andrea Giudiceandrea

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
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] segmentation fault in standalone script using PyQGIS

2022-10-31 Thread Jacky Volpes via QGIS-Developer

Hi Mélanie,

Thanks for the script, I was able to reproduce the segmentation fault 
with a dummy gpkg I made.


After some investigations, it seems that the symbol named "style_layer" 
used in

    1. the addSymbol() method for the first layer
    2. & 3. the QgsRendererCategory() constructor for the second and 
third layer

is None (nullptr -> hence  the segfault).

If I add the following

    if style_layer is None:
        style_layer = 
QgsSymbol.defaultSymbol(Layer_Pressure_Center.geometryType())


just before using style_layer as a safe check (for each layer of course) 
everything works fine.
Maybe it's simply because I don't have these symbols pre-configured, but 
it's worth the check on your side.


Also, I encapsulated the code like this, which prevents another segfault 
to occur due to local/global scope stuff I think:


---

all imports

def main():
    the main code

if__name__ == '__main__':
    set prefix path
    create qgs application
    append plugins path to sys.path and import processing stuff
    main()
    qgs.exitQgis()

---


Regards,
Jacky



Le 28/10/2022 à 17:10, Mélanie Dol via QGIS-Developer a écrit :

Hi Jacky,

Yes of course. Please find attached my script.

Regards,

Mélanie

On 10/28/22 4:55 PM, Jacky Volpes via QGIS-Developer wrote:

Hi Mélanie,

Have you initialized your standalone script as shown in 
https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts 
?


Best regards,
Jacky


Le 28/10/2022 à 16:40, Mélanie Dol via QGIS-Developer a écrit :

Hi Andrea,

Thank you. I've updated with QGIS 3.26 Buenos Aires. The warning 
message have disappeared. Unfortunately, the script still generates 
a segmentation fault.


Best regards,

Mélanie Dol

On 10/28/22 11:47 AM, Andrea Giudiceandrea via QGIS-Developer wrote:

Il 27/10/2022 16:34, Mélanie Dol via QGIS-Developer ha scritto:
/usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py:191: 
SyntaxWarning: "is" with a literal. Did you mean "=="?

  if path is '':


Hi Mélanie,
while I don't know why that script generates a segmentation fault, 
It seems you are using QGIS 3.10 which is a three years old 
version. The QGIS repository for Ubuntu 20.04 currently offers the 
latest available QGIS LTR 3.22.12.


Best regards.

Andrea Giudiceandrea

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia
___
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] segmentation fault in standalone script using PyQGIS

2022-10-28 Thread Mélanie Dol via QGIS-Developer

Hi Jacky,

Yes of course. Please find attached my script.

Regards,

Mélanie

On 10/28/22 4:55 PM, Jacky Volpes via QGIS-Developer wrote:

Hi Mélanie,

Have you initialized your standalone script as shown in 
https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts 
?


Best regards,
Jacky


Le 28/10/2022 à 16:40, Mélanie Dol via QGIS-Developer a écrit :

Hi Andrea,

Thank you. I've updated with QGIS 3.26 Buenos Aires. The warning 
message have disappeared. Unfortunately, the script still generates a 
segmentation fault.


Best regards,

Mélanie Dol

On 10/28/22 11:47 AM, Andrea Giudiceandrea via QGIS-Developer wrote:

Il 27/10/2022 16:34, Mélanie Dol via QGIS-Developer ha scritto:
/usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py:191: 
SyntaxWarning: "is" with a literal. Did you mean "=="?

  if path is '':


Hi Mélanie,
while I don't know why that script generates a segmentation fault, 
It seems you are using QGIS 3.10 which is a three years old version. 
The QGIS repository for Ubuntu 20.04 currently offers the latest 
available QGIS LTR 3.22.12.


Best regards.

Andrea Giudiceandrea

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia

___
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


import sys
import qgis
from qgis.core import *
from osgeo import ogr
import PyQt5.QtCore
from PyQt5.QtGui import *
from qgis.analysis import QgsNativeAlgorithms

# Supply path to qgis install location
QgsApplication.setPrefixPath("/usr", True)

# Create a reference to the QgsApplication.  Setting the
# second argument to False disables the GUI.
qgs = QgsApplication([], False)

# Load providers
qgs.initQgis()

# Append the path where processing plugin can be found
sys.path.append('/usr/share/qgis/python/plugins')
import processing
from processing.core.Processing import Processing
Processing.initialize()
#QgsApplication.processingRegistry().addProvider(QgsNativeAlgorithms())


Geopackage_Databasepath = "/home/Satoz/SATOCEAN_ANALYSIS_N20221019_F20221019.gpkg"

# __
# PRESSURE ISOBARS LAYER

print('1. Pressure Isobars Layer')

Layer_Pressure_Isobars =  QgsVectorLayer(Geopackage_Databasepath+ "|layername=SATOCEAN_PRESSURE_ISOBARS" , 'SATOCEAN_PRESSURE_ISOBARS', 'ogr')
#Layer_Pressure_Isobars =  iface.addVectorLayer(Geopackage_Databasepath+ "|layername=SATOCEAN_PRESSURE_ISOBARS" , 'SATOCEAN_PRESSURE_ISOBARS', 'ogr')

# Initialize the default symbol for this geometry type
symbol = QgsSymbol.defaultSymbol(Layer_Pressure_Isobars.geometryType())

# Get style
get_styles = QgsStyle.defaultStyle()
style_layer = get_styles.symbol('Pressure_Isobars')

# Apply Style
Layer_Pressure_Isobars.renderer().setSymbol(style_layer)
Layer_Pressure_Isobars.triggerRepaint()

# Label
layer_settings  = QgsPalLayerSettings()
text_format = QgsTextFormat()

myFont = QFont("Arial",20,QFont.Bold)
myFont.setUnderline(True)
text_format.setFont(myFont)
text_format.setSize(20)
text_format.setColor(QColor("#4c66ff"))

layer_settings.setFormat(text_format)

layer_settings.fieldName = "Pressure"
layer_settings.LabelPlacement = 4

layer_settings.enabled = True

layer_settings = QgsVectorLayerSimpleLabeling(layer_settings)
Layer_Pressure_Isobars.setLabelsEnabled(True)
Layer_Pressure_Isobars.setLabeling(layer_settings)
Layer_Pressure_Isobars.triggerRepaint()


# __
# FRONTS LAYER

print('2. Fronts Layer')

Layer_Fronts = QgsVectorLayer(Geopackage_Databasepath+ "|layername=SATOCEAN_FRONTS" , 'SATOCEAN_FRONTS', 'ogr')
#Layer_Fronts = iface.addVectorLayer(Geopackage_Databasepath+ "|layername=SATOCEAN_FRONTS" , 'SATOCEAN_FRONTS', 'ogr')

# Get unique values
I_FieldName = Layer_Fronts.fields().indexFromName('Front_Type')
Categories_Fronts = Layer_Fronts.uniqueValues(I_FieldName)

# Fill categories
categories = []
for Category in Categories_Fronts:
# Initialize the default symbol for this geometry type
symbol = QgsSymbol.defaultSymbol(Layer_Fronts.geometryType())

# Get style
get_styles = QgsStyle.defaultStyle()

if "STATIONARY" in Category:
style_layer = get_styles.symbol('Stationary_Front')
elif "TROF" in Category:
style_layer = get_styles.symbol('Trof_Front')
elif "WARM" in Category:
style_layer 

Re: [QGIS-Developer] segmentation fault in standalone script using PyQGIS

2022-10-28 Thread Jacky Volpes via QGIS-Developer

Hi Mélanie,

Have you initialized your standalone script as shown in 
https://docs.qgis.org/3.22/en/docs/pyqgis_developer_cookbook/intro.html#using-pyqgis-in-standalone-scripts 
?


Best regards,
Jacky


Le 28/10/2022 à 16:40, Mélanie Dol via QGIS-Developer a écrit :

Hi Andrea,

Thank you. I've updated with QGIS 3.26 Buenos Aires. The warning 
message have disappeared. Unfortunately, the script still generates a 
segmentation fault.


Best regards,

Mélanie Dol

On 10/28/22 11:47 AM, Andrea Giudiceandrea via QGIS-Developer wrote:

Il 27/10/2022 16:34, Mélanie Dol via QGIS-Developer ha scritto:
/usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py:191: 
SyntaxWarning: "is" with a literal. Did you mean "=="?

  if path is '':


Hi Mélanie,
while I don't know why that script generates a segmentation fault, It 
seems you are using QGIS 3.10 which is a three years old version. The 
QGIS repository for Ubuntu 20.04 currently offers the latest 
available QGIS LTR 3.22.12.


Best regards.

Andrea Giudiceandrea

___
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


--
Jacky Volpes

Ingénieur SIG - Oslandia
___
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] segmentation fault in standalone script using PyQGIS

2022-10-28 Thread Mélanie Dol via QGIS-Developer

Hi Andrea,

Thank you. I've updated with QGIS 3.26 Buenos Aires. The warning message 
have disappeared. Unfortunately, the script still generates a 
segmentation fault.


Best regards,

Mélanie Dol

On 10/28/22 11:47 AM, Andrea Giudiceandrea via QGIS-Developer wrote:

Il 27/10/2022 16:34, Mélanie Dol via QGIS-Developer ha scritto:
/usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py:191: 
SyntaxWarning: "is" with a literal. Did you mean "=="?

  if path is '':


Hi Mélanie,
while I don't know why that script generates a segmentation fault, It 
seems you are using QGIS 3.10 which is a three years old version. The 
QGIS repository for Ubuntu 20.04 currently offers the latest available 
QGIS LTR 3.22.12.


Best regards.

Andrea Giudiceandrea

___
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] segmentation fault in standalone script using PyQGIS

2022-10-28 Thread Andrea Giudiceandrea via QGIS-Developer

Il 27/10/2022 16:34, Mélanie Dol via QGIS-Developer ha scritto:
/usr/share/qgis/python/plugins/processing/algs/grass7/Grass7Utils.py:191: 
SyntaxWarning: "is" with a literal. Did you mean "=="?

  if path is '':


Hi Mélanie,
while I don't know why that script generates a segmentation fault, It 
seems you are using QGIS 3.10 which is a three years old version. The 
QGIS repository for Ubuntu 20.04 currently offers the latest available 
QGIS LTR 3.22.12.


Best regards.

Andrea Giudiceandrea___
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