You can't display your project CRS coordinates in DSM as they are in metres. You need to change the CRS of the grid to EPSG:4326 to have a grid in degrees that will allow you to use DSM.
You will then need to adjust the spacing of the grid lines as when dealing with metres you probably had then set to 1000's of metres apart while with degrees you probably ...
Something like the code below should work (I simplified, cleaned up a bit and added small features) :
def __init__(self, lyr_name: str, parent=None):
self.vertical_layout = QVBoxLayout()
self.list_widget = ...
Creating a circle using QGIS 3.18 (Windows 10 Pro) with 3 points.
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 ...
It might be an issue with the size of the raster layer. Try generating raster overviews to compress the size of the raster and reduce its resolution to speed up the rendering process. You can do this on QGIS by going to Vector > Miscellaneous > Build Overviews (Pyramids). This makes the layer show only the necessary data on the particular zoomed out ...
Three things that might cause such a slowdown:
Accessing slow-ish layers over the internet, even if they're not on top/visible. One thing to try is to turn on the Debugging/Development tools panel (right click on the top toolbar to choose what panels are on/off). Then click on the red dot to log network activity. That way you can see what network requests ...
You can easily achieve this using expressions - for the function overlay_within is available since QGIS 3.16. You can achieve it in one step, however for clarity I explain it in two steps. If you want to do it in one step, simply replace "polygon_id" in the expression of step 2 with the whole expression from step 1:
Create a new field "...
When I looked into this, I was surprised to see that there was no single tool that accomplished this task. However, using 3.18, this can be solved with two tools:
Assume that the point layer has a field "type", as described in the original post. Additionally, assume that the polygon layer has a field named "poly_code", where each ...
You may try the following to be sure you delete features after processing run really ended
from qgis.core import *
from qgis.gui import *
from qgis.utils import *
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 ...
So the reason is because there's a difference between gdal:rastercalculator and qgis:rastercalculator in terms of the keyword arguments for the input.
The documentation you referred to is for the QGIS version of this tool (https://docs.qgis.org/3.16/en/docs/user_manual/processing_algs/qgis/rasteranalysis.html#qgisrastercalculator), whilst in your code you're ...
But we can work around the problem with a small Python Expression function:
from qgis.PyQt.QtCore import QTimer,QEventLoop
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 ...
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()
This is an approach to this problem using that strategy of the 'inner central horizontal edge'. In resume:
Create buffers of the polygons.
Intersection of buffers to get overlaping zones.
Extract intersection coords to create the new medium edge.
Clip buffers with lines and assign the parcel ID.
Here are the layers to try out.
Here is the code:
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.
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....
I'm not sure. But it works right now.
I have 2 separate installations of Python (3.6 & 3.8) in a separate folder.
Those folders and the script folders are listed in the system variables (2) & (3). I noticed that the C\OSGeoW64\bin (1) folder was listed at the bottom. I now moved this path up.
After a reboot ...
You could use Flat ended buffers along with Difference to remove the unwanted areas of line, leaving the areas desired.
Buffer Green line (adjust buffer distance as required)
End cap style: Flat
Join Style: Miter
Input: Blue line
Overlay Layer: Buffer output
The python icon should be enabled automatically when a python script is saved in the location set in the processing options. I found that the only way I could repeat your issue was by removing all scripts from the location I set, leaving it empty. This removed the python icon from the processing toolbox.
To test if I could re-enable the python icon I then ...
It is because of Max. Zoom Level number. If you click edit option on XYZ tiles(which yours is ESRI-Standard), you will see this parameter. Just increase it to 18. If it isn't enough quality, you can set it to 19. But 20 or more than 20 can cause to "Image data not available" problem.
You can split the lines at points using the methods discussed here
QGIS - splitting lines at points with SAGA
QGIS - Splitting lines at points using grass
Then create a field using the formula $length to calculate the length of the lines (make sure your coordinate system is projected in metres or the value you want your measurement in).
This will add a ...
I was having the same problem and managed to figure it out using the general_log.csv and observed how MySQL Importer QGIS Plugin wasn't having the same issue. The following query is needed for you to get QGIS working with your table:
CREATE TABLE `target_schema`.`geometry_columns` (
`F_TABLE_CATALOG` varchar(256) DEFAULT NULL,
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.
Sorry, it might seem simple: but can you confirm that the plugin is check marked in the plugins manager? I just tested, if it is isn't marked (even if installed initially) the Georeferencer does not show in the settings/Raster tab.
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 ...
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.
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.
I think I have figured out that these problems both stem from how QGIS3 handles KML layers.
Ian Turton helpfully pointed out that the error is with feature 41, it's not error 41.
I discovered the layer I was editing was a KML rather than a shapefile, which I hadn't previously realized. I tried adding another KML and doing the same thing, and had the same ...
Here is the final code that resolved the problem:
# -*- coding: utf-8 -*-
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU ...
This works for me:
doc = QDomDocument()
qgsl = QgsProject.instance()
mTC = qgsl.mapThemeCollection() # and *not* mapThemesCollection()
mTs = mTC.mapThemes()
mTC.writeXml(doc) # note the variable name change
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.
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 ...
Running postinstall.bat fixed the problem on QGIS 3.16.
Close QGIS and make sure it's not running on your PC.
Navigate to the following folder: C:\Program Files\QGIS 3.16
Rename postinstall.bat.done to postinstall.bat
Right click on postinstall.bat and "Run as Administrator".
Run QGIS and you should see the icon.
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 ...
I meanwhile found a solution for my problem, terribly I have trouble getting access to my initial post and ended up having another account. Therefore no editing possible to make Trams happy.
Read status and XY-coordinates from GPS-widget with Python (QGIS 3)
expalains how to get access to the data provided by a GNSS device.
To get them automaticaly written ...
This should do it:
layer = iface.activeLayer() # layer to work with
populationfield = 'population' # name of existing population field
rankfield = 'rank' # name of new rank field
request = QgsFeatureRequest()
# setup the orderby request: ascending=True -> smallest city will have rank 1, ascending=False -> biggest city will have rank 1
orderby = ...
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 ...
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 ...