7
votes
Accepted
Adding custom panel to QGIS
Your question is quite broad but here is a short example to get you started. It will make a QgsFileWidget (a native widget for selecting directories/files) and place it in a dock widget on the right ...
6
votes
Determining on which side of line points are located using QGIS
You can also use QGIS expressions for this, using this expression to get a 0 or 1 output for each point, depending on which side of the line it is (see below for curved lines). The solution is based ...
4
votes
Problem to interface a script with python in QGIS
Add import processing to import section to get rid of NameError.
Since you use self.parameterAsSource, you get NoneType object .. error. Instead, use self.parameterAsRasterLayer.
Use the script below....
4
votes
What is QDomNode and QDomDocument in terms of PyQGIS?
After certain trials and errors, I was able to perform exporting/importing configurations of the layer's attribute table, see Saving and applying layout of columns in QGIS Attribute Table.
Despite a ...
1
vote
Setting dropdown on feature attribute form using plugin
You can set the value map on an existing field like so:
fields = layer.fields()
idx = fields.indexFromName(field_name)
field_values = ['Dewasa', 'Kanak-kanak']
# use dictionary comprehension to make ...
1
vote
Understanding the QGIS API documentation based on the featureCount() method with legendKey parameter
I use QGIS 3.28 so I don't have the legendKeys() method available. I've used legendSymbolItems() instead. And it turned out I don't need countSymbolFeatures() anyway. QGIS API docs cheated me.
As I ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
pyqgis × 7429qgis × 2832
python × 1110
qgis-3 × 1100
qgis-plugins × 1001
qgis-processing × 627
pyqgis-3 × 309
qgis-2 × 291
raster × 239
layers × 207
pyqt × 195
fields-attributes × 188
print-composer × 170
gdal × 149
shapefile × 145
python-2.7 × 142
attribute-table × 133
postgis × 123
qgis-python-console × 123
coordinate-system × 119
symbology × 119
standalone × 118
pyqt5 × 109
vector-layer × 92
features × 91