Hot answers tagged

3

The following approach is simple to use and avoids duplication of styling rules: QGIS allows to define custom fields: "Layer Properties" -> "Fields". The best result is achieved by defining a new field for each style using expression. For example style_colour is defined as case when "roadtype" = "path" then 'black' when "surface" in (0,1) then 'red' ...


2

A solution would be to define styling fields attached to the data set using the field calculator. EX: Field "thickness" -> classified pipe size value FIeld "style" -> Classified pipe status value And then use these values to draw with specific parameters. But this is not very intuitive and it will not print correctly the legend. OR Use the ...


2

Start by defining some basic rules using Filtering. For instance: "road"='Primary' or "road"='Secondary' Then try working with "Refine Selected Rule" > "Add categories to Rule" and in Column use an expression to concatenate two of your next attributes, like: concat("surface",' ',"segment_type") and classify the expressions and adjust the symbols ...


2

I slightly changed your code, and this is working for me: var myStyle = { fillColor: '#1c9099', color: 'white', weight: 3 }; var polygon = L.polygon( [[51.509, -0.08], [51.503, -0.06], [51.51, -0.047]]); polygon.setStyle(myStyle).addTo(map); map.on('zoomend', function () { currentZoom = map.getZoom(); if (currentZoom == 15) {...


1

I have my qml styles in a fix path (c:/pyqgis_data/Styles/). So, to load arrows_red_orange.qml (exclusively for point layers), next lines at the Python Console of QGIS work: >>>layer = iface.activeLayer() >>>if layer.geometryType() == QGis.Point: >>>...layer.loadNamedStyle('c:/pyqgis_data/Styles/arrows_red_orange.qml') >>&...


1

You can set the transparency for the raster value of 0 (Zero) to 100%. You can do that using layer properties -> transparency as you can see below: Then add values and write 0 For Red, Green and Blue colors and set the transparency to 100, which is the default. You also nee to the change the display of the RGB colors as follows: 1- Zoom to the target ...


1

Your CSS looks much too complex (you are drawing squares on top of squares) and not entirely correct either, try something like: * { mark: symbol(square); mark-size: 12px; } :mark [NAME = 'art' ]{ fill: yellow; stroke: yellow; } :mark [NAME = 'stock' ]{ fill: blue; stroke: blue; } Further examples can be found in the css cookbook.


1

Yes, this is possible. You need to have the refFunctions plugin installed and enabled by going to the menubar: Plugins > Manage and Install Plugins... Select the Rule-based style of your desired layer and use an expression like the following (note that single quotation marks for the field name): geomoverlaps( 'other_layer_name', 'any_field_name' ) ...


1

I do not think QGIS currently supports the creation of palettes for rasters as this was mentioned in the book Mastering QGIS which was published in Mar 2015: Paletted raster band rendering The paletted raster band renderer applies a single color to a single raster value. QGIS supports the loading of rasters with paletted colors stored within and the ...


1

not sure where You want to go with that, but I would rather use Singleband pseudocolor option to adjust the rasters (data) options of visibility



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