The file bivariate_legend.py has a missing import.
Open file /Users/judithheher/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/BivariateLegend/bivariate_legend.py in any editor.
Add from qgis.core import Qgis to the import section.
Restart QGIS and retry. The plugin will run seamlessly.
There is no problem in your code or no bug with QGIS. createRenderer method is deprecated since v3.10. Therefore, there may be incompatibility between the method and later versions of QGIS. I recommend you use the constructor.
If I understood correctly, the following script would work for you. First, select the layer and use the script in QGIS Python Editor.
# get layer
layer = iface.activeLayer()
# convert features to list
features = list(layer.getFeatures())
# sort features to be sure it is sorted by id. it is crucial
features.sort(key=lambda f: f["id"])
dpr = layer....
Could be wrong but you should reinstall QGIS 3.18 with the new installer. QGIS standalone installers on Windows are all based on OSGEO4W. At the moment, 2 OSGEO4W installers and only the new one allows for point cloud support.
See announcement at https://lists.osgeo.org/pipermail/qgis-user/2021-February/048137.html
You may try the new standalone installer ...
The QGIS geometry generator symbol layer type is well suited for this, allowing you to keep one QGIS feature and display both of its geometries (or more).
For instance, suppose the (default) geometry assigned to each feature is the starting one (either since you digitized the feature in QGIS that way, or since you specified it as the geometry when importing ...
You can use QGIS for commercial use without any fees or payment see: https://qgis.org/en/site/forusers/index.html. qgisenterprise is a supportmodel for commercial support - by the way - there are a lot of support companies see: https://docs.qgis.org/3.10/en/docs/user_manual/preamble/help_and_support.html#commercial-support
You can do that using the following steps:
Use Sample raster values to extract the raster values to the point locations
Add a new field of numeric type (float, for example) name it Subtract or the name you like to store the subtracted values.
Finally, use field calculator to subtract the values retrieved in step 1 from z values of point data.
Note: Make ...
Here is a full example using changeAttributeValues():
layer = iface.activeLayer() # the layer to work with
surfacefield = 'surface' # fieldname of your lookup field
catfield = 'CAT' # fieldname of your new field
with edit(layer): # start edit mode of the layer
layer.dataProvider().addAttributes([QgsField(catfield , QVariant.String)]) # add the new field ...
This is a workaround using Reclassify by layer tool (so it is not a direct answer to your query).
(1) Prepare a classification table by a spreadsheet software ( I used MS-Excel).
(2) Drag and Drop the Excel file to the QGIS then it will appear on the TOC (Layers Panel).
(3) Start Reclassify by layer tool and select Min, Max and Output fields from the ...
The file 'world.qgs' is not a vector data source- it's a project file. If you already have QGIS open the easiest way to open a project file is to simply drag and drop it onto the canvas or layers panel either from a folder in your file system, or from the browser panel within QGIS. See the gifs below for examples:
At QGIS start from a file folder:
From an ...
Instead of using Photoshop, you can fix the problem directly on QGIS.
Hillshade rendering (or any other raster rendering) happens individual layer by layer, as each layer know nothing about their neighbours.
You can bundle the all 9 rasters in a single layer by creating a virtual raster. You have a tool to create the virtual raster in the processing toolbox.
Yes and no. It takes a bit of doing/navigating, but under 3.18 at least, you can access the ArcGIS Server REST endpoint to add the data to your local project with ease.
In other cases, you could accomplish it by loading the *.lyr files using SLYR by North Road/Nyall Dawson.
Getting the REST endpoint URL is possible by opening your linked item in the web ...
Creating a circle using QGIS 3.18 (Windows 10 Pro) with 3 points.
If I understand correctly:
You loaded the DEMs into QGIS, you were happy with the styling
You weren't happy with the artefacts, so you did some polishing in Photoshop
When loading the polished-up rasters, the styling in QGIS is different from what it was originally.
If that's the case, you should be able to apply the styling of your "old" layers ...
QGIS uses PyQt for ui, and it doesn't come with a preinstalled Tkinter python package.
I would recommend you either include the relevant package code with your plugin (if the license allows for that),
or use PyQt to build your interface.
I would recommend learning PyQt and using the included Qt Designer as instructed here in the pyqgis developer cookbook.
You should use the same logic in your else clause as you do in your first condition.
E.g. In your else clause you should add the layer to the project without adding it to the legend:
Then add it to the layer tree root:
Note that addLayer() appends the layer node to the end of a group. To ...
You will need to learn how to use field calculator. See this section of the manual to start.
Then, your field is a string (text) field from which you need to extract the relevant substrings for the x coordinate and y coordinate and convert them into numbers.
The expression substr(string,startpos,length) will let you extract length characters starting at ...
A very fast way to remove all the annotations from your project is to use a PyQGIS script in the QGIS python console.
the script is
manager = QgsProject.instance().annotationManager()
for i in manager.annotations():
This will remove all the annotations in a single action.
As I understand it, the only way to update geometry on the go (using this reshapeGeometry method at least) is to access the layer's data provider:
layer = iface.activeLayer()
provider = layer.dataProvider()
line = QgsLineString([QgsPoint(1, 1), QgsPoint(2, 2)])
for feat in layer.selectedFeatures():
geom = feat.geometry()
But we can work around the problem with a small Python Expression function:
from qgis.PyQt.QtCore import QTimer,QEventLoop
You can use the updated code for QGIS 3.x. It's not in the official repo but in a forked version. Download zip https://github.com/ChrFr/osmpoly_export/archive/master.zip and install plugin from zip
You may prefer using command line tool for Python 3 at https://github.com/smellman/ogr2poly
There is a good list of libraries and tools to import/export from POLY ...
As an alternative approach using the "Geometry Generator" via RMC > Symbology > Symbol layer type: Geometry Generator. Keep in mind that this approach depends on the capabilities of your PC.
In the working window insert the following expression
Here the ...
You can find below a sample to do sorting using the "PyQGIS way" instead of the Python way.
project = QgsProject.instance()
projectLayoutManager = project.layoutManager()
layout = projectLayoutManager.layoutByName('Your layout name')
# You need to select in the layout GUI an existing
# "QgsLayoutItemAttributeTable" (in fact, insertion
There are 2 things that I think aren't correct. First "if False:" part and second "return..". Meaning of "if False:" is that "don't run the code below this statement". So "the buffer processing algorithm" will never be executed. You should change it to "if True:" or just delete if statement. Second ...
The available QGIS Custom Widgets in Qt Designer are defined in QGIS libqgis_customwidgets.
It is easy to find out the library in use.
Go to Qt Designer → Help → About Plugins. You will see the QGIS library in use.
If you see different widgets in your Qt Designer, maybe you are using a different libqgis_customwidgets library. You could be using some ...
The CRS drop down in the Save Layer dialog just gives you a selection of recently used CRS's. After you have opened the Coordinate Reference System Selector with the Select CRS button ('globe icon') shown below...
...you will have access to all the predefined Coordinate Reference Systems via a tree view which you can expand and browse:
To quickly find a ...