New answers tagged

0 votes

Create vector layer/virtual layer with dynamic number of features in QGIS

Assuming you want each of the points to have an identical geometry, you could use a recursive CTE and generate a row (with unique id) for each layer as such: WITH seq AS (SELECT 1 AS n UNION ALL ...
  • 7,574
0 votes

Vector Bender in QGIS 3.10 not aligning

Make sure that Vector Bender Layer is on the same Coordinate System as the layers on your project. When creating a "Pair Layer" using the plugin interface - the Coordinate System of this new ...
  • 1
0 votes

I am importing layers from a DWG file into QGIS, and they are visible in the "Layers" panel, but they are not visible in the layout

A lot depends on how the original dwg was set up. Sometimes features that appear to be in a specific layer in CAD will end up on another layer because the block itself is on that other layer. ...
  • 7,574
0 votes

Configuring QGIS new OAuth2 support for WMS or WFS

The OGC specifications for WMS and WFS do not allow OAuth 2 authentication. In an environment where ArcGIS Server is federated with Portal for ArcGIS, secure WMS or WFS services require authentication ...
1 vote

Getting geometry from attribute using PyQGIS

This format is known as EWKT (Extended Well-Known text, see https://postgis.net/docs/ST_GeomFromEWKT.html) and currently not supported in QGIS except for certain PostGIS contexts. You can see their ...
  • 8,838
0 votes

Extracting values from bands in raster where one band has two values using QGIS

Create a grid with the same CRS, extent and pixel size as the raster layer. Use Field calculator to generate two new fields, one for each band. The expression to use is raster_value ('raster_layer', ...
  • 45.1k
0 votes

How do I stop the identify results popup window in QGIS 3

Enlarge the identify window by dragging down its bottom edge until you see the X in the red box on the top upper right of the enlarged window. Click on the X to dismiss the window.
1 vote
Accepted

Using SAGA Proessing in PyQgis Standanlone Script with batch file calling. "NameError: name 'processing' is not defined"

You need a few modifications to your Intersection.py file to import and initialize processing and also to initialize the qgis application for running a standalone script. This is based on answers to ...
  • 15.8k
0 votes

QGIS label formula

You should use if(field = 0,'N/A',coalesce(field, 'N/A')) or better replace the NULL values in your datasource, or create a view with ‚N/A instead of NULL.
  • 3,803
3 votes

QGIS label formula

For your case is better to use the format function, and you can create an array with all the fields value to replace them when "NULL" or "0" with "N/A". with_variable( ...
  • 1,796
3 votes

Clipping raster based on polygonised point marker using QGIS

Use these QGIS tools to generate a polygon geometry (square) for each individual point: Buffer Minimum bounding geometry An additional tool can be used to create a separate vector file for each ...
  • 5,742
2 votes

Clipping raster based on polygonised point marker using QGIS

Buffer each point by half the length of the side of your marker box (in my case the box is 20 by 20 m, hence I buffered with 10). Choose the square end cap style, and miter for your join style. This ...
  • 13.4k
1 vote

Adjusting text style in multiline label in QGIS

In 3.16 this is not possible with a single label but in the following QGIS 3.28 (will be released October 2022) this will be implemented. See more at blog post by North Road . You might use a ...
  • 1,533
0 votes

QGIS - QGIS2WEB - Leaflet - CSS Code - Changing background colors [15.09.22]

As far as the measurement tool is concerned, I don't think it's a color change problem but the button is seen in firefox but not seen in chrome. This is a problem known to the maintainer of the ...
0 votes

I can't install any plugins on QGIS

For Linux the following helped: install qgis-server python-qgis qgis # Debian-based, as e.g. Ubuntu if [ -f "/etc/debian_version" ]; then sudo apt install qgis-server python-qgis ...
1 vote

Adjusting text style in multiline label in QGIS

HTML Styling in labels is currently limited to colors, but you can work around that by using John's dynamic SVG solutions (see here and here), or by exporting to SVG (keep text as text objects) and ...
2 votes
Accepted

Loading Shapefiles with addMapLayer() in PyQGIS does not display them until restart of QGIS

The QgisInterface.addVectorLayer() method, as well as returning a QgsVectorLayer object, also adds the layer to the project. So you are doing this twice using two different methods. I suggest changing:...
  • 15.8k
0 votes

QGIS - Very slow map rendering and WMS timeout

If you have complicated legends, especially ones that are filtered using the 'Only show items inside linked map', this can severely impact the rendering speed. When making changes to the map, it would ...
0 votes

Re-docking/pining panel in layout window in QGIS?

Workaround in the QGIS console (will force-dock all panels): for w in iface.mainWindow().findChildren(QDockWidget): w.setFloating(False)
4 votes
Accepted

QGIS 3.22.5: how to start the tool "Transect"

Run Menu Processing > Toolbox to open the Processing Toolbox. This is the place to find all tools, algorithms etc. available in QGIS. Just type the name of the tool to filter for it. This is a very ...
  • 45.1k
7 votes

My .qgz project file is empty, how to recover?

How big is the file? If its zero bytes (or anything smaller than a few hundred) then that file doesn't contain the data any more. If it looks big enough, then, since a .QGZ file is a ZIP file with a ...
  • 54k
0 votes

Select features that do not intersect with another polygon in QGIS

As already said in comments, use Disjoint:
  • 27.3k
0 votes

Select features that do not intersect with another polygon in QGIS

For those who came across this several times and want the segment of lines outside of the polygon, Difference is the answer. !https://imgur.com/gallery/z6kXcSB [Image of QGIS Difference Map 1.Pink ...
  • 21
2 votes
Accepted

Rotating labels based on custom CRS QGIS 3

First of all, clarify that the grid convergence is not the angle of rotation of the parallel, but that of the meridian. In most cases both lines are perpendicular and the function can be used to find ...
3 votes

Rotating labels based on custom CRS QGIS 3

Curved label along a parallel See below for variant of rotated label of a point. To create a curved label along parallels for a point layer, create a parallel through each point you want to label. You ...
  • 45.1k
0 votes

Create dynamic filename, based on attribute value, for output of QGIS model

Playing around, I finally succeeded with the following syntax. The variable @Load_layer_into_project_OUTPUT is created automatically: it stores the layer that is loaded in step 2 of the model, the ...
  • 45.1k
0 votes

Add magnetic declination to print composer

As mentioned by others, there are plugins which allow this value to be calculated, or alternatively you can use an expression (and some complex logic) to retrieve the value from an api or service. ...
  • 101
7 votes
Accepted

Selecting points intersecting two different polygon extents QGIS

If I correctly understand your problem, you can use Select Features By Expression on your points layer. With your point layer selected, open the Select Features By Expression dialog: And enter the ...
  • 15.8k
5 votes
Accepted

PyQGIS autoincrement id field

Firstly, regarding the errors you are getting. Here you are storing the layer Data Provider object in the pr variable: pr = vl.dataProvider() Then in these lines: pr.dataProvider().addAttributes(...
  • 15.8k
0 votes

How to colour vector tiles based on filter in QGIS 3.16

Try editing the "Layer" attribute in the "Layer Properties" window that you're showing above. Right now, it shows "(all layers)"; try changing it (by highlighting the ...
2 votes

Remove / strip HTML tags from fields in QGIS

A way to solve this would be to create a custom function from the function editor, in order to remove the tags. For example you could create a regex ( such as the one from https://stackoverflow.com/...
  • 642

Top 50 recent answers are included