Skip to main content

Questions tagged [qml]

an XML file used to define a QGIS layer style.

Filter by
Sorted by
Tagged with
0 votes
1 answer
50 views

Applying styling in bulk in QGIS

I work on many projects in QGIS where the same type of maps are created for the final reports. Each map has a particular style, and the layers always retain the same structure across projects. Each ...
Josh's user avatar
  • 333
0 votes
0 answers
18 views

QGIS: Saving a custom Python function from the Function Editor to OPKG/QML

As the title states, I'm trying to save a style to OPKG or QML. The problem is that I have used a custom Python function within the 'Function Editor' in the symbol section, which is currently not ...
Julian W.'s user avatar
0 votes
0 answers
34 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
  • 140
2 votes
0 answers
36 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)...
Stefan's user avatar
  • 74
1 vote
1 answer
137 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
  • 163
0 votes
0 answers
51 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
256 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
  • 3,022
2 votes
1 answer
99 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
  • 975
3 votes
0 answers
215 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
57 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
219 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,140
2 votes
1 answer
125 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
117 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
62 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
60 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,293
1 vote
1 answer
102 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
223 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
4 votes
1 answer
385 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
  • 113
4 votes
0 answers
899 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
362 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
81 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
544 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
906 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,693
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
391 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
52 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
146 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
745 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,347
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
750 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
72 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
716 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
440 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
102 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
  • 245
1 vote
0 answers
212 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
411 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
871 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
1k 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
  • 547
0 votes
1 answer
194 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
766 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
  • 547
4 votes
1 answer
830 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
482 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
348 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
24k 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
308 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
317 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,565