Hot answers tagged

7 votes

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 ...
Matt's user avatar
  • 14.7k
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 ...
Babel's user avatar
  • 67.2k
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....
Kadir Şahbaz's user avatar
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 ...
Taras's user avatar
  • 31.3k
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 ...
Matt's user avatar
  • 14.7k
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 ...
Maryla's user avatar
  • 148

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