Re: [Qgis-user] Compiling messages Qgis 3.18.3

2021-06-11 Thread Saulteau Don
The two patches in that diff eliminate the last srs error for 3.18.3.

On Fri, Jun 11, 2021 at 4:56 AM APM  wrote:

> Dear List,
>
> sorry, I give bad data.
>
> My compiled Qgis version is not 3.18.3, it's
>
> QGIS-Version
>
> 3.19.0-Master
>
> QGIS-Codeversion
>
> 2066fd6fb9 
>
> Kind regards
>
> Piet
>
> Am 11.06.21 um 09:24 schrieb APM:
>
> Hello Saulteau,
>
> I'm unsure, if I understand your information right.
>
> 1. Go to the issue that Andrea referenced at   > ok
>
> 2. copy the patch link with the clipboard button.
>
> I think this is the button on the right side beneath "Verified". If I
> press it   in Firefox
>
> I have "4036e3d6ae71ffefc48a22295e338f59502949bb" in the browsers
> clipboard.
>
> So I copy and paste the file directly and stored it as 'srs-fix.diff':
>
> If I use the command
>
> patch -Np1 -i /home/user/tmp/srs-fix.diff
>
> I get the message:
>
> ---
>
> user@debian:~/src/qgis/cpp/QGIS/src$ patch -Np1 -i
> /home/user/tmp/srs-fix.diff can't find file to patch at input line 5
> Perhaps you used the wrong -p or --strip option? The text leading up to
> this was: -- |diff --git
> a/src/core/proj/qgscoordinatereferencesystem.cpp
> b/src/core/proj/qgscoordinatereferencesystem.cpp |index
> 77c7081e455d..4cba529b89de 100644 |---
> a/src/core/proj/qgscoordinatereferencesystem.cpp |+++
> b/src/core/proj/qgscoordinatereferencesystem.cpp --
> File to patch:
>
> ---
>
> Kind regards
>
> Piet
>
> ~/src/qgis/cpp/QGIS/src$ patch -Np1 -i /home/user/tmp/
> 4036e3d6ae71ffefc48a22295e338f59502949bb.diff srs-fix.diff 
> user@debian:~/src/qgis/cpp/QGIS/src$
> patch -Np1 -i /home/user/tmp/srs-fix.diff can't find file to patch at input
> line 5 Perhaps you used the wrong -p or --strip option? The text leading up
> to this was: -- |diff --git
> a/src/core/proj/qgscoordinatereferencesystem.cpp
> b/src/core/proj/qgscoordinatereferencesystem.cpp |index
> 77c7081e455d..4cba529b89de 100644 |---
> a/src/core/proj/qgscoordinatereferencesystem.cpp |+++
> b/src/core/proj/qgscoordinatereferencesystem.cpp --
>
> Am 11.06.21 um 04:00 schrieb Saulteau Don:
>
> The patch resolved almost all of them! It's left a single CRS that
> couldn't be:
>
> Could not execute: INSERT INTO tbl_srs(srs_id,
> description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated)
> VALUES (63
> 321, 'Timbalai 1948 / RSO Sarawak LSD (m)','omerc','omerc','+proj=omerc
> +no_uoff +lat_0=4 +lonc=115 +alpha=53.315820472 +gamma=53.130102361
> +k=0.99984
> +x_0=200 +y_0=500 +ellps=evrstSS +towgs84=-679,669,-48,0,0,0,0
> +units=m +no_defs',520003321,'EPSG','29874',0,0) [UNIQUE constraint failed:
> tbl_srs.srs_
> id/UNIQUE constraint failed: tbl_srs.srs_id]
>
> 1 CRSs could not be updated.
>
> Tested on QGIS 3.18.3 and Arch Linux.
>
> To get the patch:
> 1.) Go to the issue that Andrea referenced at
> https://github.com/qgis/QGIS/pull/43671 and click the "commits" tab
> 2.) copy the patch link with the clipboard button and paste that into your
> browser
> 3.) add .diff to it like so,
>
> https://github.com/qgis/QGIS/commit/4036e3d6ae71ffefc48a22295e338f59502949bb.diff
>
> that's the patch file =) download it or put it in a notepad and save it.
>
> This particular patch is being applied to 'master' so it's important to
> Find & Replace the reference to the /proj/ folder.
> It's because the /proj folder doesn't exist in the 3.18.3 source package
> and the patch won't apply.
>
> Then, you can change directly into the qgis source folder after you
> extract it, apply the patch, then make, make install.
>
> cd 
> patch -Np1 -i /srs-fix.diff
>
> is an example of applying the patch with the 'patch' utility
>
> saultdon
>
> On Thu, Jun 10, 2021 at 4:42 AM APM  wrote:
>
>> Dear Andrea,
>>
>>
>> thank you for that!
>>
>>
>> To be honest, I have no idea how to deal with a patch!
>>
>>
>> Maybe you can give me a short advice?
>>
>>
>>
>> Kind regards
>>
>>
>> Piet
>>
>>
>> Am 10.06.21 um 13:35 schrieb Andrea Giudiceandrea:
>> > APM wrote
>> >> All blocks of the message contains
>> >>
>> >> "NOT NULL constraint failed:"
>> > Hi Piet,
>> > I've submitted a patch https://github.com/qgis/QGIS/pull/43671 which
>> > hopefully fixes the issue.
>> >
>> > If you want, you could try if it works for you. In case, let me know.
>> >
>> > Regards.
>> >
>> > Andrea
>> >
>> >
>> >
>> > --
>> > Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
>> > ___
>> > Qgis-user mailing list
>> > Qgis-user@lists.osgeo.org
>> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> 

[Qgis-user] Saving *raster* layer style to geopkg?

2021-06-11 Thread David Strip

  
  
Is it possible to save a r*aster* layer style to a geopackage? I
know how to do it for a vector layer, but can't find it for a
raster.
I'm using 3.16.7 LTR


  

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [QGIS-it-user] modificare stringa gdal/ogr2ogr da Processing

2021-06-11 Thread Andrea Giudiceandrea
Stefano Campus wrote
> peraltro non si può neanche fare "Processo in serie" perché non sono
> previsti
> tutti i campi, in particolari i parametri liberi, come -s_srs EPSG:32632
> -t_srs EPSG:4326 oppure -append

Ciao Stefano,
forse non ho capito bene il problema, ma a me sembra che sia possibile
inserire parametri opzionali "liberi" sia nell'esecuzione come processo
singolo, sia nell'esecuzione come processo batch, in serie.

A presto.

Andrea



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


[Qgis-user] Python paths for plugins

2021-06-11 Thread John Harrop
I’m working with 3.16.6 on a MacBook Pro (2020 M1) running Bug Sur (11.4).  I’m 
using the official QGIS for Mac distribution (not the Kyng Chaos distro).

I get the following error message on startup - but when I went through the QGIS 
package (where QGIS seems to keep its own python interpreter) I can see that 
there is a matplotlib model in there.

"Semi-Automatic Classification Plugin : Error. Check Python Matplotlib 
installation for the Semi-Automatic Classification Plugin”

Am I missing configuring something with python paths or can plugins be built 
against different Pythons and need additional modules installed?

Thanks,


John Harrop
Senior Project Geologist
CMG and CMGEU

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Unable to use Raster Calc in Modeller

2021-06-11 Thread Ujaval Gandhi
QGIS Raster Calculator syntax is hard to use, especially from the modeler
and I frequently end up with wrong results. My suggestion is to use the
GDAL Raster Calculator, which has much more friendly syntax and is easy to
configure from the modeler.
[image: Logo] 
Ujaval Gandhi
Spatial Thoughts
mobile: +91-8095684687
email: uja...@spatialthoughts.com
[image: LinkedIn icon]   [image:
Twitter icon] 



On Fri, Jun 11, 2021 at 10:45 PM Drew French  wrote:

> The native raster calculator does not seem to work in the Graphic Modeller
> when you use an  algorithm result instead of an input. This is very
> frustrating as I wanted to build a model that relies on the calculator for
> the final output. I don't have an example but it is as simple as taking an
> original DEM, running it through an algorithm to extract a category of
> values, and then subtracting those values from the original. The formula is
> good - I tested it out in the normal processing toolbox, it works great!
> But I want to take that into a model so I can batch process. Thanks for any
> thoughts
>
> --
> Drew French
> (715) 986-8088
> www.ecologicaldesign.land
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] Unable to use Raster Calc in Modeller

2021-06-11 Thread Drew French
The native raster calculator does not seem to work in the Graphic Modeller
when you use an  algorithm result instead of an input. This is very
frustrating as I wanted to build a model that relies on the calculator for
the final output. I don't have an example but it is as simple as taking an
original DEM, running it through an algorithm to extract a category of
values, and then subtracting those values from the original. The formula is
good - I tested it out in the normal processing toolbox, it works great!
But I want to take that into a model so I can batch process. Thanks for any
thoughts

-- 
Drew French
(715) 986-8088
www.ecologicaldesign.land
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [QGIS-it-user] [Gfoss] Etichettatura in QGIS

2021-06-11 Thread Jachira83
un saluto a tutti, mi accodo a questo post per chiedere se è possibile dare
colori diversi ai vari campi inseriti nell'etichetta.
in sostanza vorrei dare un colora a "field1" e un'altro a "field2".

grazie 



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


Re: [QGIS-it-user] modificare stringa gdal/ogr2ogr da Processing

2021-06-11 Thread Stefano Campus
peraltro non si può neanche fare "Processo in serie" perché non sono previsti
tutti i campi, in particolari i parametri liberi, come -s_srs EPSG:32632
-t_srs EPSG:4326 oppure -append

s.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


Re: [QGIS-it-user] modificare stringa gdal/ogr2ogr da Processing

2021-06-11 Thread Stefano Campus
sì la unica scorciatoia sembra essere lanciare n volte il modulo via
processing caricando ogni singola tavola del geopackage e lanciando il
comando, avendo l'accortezza di aggiungere il parametro -append così non
genera  un nuovo geopackage ma aggiunge il nuovo layer entro il gpkg
esistente.

peccato, un tempo si poteva editare direttamente la finestra della console

s. 



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


Re: [QGIS-it-user] modificare stringa gdal/ogr2ogr da Processing

2021-06-11 Thread Totò
Stefano Campus wrote
> che fare?
> 
> https://github.com/qgis/QGIS/issues/19619

Ho letto rapidamente la issue e sembra abbastanza chiaro che Nyall e
Alexander Bruy non sono d'accordo per modificare quell'algoritmo, anzi
sembra una cosa in più messa li solo per gli sviluppatori.

Non credo sia un bug, prende correttamente il nome del layer selezionato in
input.

Cosa fare? lo suggerisce Nyall nella stesso issue [0]:
1. un plugin,
2. altro processing

ma occorre sempre raccogliere dei fondi.

[0] https://github.com/qgis/QGIS/issues/19619#issuecomment-495837067

saluti



-
https://pigrecoinfinito.com/
--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


Re: [QGIS-it-user] modificare stringa gdal/ogr2ogr da Processing

2021-06-11 Thread Stefano Campus
non l'ho specificato, ma dovrebbe essere chiaro, che scrivendo da shell osgeo
il seguente comando, senza indicare alcunché alla fine, il geopackage in
uscita contiene tutte le tabelle presenti nel geopackage in ingresso.

ogr2ogr -f "GPKG" -s_srs EPSG:32632 -t_srs EPSG:4326 Z:/depuratore_4326.gpkg
Z:/depuratori20180831.gpkg



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


[QGIS-it-user] modificare stringa gdal/ogr2ogr da Processing

2021-06-11 Thread Stefano Campus
come avrete sicuramente notato, quando si esegue un modulo delle libreire
gdal/ogr2ogr da Processing, via via che si aggiungono opzioni si compone in
automatica la linea di comando corrispondente.
questo è molto utile per chi non ricorda le opzioni e la sintassi e così
compone la parte più corposa del comando nella finestra e poi eventualmente
la lancia dalla shell osgeo.

orbene, questa finestra contenente il comando completo non è modificabile. 
ma che fare quando il comando viene scritto "sbagliato"?

l'esempio seguente è venuto fuori oggi su Facebook: utilizzo di ogr2ogr per
cambiare il SR di tutti i layer contenuti in un geopackage.

da linea di comando la sintassi è:
ogr2ogr -s_srs EPSG:4326 -t_srs EPSG:3857 -f GPKG output.gpkg input.gpkg

ma invece creato da processing ecco che cosa succede:
ogr2ogr -f "GPKG" -s_srs EPSG:32632 -t_srs EPSG:4326 Z:/depuratore_4326.gpkg
Z:/depuratori20180831.gpkg depuratori

viene aggiunto alla fine del comando "depuratori" che è uno dei layer
contenuti nel gpkg in ingresso con il risultato che il comando ogr2ogr non
coinvolge tutte le tabelle del geopackage in ingresso ma solo la prima.
ed infatti il geopackage in uscita contiene una sola tabella.

se ne è parlato per anni (issue aperta da paolo cavallini nel 2016) ma alla
fine si è deciso di non permettere più la modifica del comando nella
finestra perché non riguarda Processing.

che fare?

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





--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-Italian-User-f5250612.html
___
QGIS-it-user mailing list
QGIS-it-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/qgis-it-user


Re: [Qgis-user] Convert symbology of qgis layer into PyQGIS code to define renderer

2021-06-11 Thread Jorge Gustavo Rocha
Olá Manuel,

First save the style (using the GUI or using PyQGIS) as a qml file.

To apply the style to another layer (use the Python console to test the
code):

1) Select the other layer you want to apply the style

2) Run the PyQGIS code:

l = iface.activeLayer()
l.loadNamedStyle('/home/manuel/awesome.qml')
l.triggerRepaint()

Good luck!

Gustavo

On 11/06/21 14:58, Manuel Campagnolo wrote:
> Olá Gustavo
>
> How do I apply the named style afterwards in PyQGIS from the style qml
> file as the example below?
>
> Thanks again
>
> Manuel
>
> http://mrcc.com/qgis.dtd' 'SYSTEM'>
>  simplifyDrawingTol="1" simplifyDrawingHints="1" simplifyAlgorithm="0"
> version="3.18.1-Zürich" readOnly="0" hasScaleBasedVisibilityFlag="0"
> minScale="1" maxScale="0" styleCategories="AllStyleCategories">
>   
>     1
>     1
>     1
>     0
>   
>    fixedDuration="0" startField="" mode="0" durationField=""
> accumulate="0" endField="" endExpression="">
>     
>   
>   
>     
>   
>    symbollevels="0" type="categorizedSymbol">
>     
>   
>   
>     
>     
>    type="fill">
>     
>   
>     
>     
>     
>   
>     
>     
>   
>      name="border_width_map_unit_scale" type="QString"/>
>     
>     
>     
>      name="offset_map_unit_scale" type="QString"/>
>
>
> [...]
>
>
> On 11/06/2021 14:41, Jorge Gustavo Rocha wrote:
>> Olá Manuel,
>>
>> There is no way to get the PyQGIS code from the style, as far as I know.
>>
>> But you can save the style (using the native QGIS format) and apply the
>> named style afterwards in PyQGIS easily. Is this alternative workflow
>> suitable for you?
>>
>> Regards,
>>
>> Gustavo
>>
>> On 11/06/21 12:56, Manuel Campagnolo wrote:
>>> Hi
>>>
>>> Do you know of a way of using the style of a ,say, vector layer in
>>> QGIS3 to create automatically the python code that would generate it,
>>> namely the QgsSymbol part in the code below.
>>>
>>> Thanks
>>>
>>>
>>> symbol1=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
>>> symbol2=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
>>> symbol3=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
>>> symbol4=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
>>> symbol5=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
>>>
>>> symbol1.setColor(QColor('black'))
>>> symbol2.setColor(QColor('gray'))
>>> symbol3.setColor(QColor('dark green'))
>>> symbol4.setColor(QColor('light green'))
>>> symbol5.setColor(QColor('orange'))
>>>
>>> cat1=QgsRendererCategory('Improdutivos', symbol1, 'Improdutivos') #
>>> category, symbol, label
>>> cat2=QgsRendererCategory('Urbano', symbol2, 'Urbano')
>>> cat3=QgsRendererCategory('Matos e Pastagens', symbol3, 'Matos e
>>> Pastagens')
>>> cat4=QgsRendererCategory('Floresta', symbol4, 'Floresta')
>>> cat5=QgsRendererCategory('Agricultura', symbol5, 'Agricultura')
>>> categories=[cat1,cat2,cat3,cat4,cat5] # list
>>>
>>> renderer = QgsCategorizedSymbolRenderer('usosolo', categories)
>>> ifn_ppsm.setRenderer(renderer)
>>>
>>> ___
>>> Qgis-user mailing list
>>> Qgis-user@lists.osgeo.org
>>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Compiling messages Qgis 3.18.3

2021-06-11 Thread Andrea Giudiceandrea
APM wrote
> So I copy and paste the file directly and stored it as 'srs-fix.diff':

Hi,
if you've download the patch file from
https://github.com/qgis/QGIS/commit/4036e3d6ae71ffefc48a22295e338f59502949bb.diff
then you need to substitute in it, using a text editor, any reference to the
file to patch from
src/core/proj/qgscoordinatereferencesystem.cpp
to
src/core/qgscoordinatereferencesystem.cpp
before applying the patch.

Anyway, I think it could be simpler to use a text editor to directly change
your src/core/qgscoordinatereferencesystem.cpp in the source directory, just
substituting

at line 2402

if ( !ellipseMatch.hasMatch() )

with

if ( ellipseMatch.hasMatch() )


and at line 2413

ellipsoid.clear();

with

ellipsoid = "":

and then save and build again and install.



Regards.

Andrea



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Convert symbology of qgis layer into PyQGIS code to define renderer

2021-06-11 Thread Tudorache, Marian
Hi,

As far as I know symbology is tight to the topology.
Here is a simple example for lines.

mlayer = qgis.utils.iface.activeLayer()
styles = {'width': '0.5', 'color': 'yellow', 'penstyle': 'solid'}
registry = qgis.core.QgsSymbolLayerV2Registry.instance()
symbol = qgis.core.QgsSymbolV2.defaultSymbol(mlayer.geometryType())
lineLayer = lineMeta.createSymbolLayer(styles)
symbol.deleteSymbolLayer(0)
symbol.appendSymbolLayer(lineLayer)
renderer = qgis.core.QgsSingleSymbolRendererV2(symbol)
mlayer.setRendererV2(renderer)
mlayer.triggerRepaint()
qgis.utils.iface.mapCanvas().refresh()

For points
styles = {'name': 'diamond', 'color': 'yellow', 'size': '2'}
pointSymbol = qgis.core.QgsMarkerSymbolV2.createSimple(styles)
mlayer.rendererV2().setSymbol(pointSymbol)
qgis.utils.iface.mapCanvas().refresh()
mlayer.triggerRepaint()

for polygons
symbol.setColor(QtGui.QColor("blue"))
registry = QgsSymbolLayerV2Registry.instance()
lineMeta = registry.symbolLayerMetadata("SimpleLine")
lineLayer = lineMeta.createSymbolLayer({'width': '0.8', 
'color': 'blue', 'offset': '0', 'penstyle': 'solid'})
symbol.appendSymbolLayer(lineLayer)
symbol.setAlpha(0.2)

renderer = QgsRuleBasedRendererV2(symbol)
vLayer.setRendererV2(renderer)
vLayer.setLayerTransparency(0)
vLayer.triggerRepaint()

This when you want to have static symbols.
QGIS also gives the capability of creating dynamic symbols
-Original Message-
From: Qgis-user  On Behalf Of Manuel 
Campagnolo
Sent: June 11, 2021 7:56 AM
To: qgis-user@lists.osgeo.org
Subject: [EXT] [Qgis-user] Convert symbology of qgis layer into PyQGIS code to 
define renderer

CAUTION: This email originated from outside of the organization. If you do not 
recognize the sender or you are not certain the content is safe, then do not 
click on any links or open any attachments.
AVERTISSEMENT : Ce courriel provient d’une source externe à l’organisation. Si 
vous ne reconnaissez pas l’expéditeur ou si vous doutez de la sécurité du 
contenu, ne cliquez sur aucun lien et n’ouvrez aucune pièce jointe.


Hi

Do you know of a way of using the style of a ,say, vector layer in QGIS3 to 
create automatically the python code that would generate it, namely the 
QgsSymbol part in the code below.

Thanks


symbol1=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol2=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol3=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol4=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol5=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())

symbol1.setColor(QColor('black'))
symbol2.setColor(QColor('gray'))
symbol3.setColor(QColor('dark green'))
symbol4.setColor(QColor('light green'))
symbol5.setColor(QColor('orange'))

cat1=QgsRendererCategory('Improdutivos', symbol1, 'Improdutivos') # category, 
symbol, label cat2=QgsRendererCategory('Urbano', symbol2, 'Urbano') 
cat3=QgsRendererCategory('Matos e Pastagens', symbol3, 'Matos e Pastagens') 
cat4=QgsRendererCategory('Floresta', symbol4, 'Floresta') 
cat5=QgsRendererCategory('Agricultura', symbol5, 'Agricultura') 
categories=[cat1,cat2,cat3,cat4,cat5] # list

renderer = QgsCategorizedSymbolRenderer('usosolo', categories)
ifn_ppsm.setRenderer(renderer)

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: 
https://urldefense.com/v3/__https://lists.osgeo.org/mailman/listinfo/qgis-user__;!!P0kg3YazkQ!Wh7k2FBqY62GCB78RuenegW_YsQXCfSx7yC8s8SDK5rZJL96TYagaJQFJKb14VXtcg$
Unsubscribe: 
https://urldefense.com/v3/__https://lists.osgeo.org/mailman/listinfo/qgis-user__;!!P0kg3YazkQ!Wh7k2FBqY62GCB78RuenegW_YsQXCfSx7yC8s8SDK5rZJL96TYagaJQFJKb14VXtcg$



This electronic message, as well as any transmitted files included in the 
electronic message, may contain privileged or confidential information and is 
intended solely for the use of the individual(s) or entity to which it is 
addressed. If you have received this electronic message in error please notify 
the sender immediately and delete the electronic message. Any unauthorized 
copying, disclosure or distribution of the electronic message is strictly 
forbidden. NAV CANADA accepts no liability for any damage caused by any virus 
and/or other malicious code transmitted by this electronic communication.

Le présent message électronique et tout fichier qui peut y être joint peuvent 
contenir des renseignements privilégiés ou confidentiels destinés à l’usage 
exclusif des personnes ou des organismes à qui ils s’adressent. Si vous avez 
reçu ce message électronique par erreur, veuillez en informer l’expéditeur 
immédiatement et supprimez le. Toute reproduction, divulgation ou distribution 
du présent message électronique est strictement interdite. NAV CANADA n’assume 
aucune responsabilité en cas de 

Re: [Qgis-user] Convert symbology of qgis layer into PyQGIS code to define renderer

2021-06-11 Thread Manuel Campagnolo

Olá Gustavo

How do I apply the named style afterwards in PyQGIS from the style qml 
file as the example below?


Thanks again

Manuel

http://mrcc.com/qgis.dtd' 'SYSTEM'>
simplifyDrawingTol="1" simplifyDrawingHints="1" simplifyAlgorithm="0" 
version="3.18.1-Zürich" readOnly="0" hasScaleBasedVisibilityFlag="0" 
minScale="1" maxScale="0" styleCategories="AllStyleCategories">

  
    1
    1
    1
    0
  
  fixedDuration="0" startField="" mode="0" durationField="" accumulate="0" 
endField="" endExpression="">

    
  
  
    
  
  symbollevels="0" type="categorizedSymbol">

    
  
  

    
    
  type="fill">

    
  
    
    
    
  
    
    
  
    name="border_width_map_unit_scale" type="QString"/>

    
    
    
    type="QString"/>



[...]


On 11/06/2021 14:41, Jorge Gustavo Rocha wrote:

Olá Manuel,

There is no way to get the PyQGIS code from the style, as far as I know.

But you can save the style (using the native QGIS format) and apply the
named style afterwards in PyQGIS easily. Is this alternative workflow
suitable for you?

Regards,

Gustavo

On 11/06/21 12:56, Manuel Campagnolo wrote:

Hi

Do you know of a way of using the style of a ,say, vector layer in
QGIS3 to create automatically the python code that would generate it,
namely the QgsSymbol part in the code below.

Thanks


symbol1=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol2=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol3=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol4=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol5=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())

symbol1.setColor(QColor('black'))
symbol2.setColor(QColor('gray'))
symbol3.setColor(QColor('dark green'))
symbol4.setColor(QColor('light green'))
symbol5.setColor(QColor('orange'))

cat1=QgsRendererCategory('Improdutivos', symbol1, 'Improdutivos') #
category, symbol, label
cat2=QgsRendererCategory('Urbano', symbol2, 'Urbano')
cat3=QgsRendererCategory('Matos e Pastagens', symbol3, 'Matos e
Pastagens')
cat4=QgsRendererCategory('Floresta', symbol4, 'Floresta')
cat5=QgsRendererCategory('Agricultura', symbol5, 'Agricultura')
categories=[cat1,cat2,cat3,cat4,cat5] # list

renderer = QgsCategorizedSymbolRenderer('usosolo', categories)
ifn_ppsm.setRenderer(renderer)

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


--
-
Manuel Campagnolo
https://www.isa.ulisboa.pt/id/mlc

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Convert symbology of qgis layer into PyQGIS code to define renderer

2021-06-11 Thread Jorge Gustavo Rocha
Olá Manuel,

There is no way to get the PyQGIS code from the style, as far as I know.

But you can save the style (using the native QGIS format) and apply the
named style afterwards in PyQGIS easily. Is this alternative workflow
suitable for you?

Regards,

Gustavo

On 11/06/21 12:56, Manuel Campagnolo wrote:
> Hi
>
> Do you know of a way of using the style of a ,say, vector layer in
> QGIS3 to create automatically the python code that would generate it,
> namely the QgsSymbol part in the code below.
>
> Thanks
>
>
> symbol1=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
> symbol2=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
> symbol3=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
> symbol4=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
> symbol5=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
>
> symbol1.setColor(QColor('black'))
> symbol2.setColor(QColor('gray'))
> symbol3.setColor(QColor('dark green'))
> symbol4.setColor(QColor('light green'))
> symbol5.setColor(QColor('orange'))
>
> cat1=QgsRendererCategory('Improdutivos', symbol1, 'Improdutivos') #
> category, symbol, label
> cat2=QgsRendererCategory('Urbano', symbol2, 'Urbano')
> cat3=QgsRendererCategory('Matos e Pastagens', symbol3, 'Matos e
> Pastagens')
> cat4=QgsRendererCategory('Floresta', symbol4, 'Floresta')
> cat5=QgsRendererCategory('Agricultura', symbol5, 'Agricultura')
> categories=[cat1,cat2,cat3,cat4,cat5] # list
>
> renderer = QgsCategorizedSymbolRenderer('usosolo', categories)
> ifn_ppsm.setRenderer(renderer)
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


[Qgis-user] Convert symbology of qgis layer into PyQGIS code to define renderer

2021-06-11 Thread Manuel Campagnolo

Hi

Do you know of a way of using the style of a ,say, vector layer in QGIS3 
to create automatically the python code that would generate it, namely 
the QgsSymbol part in the code below.


Thanks


symbol1=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol2=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol3=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol4=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())
symbol5=QgsSymbol.defaultSymbol(ifn_ppsm.geometryType())

symbol1.setColor(QColor('black'))
symbol2.setColor(QColor('gray'))
symbol3.setColor(QColor('dark green'))
symbol4.setColor(QColor('light green'))
symbol5.setColor(QColor('orange'))

cat1=QgsRendererCategory('Improdutivos', symbol1, 'Improdutivos') # 
category, symbol, label

cat2=QgsRendererCategory('Urbano', symbol2, 'Urbano')
cat3=QgsRendererCategory('Matos e Pastagens', symbol3, 'Matos e Pastagens')
cat4=QgsRendererCategory('Floresta', symbol4, 'Floresta')
cat5=QgsRendererCategory('Agricultura', symbol5, 'Agricultura')
categories=[cat1,cat2,cat3,cat4,cat5] # list

renderer = QgsCategorizedSymbolRenderer('usosolo', categories)
ifn_ppsm.setRenderer(renderer)

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Compiling messages Qgis 3.18.3

2021-06-11 Thread APM

Dear List,

sorry, I give bad data.

My compiled Qgis version is not 3.18.3, it's

QGIS-Version



3.19.0-Master



QGIS-Codeversion



2066fd6fb9 

Kind regards

Piet

Am 11.06.21 um 09:24 schrieb APM:


Hello Saulteau,

I'm unsure, if I understand your information right.

1. Go to the issue that Andrea referenced at   > ok

2. copy the patch link with the clipboard button.

I think this is the button on the right side beneath "Verified". If I 
press it   in Firefox


I have "4036e3d6ae71ffefc48a22295e338f59502949bb" in the browsers 
clipboard.


So I copy and paste the file directly and stored it as 'srs-fix.diff':

If I use the command

patch -Np1 -i /home/user/tmp/srs-fix.diff

I get the message:

---

user@debian:~/src/qgis/cpp/QGIS/src$ patch -Np1 -i 
/home/user/tmp/srs-fix.diff can't find file to patch at input line 5 
Perhaps you used the wrong -p or --strip option? The text leading up 
to this was: -- |diff --git 
a/src/core/proj/qgscoordinatereferencesystem.cpp 
b/src/core/proj/qgscoordinatereferencesystem.cpp |index 
77c7081e455d..4cba529b89de 100644 |--- 
a/src/core/proj/qgscoordinatereferencesystem.cpp |+++ 
b/src/core/proj/qgscoordinatereferencesystem.cpp 
-- File to patch:


---

Kind regards

Piet

~/src/qgis/cpp/QGIS/src$ patch -Np1 -i /home/user/tmp/ 
4036e3d6ae71ffefc48a22295e338f59502949bb.diff srs-fix.diff 
user@debian:~/src/qgis/cpp/QGIS/src$ patch -Np1 -i 
/home/user/tmp/srs-fix.diff can't find file to patch at input line 5 
Perhaps you used the wrong -p or --strip option? The text leading up 
to this was: -- |diff --git 
a/src/core/proj/qgscoordinatereferencesystem.cpp 
b/src/core/proj/qgscoordinatereferencesystem.cpp |index 
77c7081e455d..4cba529b89de 100644 |--- 
a/src/core/proj/qgscoordinatereferencesystem.cpp |+++ 
b/src/core/proj/qgscoordinatereferencesystem.cpp 
--


Am 11.06.21 um 04:00 schrieb Saulteau Don:
The patch resolved almost all of them! It's left a single CRS that 
couldn't be:


Could not execute: INSERT INTO tbl_srs(srs_id, 
description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated) 
VALUES (63
321, 'Timbalai 1948 / RSO Sarawak LSD 
(m)','omerc','omerc','+proj=omerc +no_uoff +lat_0=4 +lonc=115 
+alpha=53.315820472 +gamma=53.130102361 +k=0.99984
+x_0=200 +y_0=500 +ellps=evrstSS 
+towgs84=-679,669,-48,0,0,0,0 +units=m 
+no_defs',520003321,'EPSG','29874',0,0) [UNIQUE constraint failed: 
tbl_srs.srs_

id/UNIQUE constraint failed: tbl_srs.srs_id]

1 CRSs could not be updated.

Tested on QGIS 3.18.3 and Arch Linux.

To get the patch:
1.) Go to the issue that Andrea referenced at 
https://github.com/qgis/QGIS/pull/43671 
 and click the "commits" tab
2.) copy the patch link with the clipboard button and paste that into 
your browser

3.) add .diff to it like so,
https://github.com/qgis/QGIS/commit/4036e3d6ae71ffefc48a22295e338f59502949bb.diff 



that's the patch file =) download it or put it in a notepad and save it.

This particular patch is being applied to 'master' so it's important 
to Find & Replace the reference to the /proj/ folder.
It's because the /proj folder doesn't exist in the 3.18.3 source 
package and the patch won't apply.


Then, you can change directly into the qgis source folder after you 
extract it, apply the patch, then make, make install.


cd 
patch -Np1 -i /srs-fix.diff

is an example of applying the patch with the 'patch' utility

saultdon

On Thu, Jun 10, 2021 at 4:42 AM APM > wrote:


Dear Andrea,


thank you for that!


To be honest, I have no idea how to deal with a patch!


Maybe you can give me a short advice?



Kind regards


Piet


Am 10.06.21 um 13:35 schrieb Andrea Giudiceandrea:
> APM wrote
>> All blocks of the message contains
>>
>> "NOT NULL constraint failed:"
> Hi Piet,
> I've submitted a patch https://github.com/qgis/QGIS/pull/43671
 which
> hopefully fixes the issue.
>
> If you want, you could try if it works for you. In case, let me
know.
>
> Regards.
>
> Andrea
>
>
>
> --
> Sent from:
http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html

> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org 
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] Hide/Show form field depending on precedent field values

2021-06-11 Thread Arnaud Vandecasteele
Hi Andreas,

Thank you very much.
This was exactly what I was looking for.
As you said, It requires adding a group. This requires an extra step when
you want to control the visibility field by field.
But it works !

Byt the way, I was looking to do this for using this project with the Input
App.
Your solution works as well in Input.

Thanks again,

Arnaud


On Fri, Jun 11, 2021 at 10:09 AM Andreas Neumann 
wrote:

> Hi Arnaud,
>
> You cannot have conditional visibility on a single widget (unless you do
> it yourself with Python), but you can have conditional visibility on a
> group based on an expression that can reference the value of another field.
>
> Create a "Group" container in the drag and drop form with the "green plus"
> icon. Then click on the group, activate the "Control visibility by
> Expression" and enter your expression. The expression needs to return 1 for
> visible or 0 for not visible.
>
> Hope this helps,
>
> Andreas
>
> On 2021-06-11 07:01, Arnaud Vandecasteele wrote:
>
> Hi,
>
> When creating a form by drag and drop fields, all fields are displayed
> unless you choose the hidden widget or you remove them from the field.
>
> But how to hide or show a form field depending on whether the user has
> completed a previous field?
>
> Thanks,
>
> Arnaud
>
> --
> 
> Arnaud Vandecasteele
>
>
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>

-- 

Arnaud Vandecasteele
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Compiling messages Qgis 3.18.3

2021-06-11 Thread Richard Duivenvoorde
Thanks Andrea, for diving into this.. 

I've seen this for a long time already, but really always have thought this 
errors/warning were trivial/byproducts of installer.

I'll check better next time

Richard

On 6/11/21 8:52 AM, Andrea Giudiceandrea wrote:
> Saulteau Don wrote
>> The patch resolved almost all of them! It's left a single CRS that
>> couldn't
>> be:
>>
>> Could not execute: INSERT INTO tbl_srs(srs_id,
>> description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated)
>> VALUES (63
>> 321, 'Timbalai 1948 / RSO Sarawak LSD (m)','omerc','omerc','+proj=omerc
>> +no_uoff +lat_0=4 +lonc=115 +alpha=53.315820472
>> +gamma=53.130102361
>> +k=0.99984
>> +x_0=200 +y_0=500 +ellps=evrstSS +towgs84=-679,669,-48,0,0,0,0
>> +units=m +no_defs',520003321,'EPSG','29874',0,0) [UNIQUE constraint
>> failed:
>> tbl_srs.srs_
>> id/UNIQUE constraint failed: tbl_srs.srs_id]
> 
> Hi Saulteau,
> thank you very much for testing the patch and reporting the remaining error.
> 
> The error is related to another issue for which I've submitted now a Pull
> Request https://github.com/qgis/QGIS/pull/43694
> 
> Could you test it and check if the "Timbalai 1948 / RSO Sarawak LSD (m)",
> EPSG:29874, crs is then available in QGIS?
> 
> Regards.
> 
> Andrea
> 
> 
> 
> --
> Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> 

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Compiling messages Qgis 3.18.3

2021-06-11 Thread Andrea Giudiceandrea
Saulteau Don wrote
> The patch resolved almost all of them! It's left a single CRS that
> couldn't
> be:
> 
> Could not execute: INSERT INTO tbl_srs(srs_id,
> description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated)
> VALUES (63
> 321, 'Timbalai 1948 / RSO Sarawak LSD (m)','omerc','omerc','+proj=omerc
> +no_uoff +lat_0=4 +lonc=115 +alpha=53.315820472
> +gamma=53.130102361
> +k=0.99984
> +x_0=200 +y_0=500 +ellps=evrstSS +towgs84=-679,669,-48,0,0,0,0
> +units=m +no_defs',520003321,'EPSG','29874',0,0) [UNIQUE constraint
> failed:
> tbl_srs.srs_
> id/UNIQUE constraint failed: tbl_srs.srs_id]

Hi Saulteau,
thank you very much for testing the patch and reporting the remaining error.

The error is related to another issue for which I've submitted now a Pull
Request https://github.com/qgis/QGIS/pull/43694

Could you test it and check if the "Timbalai 1948 / RSO Sarawak LSD (m)",
EPSG:29874, crs is then available in QGIS?

Regards.

Andrea



--
Sent from: http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


Re: [Qgis-user] Compiling messages Qgis 3.18.3

2021-06-11 Thread APM

Hello Saulteau,


I'm unsure, if I understand your information right.


1. Go to the issue that Andrea referenced at   > ok


2. copy the patch link with the clipboard button.

I think this is the button on the right side beneath "Verified". If I 
press it   in Firefox


I have "4036e3d6ae71ffefc48a22295e338f59502949bb" in the browsers clipboard.


So I copy and paste the file directly and stored it as 'srs-fix.diff':


If I use the command


patch -Np1 -i /home/user/tmp/srs-fix.diff


I get the message:

---


user@debian:~/src/qgis/cpp/QGIS/src$ patch -Np1 -i 
/home/user/tmp/srs-fix.diff

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--
|diff --git a/src/core/proj/qgscoordinatereferencesystem.cpp 
b/src/core/proj/qgscoordinatereferencesystem.cpp

|index 77c7081e455d..4cba529b89de 100644
|--- a/src/core/proj/qgscoordinatereferencesystem.cpp
|+++ b/src/core/proj/qgscoordinatereferencesystem.cpp
--
File to patch:

---


Kind regards


Piet


~/src/qgis/cpp/QGIS/src$ patch -Np1 -i /home/user/tmp/
4036e3d6ae71ffefc48a22295e338f59502949bb.diff
srs-fix.diff
user@debian:~/src/qgis/cpp/QGIS/src$ patch -Np1 -i 
/home/user/tmp/srs-fix.diff

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--
|diff --git a/src/core/proj/qgscoordinatereferencesystem.cpp 
b/src/core/proj/qgscoordinatereferencesystem.cpp

|index 77c7081e455d..4cba529b89de 100644
|--- a/src/core/proj/qgscoordinatereferencesystem.cpp
|+++ b/src/core/proj/qgscoordinatereferencesystem.cpp
--



Am 11.06.21 um 04:00 schrieb Saulteau Don:
The patch resolved almost all of them! It's left a single CRS that 
couldn't be:


Could not execute: INSERT INTO tbl_srs(srs_id, 
description,projection_acronym,ellipsoid_acronym,parameters,srid,auth_name,auth_id,is_geo,deprecated) 
VALUES (63
321, 'Timbalai 1948 / RSO Sarawak LSD 
(m)','omerc','omerc','+proj=omerc +no_uoff +lat_0=4 +lonc=115 
+alpha=53.315820472 +gamma=53.130102361 +k=0.99984
+x_0=200 +y_0=500 +ellps=evrstSS +towgs84=-679,669,-48,0,0,0,0 
+units=m +no_defs',520003321,'EPSG','29874',0,0) [UNIQUE constraint 
failed: tbl_srs.srs_

id/UNIQUE constraint failed: tbl_srs.srs_id]

1 CRSs could not be updated.

Tested on QGIS 3.18.3 and Arch Linux.

To get the patch:
1.) Go to the issue that Andrea referenced at 
https://github.com/qgis/QGIS/pull/43671 
 and click the "commits" tab
2.) copy the patch link with the clipboard button and paste that into 
your browser

3.) add .diff to it like so,
https://github.com/qgis/QGIS/commit/4036e3d6ae71ffefc48a22295e338f59502949bb.diff 



that's the patch file =) download it or put it in a notepad and save it.

This particular patch is being applied to 'master' so it's important 
to Find & Replace the reference to the /proj/ folder.
It's because the /proj folder doesn't exist in the 3.18.3 source 
package and the patch won't apply.


Then, you can change directly into the qgis source folder after you 
extract it, apply the patch, then make, make install.


cd 
patch -Np1 -i /srs-fix.diff

is an example of applying the patch with the 'patch' utility

saultdon

On Thu, Jun 10, 2021 at 4:42 AM APM > wrote:


Dear Andrea,


thank you for that!


To be honest, I have no idea how to deal with a patch!


Maybe you can give me a short advice?



Kind regards


Piet


Am 10.06.21 um 13:35 schrieb Andrea Giudiceandrea:
> APM wrote
>> All blocks of the message contains
>>
>> "NOT NULL constraint failed:"
> Hi Piet,
> I've submitted a patch https://github.com/qgis/QGIS/pull/43671
 which
> hopefully fixes the issue.
>
> If you want, you could try if it works for you. In case, let me
know.
>
> Regards.
>
> Andrea
>
>
>
> --
> Sent from:
http://osgeo-org.1560.x6.nabble.com/QGIS-User-f4125267.html

> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org 
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user

   

Re: [Qgis-user] Hide/Show form field depending on precedent field values

2021-06-11 Thread Andreas Neumann

Hi Arnaud,

You cannot have conditional visibility on a single widget (unless you do 
it yourself with Python), but you can have conditional visibility on a 
group based on an expression that can reference the value of another 
field.


Create a "Group" container in the drag and drop form with the "green 
plus" icon. Then click on the group, activate the "Control visibility by 
Expression" and enter your expression. The expression needs to return 1 
for visible or 0 for not visible.


Hope this helps,

Andreas

On 2021-06-11 07:01, Arnaud Vandecasteele wrote:


Hi,

When creating a form by drag and drop fields, all fields are displayed 
unless you choose the hidden widget or you remove them from the field.


But how to hide or show a form field depending on whether the user has 
completed a previous field?


Thanks,

Arnaud

--


Arnaud Vandecasteele

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user