Re: [Qgis-user] QGIS custom python function with zero or more args

2018-03-09 Thread Fuenfer-Koenigstein.Benjamin2
Hi Frank,

thanks for your answer! Yes looks like there is no other way but passing empty 
strings. That’s what I wanted to avoid but anyway.

Regards
Benjamin



-Ursprüngliche Nachricht-
Von: Frank Broniewski [mailto:ha...@frankbroniewski.com] 
Gesendet: Freitag, 9. März 2018 11:25
An: Fuenfer-Koenigstein.Benjamin extern IT-LN; Qgis-user@lists.osgeo.org
Betreff: AW: QGIS custom python function with zero or more args

Hi Benjamin,

I don't have a recipe for no argument, but you can pass an empty string as a 
workaround:

@qgsfunction(args="auto", group="Custom") def myfunc(value, feature, parent):
if not value:
value = "Wert"
return value

Dipl. Geogr. Frank Broniewski
Waldhölzbacher Str. 51
66679 Losheim am See
06872 509 068 4
0176 611 26 9 2 6
www.frankbroniewski.com

-Ursprüngliche Nachricht-
Von: Qgis-user  Im Auftrag von 
fuenfer-koenigstein.benjam...@swm.de
Gesendet: Freitag, 9. März 2018 09:19
An: Qgis-user@lists.osgeo.org
Betreff: [Qgis-user] QGIS custom python function with zero or more args

Hi all,

I would like to write a custom python function for QGIS 2.18 that takes zero or 
one argument. The reason is that in most cases I can use a default value in the 
function, in some cases I would like to enter the value as argument. For python 
I know that you can prefix args in functions to make them optional, e.g. def 
func(*arg). For QGIS functions this will not work because there always have to 
be the args feature and parent in last two positions. Has anyone experience 
with QGIS functions that take zero or more arguments? Thanks for any help!

Regards
Benjamin
___
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] QGIS custom python function with zero or more args

2018-03-09 Thread Fuenfer-Koenigstein.Benjamin2
Hi all,

I would like to write a custom python function for QGIS 2.18 that takes zero or 
one argument. The reason is that in most cases I can use a default value in the 
function, in some cases I would like to enter the value as argument. For python 
I know that you can prefix args in functions to make them optional, e.g. def 
func(*arg). For QGIS functions this will not work because there always have to 
be the args feature and parent in last two positions. Has anyone experience 
with QGIS functions that take zero or more arguments? Thanks for any help!

Regards
Benjamin
___
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] Geometry generator styling in DXF Export

2017-12-05 Thread Fuenfer-Koenigstein.Benjamin2
Hi all,

has anyone experience with exporting geometry generator styling into DXF. I 
think it's no alternative to use DB views, SQL or virtual layers as I use 
dynamic parameters as scale and map extend in my python function. Thanks for 
your ideas!

Regards
Benjamin

___
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] QGIS Save style

2017-11-19 Thread Fuenfer-Koenigstein.Benjamin2
You could use Notpad++ and use find/replace with wildcards, “.matches new line” 
enabled.
Replace ‘ and removing the rest is 
enough to QGIS to registrer it as a style file

Mvh. / Best regards
Casper Bertelsen

Mail: casperb...@gmail.com
Tlf.: 28 56 06 41
On 19-11-2017 20:44, Lene Fischer wrote:

Thanks for your quick reply...

This gives me a lot of work :-(





-Original Message-

From: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] On Behalf Of 
Matthias Kuhn

Sent: 19. november 2017 20:39

To: qgis-user@lists.osgeo.org

Subject: Re: [Qgis-user] QGIS Save style



Hi Lene,



that's the way it is. It's been on my wishlist to have more control over what's 
saved for a while, but didn't happen so far.



You might try to manually edit the qml file and remove some definitions, but 
not sure it works either.



Regards



Matthias





On 11/19/2017 08:36 PM, Lene Fischer wrote:

Hi

Using QGIS 2.18.14 on Windows



I´m trying to save a categorized style (only style not labels ect) If

I save as default or QML file - the labels ect are saved too.



Any ideas ?

Regards

Lene Fischer

___

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

___
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] Address element in a tuple in QGIS expression builder

2017-11-07 Thread Fuenfer-Koenigstein.Benjamin2
Hi all,

is there a way to address a certain element of a tuple with qgis expression 
builder? I would like to write a python function that returns a tuple with two 
elements. That way I can use one function for two purposes (I think of 
something like myfunction(arg1,arg2,arg3)[0], but that doesn’t work in 
expression builder). Of course it’s easy to write another python function that 
does exactly that, but for deployment I want to have as less custom functions 
as possible so a built in method would be great. Thanks for your help!

Regards
Benjamin

___
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] Color fill expression and outline color.

2017-10-09 Thread Fuenfer-Koenigstein.Benjamin2
Hi Roxo,

I can't reproduce. Of course I don't have your data source, but that shouldn't 
be the reason. I use PostGIS-Data and use a integer-field with three possible 
values (1,2 or 3) to do a rule based fill color selection similar to yours. 
I'm using QGIS 2.18.12, Polygon data from PostGIS, single symbol, simple fill, 
outline color #ff, outline with 2mm, fill color by following expression: 
CASE 
WHEN  "field1" = 1 THEN '0,0,255'
WHEN  "field2" = 2 THEN '255,255,0'
ELSE '0,255,0'
END
Works as expected, the fill color is choosen by the expression as expected and 
the outline color allways stays the same as selected in the style menu. Can't 
imagine how fill color setting influences outline color selection. Anyway, as 
I'm using expressions for color selection very often, im courious for the 
reason of the problem you encounter!

Regards
Benjamin



-Ursprüngliche Nachricht-
Von: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] Im Auftrag von 
Fernando M. Roxo da Motta
Gesendet: Montag, 9. Oktober 2017 14:58
An: qgis-user@lists.osgeo.org
Betreff: [Qgis-user] Color fill expression and outline color.



  Hi all,


  I am working with  a very simple polygon layer and used a single
symbol style with a simple color fill.   I used an expression to
determine the color to fill the area.   The expression is:

  case
 when "arremat" = 0 then   '0,180,0,50'
 when "arremat" = 1 then   '0,180,0,255'
  end

  Obs: first I used "rgba_color(0,180,0,x)" and changed to the string.
   both worked as expected.

  So far so good.   The color selection worked fine.   The problem I
am having is that the outline is not being draw, or it is being drawn with the 
selected color of the color fill.

  Is that as expected or is this an "undocumented feature"? (AKA bug)

  I solved this problem using the Rule-based styling, but decided to report 
just in case.


  Regards.



  Roxo

--
 Non luctari, ludare ---+ WYSIWYG
Fernando M. Roxo da Motta   | Editor?
Except where explicitly stated I speak on my own behalf.|  VI !!
  ( Usuário Linux registrado #39505 )   | I see text,
 Quis custodiet ipsos custodes?-+ I get text!
 
___
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] styling to cut out underlying features

2017-10-04 Thread Fuenfer-Koenigstein.Benjamin2
Hi Andreas,

thats exactly what I'm looking for or even better because I didn't think about 
symbol levels yet! Looking forward to see this QEP getting realized some day!

Regards
Benjamin


Von: Qgis-user [mailto:qgis-user-boun...@lists.osgeo.org] Im Auftrag von 
Andreas Neumann
Gesendet: Mittwoch, 4. Oktober 2017 10:34
An: qgis-user@lists.osgeo.org
Betreff: Re: [Qgis-user] styling to cut out underlying features


Hi Benjamin,

Just to see if I correctly understand you.

Something along the lines of the selective masking proposal at 
https://github.com/qgis/QGIS-Enhancement-Proposals/issues/63 where one could 
select not only layers, but also symbol levels (symbol layers inside a layer) 
to selectively mask underlying symbol layers.

Unfortunately this isn't implemented yet. Still looking for funders - probably 
something for QGIS 3.2

Is this what you want, or something else?

Greetings,
Andreas

On 04.10.2017 10:18, 
fuenfer-koenigstein.benjam...@swm.de
 wrote:
Hi all,

I am looking for a way to style a point feature layer in a way that underlying 
features are cut out by the point symbols so a raster layer at the bottom of 
the layer tree is visible. In other words, the point symbol should make 
underlying vector features transparent. Physically editing the underlying 
features is not practicable as I'm working with read only data sources. I'm 
happy to hear your ideas!

Mit freundlichen Grüßen

Benjamin Fünfer-Königstein
S-IP-AN-TG Techn. Geschäftsfelder
Mobil: +49 (0)176 96 58 13 23





___

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] styling to cut out underlying features

2017-10-04 Thread Fuenfer-Koenigstein.Benjamin2
Hi all,

I am looking for a way to style a point feature layer in a way that underlying 
features are cut out by the point symbols so a raster layer at the bottom of 
the layer tree is visible. In other words, the point symbol should make 
underlying vector features transparent. Physically editing the underlying 
features is not practicable as I'm working with read only data sources. I'm 
happy to hear your ideas!

Mit freundlichen Grüßen

Benjamin Fünfer-Königstein
S-IP-AN-TG Techn. Geschäftsfelder
Mobil: +49 (0)176 96 58 13 23

___
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] Test

2017-08-30 Thread Fuenfer-Koenigstein.Benjamin2
Hi all,

can anyone confirm if my mails to the list are received? Usually I always got 
copies of my own posts via the list but now not anymore. The config is OK, at 
"Receive your own posts"  "yes" is checked. I receive all posts from other 
users. Still I can see my posts in the archive. I just want to find out if the 
spam filter in my company behaves strange or if there is any problem with the 
list. Thank you!

Regards
Benjamin

___
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] Use extend of label background in python

2017-08-28 Thread Fuenfer-Koenigstein.Benjamin2
Hi all,



in QGIS, there is the possibility to draw a rectangle around a label text with 
"Labels -> Background -> Shape: Rectangle; Size type: buffer". This way, the 
rectangle fits to text extend.



Does onyone know a way to use the size or the corner coordinates of this buffer 
rectangle in a python function? Would be very helpful to create leader lines 
from the object to the nearest corner of the rectangle.



Best regards



Benjamin

___
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] Use size of label background rectangle in python function

2017-08-28 Thread Fuenfer-Koenigstein.Benjamin2
Hi all,

in QGIS, there is the possibility to draw a rectangle around a label text with 
"Labels -> Background -> Shape: Rectangle; Size type: buffer". This way, the 
rectangle fits to text extend.

Does onyone know a way to use the size or the corner coordinates of this buffer 
rectangle in a python function? Would be very helpful to create leader lines 
from the object to the nearest corner of the rectangle.

Best regards

Benjamin 

___
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