Questions tagged [qml]

an XML file used to define a QGIS layer style.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

Use exported WMS layer style (.qml or .sld) to style a vector layer in QGIS

I'm reaching out for assistance with a problem I've encountered while working with QGIS. My goal is to apply the styling defined in a WMS (Web Map Service) layer's exported style file (either .sld for ...
Mabignix's user avatar
2 votes
0 answers
30 views

Apply "META" Map styles in QGIS

I often work with the same layers but have to use different styles on them. Is there a way to swap the styles of more layers at once. Like for example: I have three layers (roads, building, vegetation)...
ecoMAP's user avatar
  • 74
1 vote
0 answers
53 views

QGIS export layer relations from one project to another

I have a .qgz project with a spatial layer and two non-spatial layers, primarily created for data collection. All the three layers are saved in a single .gpkg file and the non-spatial layers are ...
Abhijith's user avatar
0 votes
0 answers
36 views

Error when trying to convert lyr to qml

I am trying to convert a lyr file created for ArcGIS to qml in order to use it in QGIS. I installed the SLYR Community Edition Plugin version 5.0.0 in QGIS version 3.28.8-Firenze, provided the input ...
s_hotes's user avatar
2 votes
0 answers
159 views

Automatically loading QML style file based on layer name in QGIS

I have a folder with ~100 QGIS-style files (.qml). Is it possible to tell QGIS that whenever I load a layer which has the same name as one of the .qml files apply that style instead of giving the ...
sn1ks's user avatar
  • 2,962
2 votes
1 answer
69 views

Exporting QML in QGIS Graphical Modeler

In QGIS graphical modeler, is it possible to set and export .QML extension of an output layer (adding .qml to the others extensions .shp, .shx, .dbf, ..)?
Mark's user avatar
  • 955
0 votes
0 answers
35 views

Where "layer_styles" table is listed in the schema tree

Where can I find the "layer_style" table in the schema tree? I am using pgAdmin4, I have connected to the PostgreSQL database using QGIS and added the layer(s) that I want to style. Then ...
Hasan's user avatar
  • 55
3 votes
0 answers
191 views

In QGIS 3 forms, QML button shows when photo is missing, but not when it is present

In QGS (3.28.4 LTR), I'm trying to add a QML button to a form that will open the attached photo when pressed, but have encountered the problem that the button appears when the attachment field happens ...
Avery Andrews's user avatar
3 votes
0 answers
54 views

Conditionally styling multiband raster using QGIS

I have three rasters (altitude, slope, and aspect) and I'd like to be able to merge them into one multiband raster (which I managed to do), and then style it conditionally with a QML, without having ...
Timothée Billiet's user avatar
6 votes
1 answer
193 views

PyQGIS: setting layer styles with QML file from URL

I was wondering how to import and apply a style from an URL to a layer with PyQGIS. My first thought was to do this but it didn't workout : import urllib from urllib import request vlayer = iface....
wanderzen's user avatar
  • 2,110
2 votes
1 answer
111 views

Failure to display label styles from QML style file for vector layer using PyQGIS

The following PyQGIS doesn't seem to work to load my label style (from a QML style file) for a vector layer created from WKT LINESTRINGs. The vector layer does display but not the line label styles. ...
bdelliott's user avatar
  • 455
3 votes
1 answer
108 views

Changing columns position in attributes table using PyQGIS

Well, I'm new to PyQGIS and I was creating a new shapefile and layer using some information from other layer. I inserted the data that I wanted inside attributes table and styled it, but I wanted the ...
Diogo Barros's user avatar
0 votes
1 answer
50 views

Execute Slyr Algorithm in a standalone app

I'm trying to execute the Slyr : lyr_to_qml.py script (a script written by NorthRoad) in a standalone app. I'm having trouble running it, I get an "ModuleNotFoundError: No module named 'qgis'&...
Joseph's user avatar
  • 1
1 vote
0 answers
59 views

QGIS style overwrites layer variable

I set a layer variable with QgsExpressionContextUtils.setLayerVariable(layer, name, value) and then apply a style which is using the value of this variable (a color). But when applying the style with ...
dmjf08's user avatar
  • 1,233
1 vote
1 answer
87 views

Is it possible to set the global opacity of a raster from a qml file?

I am trying to control the global opacity for raster layers when loading a qml file. I have tried exporting the qml file with the desired opacity settings and I can see this value is stored in the ...
user210681's user avatar
1 vote
0 answers
212 views

Creating QGIS project file without installing QGIS

Goal We want to automatically create QGIS projects (preferably in python), including a given set of Layers. Approaches We thought of creating a project file by defining it in a .qml file given a ...
simon_r's user avatar
  • 19
0 votes
0 answers
29 views

How to exchange QGIS legend symbology into ESRI ArcGIS? [duplicate]

Is there a possibility to import the legend symbology, which has been created in QGIS, to Esri ArcGIS? Or a possibility, to create a .lyr file from QGIS?
Julia's user avatar
  • 1
3 votes
1 answer
302 views

Can't load .qml with loadNamedStyle properly with PyQGIS

I created a categorized symbology with labels and saved it to a .qml file. When trying to load this .qml via PyQGIS nothing happens. layer.loadNamedStyle('path\to\file.qml') layer.triggerRepaint() ...
Kaizen777's user avatar
4 votes
0 answers
706 views

Importing and applying style stored in GeoPackage

I'm trying to use a GeoPackage to store a collection of styles - the idea is that each map sheet (it's a geological map) comes as a series of shapefiles, and of course each shapefile require its own ...
jfmoyen's user avatar
  • 454
1 vote
1 answer
308 views

Exporting .qml file using QGIS API with specific categories

I need to save a style file (.qml) that will only contain the "Symbology", "Labeling", "Forms" categories. With PyQGIS I can save a named style like this: lyr = iface....
Vsevolod Tsukanov's user avatar
1 vote
0 answers
77 views

Have QGIS read QML file when opening a project

Is it possible to have QML files which are read every time I open QGIS? I would like to edit these to reflect changes in the data (in my case I'd just need to change the HEX color codes), but I can't ...
Timothée Billiet's user avatar
2 votes
1 answer
465 views

PyQGIS - setting color of existing categorised symbol (from .qml) crashes QGIS

I have several layers in a project which have existing style files applied. I want to modify the symbol color attributes using python. The symbols are QgsFillSymbol objects. This seems to work fine ...
BrocSamson's user avatar
2 votes
1 answer
816 views

Setting QGIS style (QML) file via PyQGIS [duplicate]

I want to set QML style file to raster file and save as image. This code does not set the style file when I run it as standalone script. It works fine in QGIS's Python editor. There is no error in the ...
ert loo's user avatar
  • 49
0 votes
0 answers
27 views

Migrate from 2.* to 3.* value map interpreted as text edit widget

After switching to QGIS 3.* from 2.* some of my layers style forms are not working anymore. Fields that previously had value map applied to them is now showing as text edit. Is there a way of ...
geogrow's user avatar
  • 1,663
1 vote
2 answers
2k views

Transforming QML/SLD in XML with QGIS

I have a bunch of .qml and .sld files. I want to convert them to .xml, but I still haven't found a proper way to do it. Does anyone know any plugin or website that I can do this conversion?
Rodrigo Brust's user avatar
1 vote
1 answer
358 views

Exporting layer symbology using PyQGIS

I need to save the symbology of several layers and I would like to do it with a PyQGIS-3 script. I think I have to use the QgsMapLayerStyle class but I don't understand what is a QDocument and how to ...
Juliette Lapeyre's user avatar
1 vote
0 answers
46 views

Guessing which .qml goes with every layer of a project

I have a project in QGIS (v3.8) containing 25 layers with different simbology. This simbology I know it is associated to a specific .qml file that is in a folder of my user profile in QGIS. Is there ...
Noe's user avatar
  • 117
0 votes
1 answer
140 views

How to use Expressions in QML file in QGIS 3.x

I have a plugin that uses optional QML files for layer labels. If I use a standard field name for the value, it works fine, but if I use an expression, it will not display the label UNLESS I open and ...
CNIDog's user avatar
  • 479
2 votes
1 answer
676 views

Reducing raster legend classes to the ones shown in my map in QGIS

I have a landcover raster layer. I use the styles of a QML-file. Is there an option to reduce my style classes shown in the legend to only the relevant classes shown in the map? The QML has 44 classes,...
Enzo Baldini's user avatar
  • 2,297
4 votes
4 answers
2k views

Applying style change to other layers using .qml-file in QGIS

I have a similar question as @drnextgis in this post: I made a change to the symbol colour of one value out of four categorised values and aim to automatically apply it to other layers in the same ...
Aron's user avatar
  • 59
5 votes
1 answer
694 views

Downloading GitHub QML style file for use in QGIS

I am trying to download a QML-style from GitHub and add it to QGIS styles for use, this is how it looks like: How can I do this? I'd really like to use this style.
Adi's user avatar
  • 327
1 vote
0 answers
70 views

Decent satellite map for open source project?

I'm working on a cheap open source sidewalk travelling delivery robot. I built a GUI using Qt/QML which (among other things) I use to view satellite data to identify and manually mark where sidewalks ...
charlesrwest's user avatar
5 votes
2 answers
654 views

Can you edit a QGIS layer style file (.qml) to create random colors?

I have a .qml file that I am using on a project importing photos using the 'import photos' plugin. Every import batch needs to have the color manually changed after importing in order to distinguish ...
brink's user avatar
  • 820
3 votes
1 answer
410 views

Loading style from GeoPackage with PyQGIS

Reading the documentation I do not understand how the the row in layer_styles is specified (and why a table name has to be given)... layer.loadNamedStyleFromDatabase('/path/to/geopackage/','...
maxwhere's user avatar
  • 1,158
0 votes
0 answers
93 views

Where do I find QGIS QML schema?

I have a set of GeoPackages created with QGIS. They have those layer_styles in it, which contain -- among other columns -- the styleQML column providing styling information. I am reading and ...
Brandt's user avatar
  • 235
1 vote
0 answers
196 views

Adding Text and defined placement to a label in SLD (from QML(QGIS))

I've created a beautiful rule-based Labeling format in QGIS 3.12. 1) I have added text to the labels. for example using the value : 'Beton' then the word Beton is added to the line 2) I also used ...
Marianne's user avatar
0 votes
1 answer
382 views

QGIS QtQuick integration?

I would like to use QGIS with QtQuick. I can use QGIS with QtWidget with the libs that I downloaded from OSGeo4W but there is no qtquick libraries in there. In QGIS's website there is a demo with ...
barber's user avatar
  • 41
3 votes
2 answers
794 views

Write layer style .qml as predefined within a gpkg using R

I have this code to export a layer (Pbm) to a gpkg called "Atlas": writeOGR(Pbm, paste0(normalizePath(OutputFolder),'\\', "Atlas.gpkg"),"Atlas", driver="GPKG", encoding = "UTF-8", ...
César Arquero Cabral's user avatar
1 vote
1 answer
949 views

Create QML Widget with a picture in Attributes Form

I would like a Qmlwidget in the Attributes Form to show a picture. So far I have created the basic qml for a blue rectangle: import QtQuick 2.0 Rectangle { width: 100 height: 100 color: "...
LeoC's user avatar
  • 545
0 votes
1 answer
185 views

Assign layer style from qml file

I am adding a number of spatial csv files as layers and want to assign a qml layer style. import processing # User Dialog to pick Import_QGIS folder Folder_Path = QFileDialog.getExistingDirectory(...
GISme's user avatar
  • 441
4 votes
2 answers
738 views

QGIS 3.4, how to add .qml style to sink in processing

How can I import a .qml style from a file and apply it to a sink? In QGIS 2.18, I used something like that script: output=QgsVectorLayer ('Point?crs=EPSG:2154','output', 'memory') path_style='./...
LeoC's user avatar
  • 545
4 votes
1 answer
774 views

Batch convert of viewer styles from QML to SLD

Until now I was saving styles in QML files. Now I need them in SLD to be used in GeoServer. Is there a way how to perform a batch convert?
Vladimir Z.'s user avatar
2 votes
0 answers
2k views

Batch converting .lyr to .qml?

I am looking for ways to make .lyr files usable in QGIS. It appears that they can be converted into an .sld file in ArcMap but according to one of the posts, they only store symbology and do not point ...
Phil 's user avatar
  • 21
6 votes
0 answers
470 views

Old .qml style (vector-polygons) from QGIS 2.18 in QGIS 3.4

I have a .qml polygon style file created with QGIS 2.18. It works to import until Version 3.2 without problem. But in 3.4 the style is loaded, but not applied/visualized. The Polygons dissappear ...
Sebastian's user avatar
1 vote
0 answers
335 views

How to set default QML styles in QGIS?

I need to analyze multiple GPX files with QGIS. My workflow so far is as follows: Add an OSM tile layer to serve as a map background. Import the GPX file as a vector layer, select the routes and ...
user149408's user avatar
3 votes
3 answers
22k views

Importing QML styles into QGIS

I have spent the day attempting this to no avail...I am a bit of a newbie to QGIS, but please help! I am trying to import the files at the bottom of: https://www.fscbiodiversity.uk/?q=...
Dominic Sheldon's user avatar
2 votes
1 answer
293 views

Defining no data in qml style file or python for QGIS

I am attempting to script a process that I undertake quite frequently, and have got everything working apart from one little step. Essentially I want to convert a singleband raster into a 3 band ...
Bichael's user avatar
  • 93
1 vote
1 answer
296 views

Automatically apply blending mode to raster

Currently using QGIS 2.18.24, but tested this on 2.14.18 as well. I'm trying to load a QML file for a raster with a specific blending mode ('multiply'), however QGIS only applies it until I click '...
GIS_Canuck's user avatar
2 votes
2 answers
4k views

Problem with style file (.qml) loading in QGIS 3.2

I am trying to load a .qml style file to CORINE land cover maps, but the application generates an automatic color ramp. Dataset:http://geoforall.hu/sites/default/files/geodata/clc-series_hun.zip ...
pnz1337's user avatar
  • 1,555
14 votes
1 answer
938 views

Creating a 'brick wall' style for polygons

I am trying to create a brick wall style for a vector polygon in QGIS 2 and 3. I can render a svg drawing of a brick wall with SVG fill (image below). But I do not want to use SVG since the style is ...
Jakob's user avatar
  • 7,451