4

For me, what you want works with the expression @geometry_part_num . In the layer-styling, I set the style to be rendered by geometry-generator with the expression nodes_to_points( $geometry). As a marker, I select Font-marker and at the selection of the symbol, I select data-driven override with the expression @geometry_part_num


3

The easiest way is to simply use the @symbol_color variable in the label background expression. This ensures whatever color your symbols are, your labels are automatically updated, without having to set a seperate CASE statement for the labels:


3

Not sure if there is a simple way of doing this through the interface but we could accomplish this with a bit of Python. The code below stores the value and colour of the raster's symbology properties and rounds the value to 2 decimal places (you can change the value if you want) which it stores as the new label. Then it reapplies the updated properties So ...


2

Using atan would give better results than atan2: let rotation = -Math.atan((last[1] - first[1])/(last[0] - first[0])); You could also switch to a more recent version of OpenLayers and use the placement: 'line', option in ol.style.Text (introduced in version 4) which avoids having to set rotation


2

I think using the "Meters at scale" unit type in the size section of the label properties should let you achieve what you're after. This setting automaticaly adjust the label size as you zoom in and out. You'll have to first set the "meters at scale" unit then play with the size value till your label are the same length of your line (if you need to set ...


2

I am not sure if this is the issue, but when exporting to KML make sure to write the field name that represent the labels in the NameField as you can see below. Here is the result If you write another field name, it will be loaded automatically into GoogleEarth Here is the result


2

You have labelEdifici defined as a function but feature is never being passed to it. If you make it a constant you can set the text value in the style function where feature is passed var labelEdifici = new ol.style.Text({ textAlign: 'center', textBaseline: 'middle', font: '12px Verdana', fill: new ol.style.Fill({color: 'black'}), ...


2

This functionality is being introduced in QGIS 3.10 (and is currently available in the "nightly" beta releases)


1

You could extract the vertices of the line as point using the extract nodes tool. And the point to your project. Add a new attribute to the table with a sequence of numbers. Label those points using the sequence.


1

Here's a completely different solution that doesn't bother with the Cluster Renderer. Duplicate the layer by right-clicking on the layer name in the layer panel > duplicate. This creates a second layer that links to the same source data. We're going to define different symbology for each copy of the layer, and set up scale-based visibility so that at each ...


1

You probably have null values in one or more fields (not to be confused with a the literal string value of "Null") which are getting passed through as None, a special Python type which can't be concatenated to strings in that way. You're only currently checking for empty strings, but a more generic way to check for either would be to do simply if [field], ...


1

No, you didn't miss anything. That is not a feature supported by QGIS. You need to set the labels opacity separately in the labels menu. You can try opening a feature request, if you think this would be a useful implementation. Right now it is only possible to receive the symbols color by expression, but not its alpha channel. Maybe it is possible using ...


1

Yes, it's possible. Here's an example where the background color of the label (the name of the flower) depends on the specie (field "art"). Go to the layer's styling, choose which field to label (here "art") and background. (Alt. choose Layer Properties - Labels - Background) Set rules for the fill color: click on the button to the right and choose ...


1

In the attribute table of your polygon, you will have a field which dictates the polygon colour, another which dictates the label colour, and another which dictates the label text. I've made a quick example below. You can set the layer symbology to 'Categorized' based on your polygon colour field. And set you labels to 'Rule-based labelling'. You'll need ...


1

Yes it is possible. In the labeling tool, enable Background and in the Data defined override write the following Case When "id" in (1,5,9,15) then 'yellow' When "id" in (2,7,10,13) then 'blue' When "id" in (4,11,14,119) then 'orange' else 'white' end Change the "id" to the field name that contains the numbers for your case, and the change numbers in the ...


1

Yes, this is possible. In the Layer Properties you can set you labels. You can either set rule based labeling with a filter expression for all your categories with a defined background. Or you can add single labels and add a expression similar to this for the background color: CASE WHEN "objectid" = 1 THEN color_rgb( 0,0,0) WHEN "objectid" = 2 ...


1

You're able to make your label's background "data-defined" : In your layer's properties go to label/background/stroke color click on the drop-down menu and make the colour data-defined using the expression builder. You able to reference any of your table's attribute and make it conditionnal (if needed) using if or case statements.


Only top voted, non community-wiki answers of a minimum length are eligible