Hot answers tagged

4 votes
Accepted

Calling Turf.js nearest point function equivalent in QGIS using a Python script

You can use the QgsSpatialIndex class which has a nearestNeighbor() method. E.g. to iterate over a point layer, finding the nearest point and distance for each feature, you could do something like: ...
Ben W's user avatar
  • 20.6k
4 votes

OSGeo4W updating is failing - OpenCL.dll was not found

I encountered a similar issue while installing QGIS 3.34 via OSGeo4W after a fresh Windows 10 installation. After trying for hours, I was able to solve the problem by applying the following: ...
Kadir Şahbaz's user avatar
3 votes

Updating pre-3.32 HTML code in label boxes

In the composer, we now have to use the html box tool instead of the regular label box: With this type of box the code works: Thanks to @JGH for helping me unlock this mystery.
ChameleonScales's user avatar
3 votes

QGIS text size of label is zero one decimal place if contains one decimal place

I found the problem. It was due to the installed plugin “OSM Data Sync”. Because without the plugin, it keeps the text size with one decimal place I reported an issue to the developer. OSM Data Sync - ...
tscheche's user avatar
3 votes
Accepted

"Incorrect parameter value for LAYERS" error when saving CSV to GeoPackage with PyQGIS

You can make a QgsVectorLayer of your CSV URI which will be accepted by the package algorithm. A couple of things to note: The %dir suffix is missing from your CSV URI in the LAYERS property of the ...
Matt's user avatar
  • 14.9k
1 vote

Automatically populate a field on a form from a lookup table depending on what is selected in a different field on the same form in QGIS

One option is to use a Value Relation and Filter expression. With lookup data table as follows (layer named "data", lookup field is 'model', result field is 'code'): Then in the data entry ...
Tom Brennan's user avatar
  • 3,860
1 vote
Accepted

Automatically populate a field on a form from a lookup table depending on what is selected in a different field on the same form in QGIS

One way is to use a Virtual Field. With lookup data table as follows (layer named "data", lookup field is 'model', result field is 'code'): I created a virtual field ('code') in my data ...
Tom Brennan's user avatar
  • 3,860
1 vote
Accepted

How to use 'to_dm' function in model designer?

For this instance, the answer was to have the Field Name be the resulting Field, not an existing Field. I see now there is an option 'Create New Field' that I missed.
Max's user avatar
  • 31
1 vote

In QGIS 3.x for Windows, is it possible to add more files to the Project > Open Recent menu?

Yes, Settings -> Options -> Advanced -> App -> maxRecentProjects Source : https://github.com/qgis/QGIS/issues/33720
VadoDeCorsa's user avatar
1 vote

Cannot create layer because "unable to open database file" in QGIS 3.2.0?

I recently produced this exact same error when trying to create an gpkg output in a folder that doesn't exist yet. I added a routine that first creates the folder and that solved the issue. # create ...
Honeybear's user avatar
  • 2,334

Only top scored, non community-wiki answers of a minimum length are eligible