Questions tagged [qgis-3]

for questions specific to the 3.x series of QGIS.

Filter by
Sorted by
Tagged with
4
votes
1answer
52 views

QGIS: Style polygon outline as a dashed line with an inner gradient

Is it possible to create a polygon outline as a dashed line with an inner gradient (see image #1)? Currently I have a hack job that sort of works (shapeburst fill with a dashed line above in the ...
1
vote
1answer
31 views

For loop to buffer shapefile at multiple distances, add each to the layers window, style & save to geopackage; PyQGIS

Can someone help me straighten this code out. I want to create three buffers, at 100, 250 and 500m respectively and add these to the contents table. I've tried creating a for loop but not having ...
2
votes
1answer
15 views

QGIS - About Ignore Getmap/Gettile URI reported in capabilities

Some WMS are working after checking the 1st option below. Can you suggest a resource or someone with knowledge of what exactly this option changes and how it makes WMS work?
1
vote
1answer
30 views

"An error has occurred while executing python code" on QGIS startup (3.16.15)

I had installed QGIS 3.16.15 through OSGeo installation package and began receiving this error message when starting QGIS. I completely uninstalled using the OSGeo advanced installation package, and ...
4
votes
1answer
81 views

Unable to save my temporary layer

I am getting the following error while saving my temporary layer. Traceback (most recent call last): File "C:\PROGRA~1\QGIS31~1.14\apps\Python39\lib\code.py", line 90, in runcode exec(...
2
votes
0answers
34 views

Can I build a QGIS query based on the boundaries of a clipping polygon?

Several times a year I download a very large shape file which contains details of the road network of my home state. That shapefile (I'll call it the master file) is regularly updated by the provider,...
1
vote
1answer
28 views

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

I am working with QGIS and have a raster file with two bands. Band one contains two values, event types, and Band 2 contains a date where the amount of a Band one event occurring sums up. An example ...
0
votes
0answers
24 views

ERROR 1: PROJ: tmerc: Invalid latitude

Im trying to warp(reproject) a raster layer to EPSG 4647 and keep getting the Error above. It works when I'm just right-clicking on the layer and set the CRS (it moves to the right position). But in a ...
1
vote
0answers
49 views

Geometry error present only when writing shapefile to disk in QGIS

I have a complex shapefile that I am trying to use for a Difference spatial operation in QGIS (Madiera 3.4). When doing that I received an invalid geometry error. Using the QGIS Check Validity tool ...
1
vote
0answers
32 views

How to make pie charts out of categories based on rules

I am trying to make an animation with the temporal controller of the locations of animals on specific days and would like to display the proportion in each location. The data are in a text-delimited ...
3
votes
1answer
42 views

Prevent custom Processing Algorithm from returning output on error

In my script I make a copy of input layer and perform some actions on it. I can't figure out how to stop QGIS from returning the output layer on error. I've tried returning nothing, but if parameter ...
0
votes
1answer
32 views

Point geometry intersects line geometry not working in PyQGIS

I have two geometries, one is Line Other one is Point. I tried find intersects between features QgsGeometry(point).intersects(QgsGeometry(line)) I have two cases: case1: if point placed on line ...
1
vote
2answers
47 views

Adding and filtering layer with map canvas extent using PyQGIS

I'm creating a small QGIS3.16 plugin with PyQGIS. I'd want to add a vector (PostGIS) layer to QGIS, and immediately filter it with the QGIS canvas extent. I found the QgsFeatureRequest(rectangle:...
2
votes
2answers
41 views

Connecting QgsCheckableComboBox Qt Signal

I tried to connect Qt signal of QgsCheckableComboBox when checkedItemsChanged. I tried below: def showEvent(self, event): print("show event") self.loadLayersToCombox() self....
6
votes
1answer
99 views

Inconsistent behaviour of getFeature() and getFeatures() when accessing CSV table with no geometry using PyQGIS

I load the following CSV data into QGIS 3 (specs below) as a table with no geometry using default options. "V1","time","V2" -49,"2021-12-28T00:12:17.725753Z",13....
2
votes
1answer
60 views

Custom feature form with python logic unexpected behavior

I'm using QGIS 3.22 trying to go through a tutorial (3.16 training manual) and I followed the popular Nathan Woodrow's blog setting custom form with python logic where I changed the PyQt4 imports for ...
3
votes
1answer
49 views

Deformed shapes after using wedge_buffer as Symbol layer in QGIS

I'm trying to display "field of view" cones on the map, using Geometry Generator as Symbol layer: wedge_buffer($geometry, dir, specs_angle, specs_distance/200000, 0) "dir" : ...
4
votes
3answers
181 views

Skipping invalid geometries without fixing them in QGIS

In QGIS 3.16.14 I have a shapefile with multipolygons (flood risk map of the country) and another layer of points (buildings). I need to identify which of those points are inside those polygons and ...
1
vote
0answers
32 views

PyQGIS -"invalid data source" when trying to open several .shp files

I have a folder with almost 3000 subfolders, each containing several ESRI shapefiles. I tried to write a script to read each of these files, do some basic analysis on them and store new files in those ...
1
vote
0answers
46 views

PyQGIS - how to set processing to avoid bad geometry?

I am getting "feature(182) has invalid geometry" . Fixing it takes a lot of time. How do I set it to ignore bad features and keep running with Python? processing.runAndLoadResults( ...
1
vote
1answer
38 views

How to change the default compression method in QGIS raster creation tools

Tools which create new rasters in QGIS let you set the compression method, using GDAL's -co COMPRESS= method. The "High Compression" is set by default to "DEFLATE" (and PREDICTOR=2)...
4
votes
1answer
60 views

Absolute positions for Color Ramp gradient stops in heat map?

I'm using QGIS 3 and trying to create a heat map using GPS data acquired during various trips. I want the resulting heatmap to clearly show each location acquired at least once with some radius (...
4
votes
1answer
72 views

Vector layer with "GEOM_POSSIBLE_NAMES" not working when source as *file*

I have two CSV files having the below content. pnt as WKT.csv: sl,wkt 1, POINT(50.0 50.0) pnt as PNT.csv: sl,pnt 1, POINT(50.0 50.0) The difference in both the file is column name in the ...
5
votes
1answer
46 views

QGIS 3.22 UI theme > layer panel > increase line spacing?

I'm using a tablet to enter some data outdoor, and QGIS was the most efficient way to do it (Roam was not compatible with the latest version of QGIS, QField not for Windows). To make it more user ...
3
votes
1answer
40 views

QGis Value Map attributes : display description instead of value as label?

Is it possible to label features with the Description of a Value Map type field, instead of its Value ? I have a shape file layer with one of the fields defined as "Value Map" (Widget Type ...
3
votes
1answer
82 views

Applying QgsExpression to item of layout legend using PyQGIS

I am using a print composer from QGIS using python. Inside a QGIS project (.qgz, QGIS version 3.18.3), I created a print composer layout called "mylayout" and added a map and a legend. I ...
0
votes
0answers
17 views

QGIS Toolbox for Loop Routes?

I am looking for a function or toolbox which allows for generating loop routes subject to constraints. It would look something like: Attribute Description Example Network Routing network OSM extract ...
5
votes
3answers
97 views

Comparing two rasters, based on a complex set of rules

I am trying to compare two rasters, say A.tif and B.tif. Both correspond to river bed level changes under two different flow conditions. Now I want to produce a comparison raster having values based ...
1
vote
1answer
42 views

QGIS do not open my qgz~ file anymore. CRC-Error?

I have a couple of months' work on a project in QGIS 3.16.13 with Win 10. All my data is stored on a flashdrive. Since yesterday when I try to open my project I receive this error message Cannot read ...
1
vote
1answer
71 views

Assessing locations across England with at least four retail shops from four different retailers in GIS

1A: Problem I have a dataset (point data) of 500 retail shops across England distributed in a seemingly un-random fashion (some retailers may only be found in cities or in specific regions). There are ...
0
votes
1answer
17 views

SPOT 6/7 conversion to BOA/Surface Reflectance

I am quite new to GIS and even newer to SPOT as an image source. In general, all of the other sources I have used for analysis (Landsat 7 & 8, Sentinel-2) have been corrected to BOA reflectance ...
0
votes
1answer
66 views

Return QGIS processing algorithm's results after edition

I want to create a simple qgis processing algorithm, where input layer is copied, there are some basic operations done on attributes and the resulting layer is returned. However, I encounter following ...
1
vote
1answer
58 views

How to speed up PyQGIS code for finding intersection of features in the same layer

I an deleting one of the intersecting polygons from a vector layer using PyQGIS code mentioned below. It is too slow as I have many features in the layer. Is there a way to speed it up? index= ...
0
votes
1answer
34 views

AttributeError: 'NoneType' object has no attribute 'type' when importing file into Geopackage using DB Manager

Using QGIS 3.16 I have several Geopackages already, which I would like to import a file into and make a new layer. I'm using the DB Manager > Table > Import Layer/File menu item. QGIS throws a ...
2
votes
1answer
84 views

Clip geometry in PyQGIS by not using a layer as an input

I have two vector geometries, geom1 and geom2. They do not exist as individual layers, but rather are derived out of additional scripting in PyQGIS. I would like to clip geom1 with geom2. From what I ...
1
vote
0answers
48 views

How to perform intersect or overlay_within functions using Python/PyQGIS to circumvent graphical modeler limitations? [closed]

This relates to Creating field with 1/0 values depending if point sits inside polygon in QGIS for which people provided excellent answers but unfortunately highlighted a current limitation of the ...
6
votes
2answers
171 views

Creating field with 1/0 values depending if point sits inside polygon in QGIS

I have a layer with a single polygon and a layer with multiple points. Some of the points are inside the polygon. How can I create/update a field with a value of 1 (true) or 0 (false) depending if a ...
1
vote
1answer
50 views

Testing newly installed version of QGIS with custom settings

Each time when my organization updates/migrates to the latest QGIS either a regular release or a LTR, how could I ensure that it adopts all the customized adjustments&settings from the used QGIS? ...
3
votes
1answer
53 views

Understanding difference between Pythons installed together with QGIS

There is QGIS 3.20.3 installed on the Windows 10 in the C:/Program Files/. What is a core difference between all Pythons delivered together with QGIS? What is the purpose of each one and what are the ...
4
votes
0answers
43 views

Prevent PyQGIS from converting EPSG code to OGC URN

I'm trying to access the Sentinel Hub's WFS via PyQGIS. Here's my code: base_url = 'https://services.sentinel-hub.com/ogc/wfs/<my_service_endpoint>?' params = 'SRSNAME=EPSG:4326&TYPENAMES=...
1
vote
1answer
29 views

How to drop field from algorithm output in QGIS graphical modeler (drop fields does not work)

I have built a process in the graphical modeler which uses several temporary outputs. The resulting CSV is fine but it contains an unneccessary field from the HubDistance algorithm (HubName). I'd like ...
3
votes
1answer
37 views

Only list visible fields

I can list all fields with lyr = iface.activeLayer() fieldlist = [f for f in lyr.fields()] Are there any method to list only the fields which i checked in "Organize columns". Something like:...
1
vote
0answers
34 views

How to obtain output in a scratch memory layer when using processing.run() in qgis plugins

I am writing a python plugin for QGIS and I need to use an inbuilt tool "Distance to nearest hub (line to hub)" in the QGIS processing toolbox. The following line is supposed to give me the ...
0
votes
1answer
33 views

How do I add COGs from AWS S3 protocol to QGIS map canvas programmatically

I have a private bucket in S3 with COGs in it. Following the instructions here, it's actually very simple to do it manually. However, this does indeed only work manually. Trying to add a COG with the ...
0
votes
1answer
53 views

Where do I enable symbol levels?

From the help, to enable symbol levels I should tick "Enable symbol levels": but there is none in my QGIS (3.20.2-Odense): How do I enable it, I need to draw my red symbol on top of the ...
0
votes
0answers
40 views

Map of Barcelona is on the wrong place using QGIS

I have an jpg.file with a map of Barcelona and its world file. Now the problem is, if I load it into QGIS, its definitely in the wrong place on the Basemap. I tried to change the Coordinate System to ...
0
votes
1answer
36 views

Changing default DPI when opening PDF with QGIS

Every time a PDF is opened using QGIS the resolution is quite poor. I believe this is because the standard gdal pdf driver behind QGIS uses a default value of 150 dpi. (see here https://gdal.org/...
2
votes
1answer
76 views

Creating empty layers in a GeoPackage using PyQGIS

I want to create empty geopackage layers with a defined schema. This seems to just work with Fiona regardless of whether I have spatial or non-spatial layers: def create_blank_gpkg_layer( gpkg: ...
5
votes
1answer
69 views

Get QGIS 'to_date' expression function to interpret two-digit formatted year as being 21st century

I have a string, which contains a date field. eg: "19-Jan-20" I have created a new field, which I want to store the year value, as an integer. In the field calculator, I have used year(...
4
votes
1answer
45 views

Getting vector layer from layers within group using PyQGIS

It's not difficult to get a list of layers within a group in the Layers panel of a QGIS 3.x project: root = QgsProject.instance().layerTreeRoot() groupName = "GROUP_name" group = root....

1
2 3 4 5
75