4
votes
Accepted
Calculating main_angle of polygons using PyQGIS
See: PyQGIS 101: Using expressions to compute new field values
layer = iface.activeLayer()
expression1 = QgsExpression('main_angle($geometry)')
context = QgsExpressionContext()
context....
4
votes
When selecting polygons in QGIS some borders are rendered behind bordering polygons
The selection is just a style, it doesn't change the rendering order so the selected geometry may be above/below others.
You can instruct the layer to draw the selection on top of other features using ...
3
votes
Calculating main_angle of polygons using PyQGIS
Another method in addition to @BERA:
layer = iface.activeLayer()
feats = layer.getFeatures()
for f in feats:
geom = QgsGeometry(f.geometry())
output_geometry, area, angle, width, height = geom....
2
votes
Accepted
Where layer notes in QGIS are saved
The notes are saved in the QGIS project file (.qgz or .qgs) per layer and if you save a layer file (.qlr) for a layer with notes, the notes will also be saved to the .qlr file.
There's some ...
2
votes
Why is the "Label Properties" window greyed out for editing in QGIS?
To activate it, you have make some settings:
Go to the layers styling Dock (F7)
Click on the Data-definded overide box of the item which you want to change
Activate "Store Data in the Project&...
2
votes
Accepted
Loading S3 hosted COPC (LAZ) in QGIS 3.28.9 using Python
Change the provider from "pdal" to "copc"
With this code:
from qgis.core import *
#S3 URL
files=["https://astrogeo-ard.s3-us-west-2.amazonaws.com/moon/lro/lola/...
2
votes
Accepted
When selecting polygons in QGIS some borders are rendered behind bordering polygons
I had never noticed it did that.
You can modify the rendering behavior under the "Layer Properties" -> "Symbology" -> "Layer Rendering" -> "Control feature ...
2
votes
QGIS label callouts anchor from the edge of the symbol
There may be several ways to put the labels outside the polygons, but I will suggest one method that could be helpful:
Right the polygon boundary and select Duplicate layer.
Put the duplicate layer ...
1
vote
Labels covering point layer symbols QGIS 3.28
As far as I know label are Always drawn on top of feature symbol : feature symbol are drawn (following layer panel order then for each layer the feature rendering order if defined) then label are ...
1
vote
Accepted
Maximum width of screen in the QGIS modelbuilder
I've tested it out in the modeller pane and checked all the settings and it seems that, yes, there is functionally a limit to the (graphical) extent of your model. I've run through the source code (...
1
vote
Getting label geometry using PyQGIS 3
This will return all label geometries of the labels in current map extent:
extent = iface.mapCanvas().extent()
labelresults = iface.mapCanvas().labelingResults()
labelsinextent = labelresults....
1
vote
Is it possible to open a raster or raster dataset contained in a file geodatabase with QGIS 3.X?
The functionality to handle File GDB raster datasets was recently added to GDAL, so it would be possible to export any raster dataset to e.g. GeoTIFF with gdal_translate and put those into QGIS.
If ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
qgis-3 × 4331qgis × 1556
pyqgis × 1087
qgis-plugins × 393
pyqgis-3 × 339
qgis-processing × 305
python × 190
coordinate-system × 149
print-composer × 145
raster × 142
labeling × 138
symbology × 135
qgis-modeler × 127
polygon × 105
attribute-table × 93
layers × 81
line × 79
fields-attributes × 76
shapefile × 73
point × 71
postgis × 69
expression × 69
field-calculator × 65
installation × 62
pyqt5 × 62