New answers tagged

1 vote
Accepted

PYQGIS MapLayerComboBox filter on both layer type and field within layer

You can use the following approach which is to make use of the setExceptedLayerList() method of QgsMapLayerComboBox and pass a list of layers which will not be shown in the combo box. The basic logic ...
user avatar
  • 14.3k
1 vote

AutoFields Plugin for QGIS 3? Or best way to set up Default Values via PyQGIS?

Original Poster. Thanks @user2856 for calling out QgsDefaultValue and .setDefaultValueDefinition; I didn't know those existed. Below is what ultimately worked for me. myLayers = [layer for layer in ...
user avatar
  • 315
2 votes
Accepted

PyQGIS 3 Select features by mouse click not working

For me, the instance of selectTool is deleted at the end of the start_line_edit function. So try : def start_line_edit(self): print("button pushed") self.t = selectTool(iface, self....
user avatar
  • 12.1k
0 votes

QGIS 3.x closestSegmentWithContext returns sqrt distance 0.0 and point doesn't snap to polyline

You need to set the epsilon value of the closestSegmentWithContext function to a very low value for it to work with lat and long. The DEFAULT_SEGMENT_EPSILON is not low enough to test the values less ...
user avatar
1 vote
Accepted

Rotating point objects toward lines using QGIS

I'm not sure if this will give you more satisfactory results than what you are currently using, but I had a play around with some test data and came up with the following script which you are welcome ...
user avatar
  • 14.3k

Top 50 recent answers are included