As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [qml]

an XML file used to define a QGIS layer style.

Filter by
Sorted by
Tagged with
0 votes
0 answers
18 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
124 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
50 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 ...
Tim's user avatar
  • 49
6 votes
1 answer
143 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
  • 1,992
1 vote
1 answer
68 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
  • 415
3 votes
1 answer
88 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
33 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
35 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,045
1 vote
1 answer
71 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
149 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
18 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
155 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
398 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
  • 424
1 vote
1 answer
195 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
56 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 ...
Tim's user avatar
  • 49
2 votes
1 answer
312 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
629 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,623
1 vote
2 answers
1k 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
253 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
35 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
117 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
  • 449
2 votes
1 answer
506 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,187
4 votes
4 answers
1k 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
540 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
  • 317
1 vote
0 answers
52 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
4 votes
2 answers
543 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
  • 812
3 votes
1 answer
346 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,098
0 votes
0 answers
74 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
180 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
310 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
2 votes
2 answers
608 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's user avatar
1 vote
1 answer
781 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
  • 535
0 votes
1 answer
158 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
  • 411
4 votes
2 answers
688 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
  • 535
4 votes
1 answer
684 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?
vladuna's user avatar
  • 91
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
445 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
297 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
2 votes
3 answers
18k 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
277 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
260 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
3k 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 ...
poetyi's user avatar
  • 1,509
14 votes
1 answer
818 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,421
13 votes
3 answers
2k views

QGIS Load Multiple styles on single layer at once

I have a set of qml style files saved that I apply to similar layers across multiple projects. An example would be a linetype shapefile layer with about a dozen different styles; currently I have to ...
CEL-ma's user avatar
  • 975
3 votes
1 answer
395 views

Proper assignment of QML legend to raster failed in QGIS 3.0.1

I downloaded raster data sets together with the legend qml files from the SoilGrids page (ftp://ftp.soilgrids.org/). Assignment of the qml legend (TAXOUSDA_1km/TAXN_WRB_1km) didn't work in QGIS 3, as ...
Heidi's user avatar
  • 63
2 votes
0 answers
61 views

Linked styles between .QGS projects

Is there a way to share (linked) a style form one project into other projects so that if I change the style in the "source" project, it's updated in the destination projects? QLR would be great if it ...
user2675869's user avatar
2 votes
1 answer
4k views

Opening QML file in ArcGIS Desktop?

I have been trying to open a map which I downloaded from the ESA website. There are several files in the folder including .cpd, .csv, .dsr, .qml, .tif and so on. I was trying to open the .tif image ...
Srivats Chari's user avatar
1 vote
0 answers
94 views

Order of QML entries

In my styling file I have a value map with a certain order. But whenever I load it to QGIS the order changes. For example in my styling file I defined this. <edittype widgetv2type="ValueMap" name="...
Blinxen's user avatar
  • 653
3 votes
1 answer
2k views

Load and convert .txt file to .qml for raster color map

I have a "QGIS Generated Color Map Export File" in .txt format. I'm trying to load it using QGIS 2.18 but the only file extension QGIS will accept is .qml file format. This question relates what I'm ...
mikeLdub's user avatar
  • 1,173