Hot answers tagged

5 votes
Accepted

Displaying milliseconds in Attribute Table using PyQGIS

The comment by @Matt was already pointing in a correct direction. QgsDateTimeFieldFormatter is indeed needed to modify the display of DateTime values. The following code example replaces the default ...
user avatar
  • 1,434
3 votes

Making automatic updated date and time field in QGIS

Create a new date or datetime field. Go to the layer properties › Attributes Form. Select your field. Activate the checkbox Apply default value on update and set the Default value to $now.
user avatar
  • 151
2 votes
Accepted

Editing a QGIS script to use field values as input parameters rather than introducing a constant value

Based on your comments you can use this modified script: from qgis.core import QgsProcessing, QgsProcessingAlgorithm, QgsProcessingMultiStepFeedback, QgsProcessingParameterFeatureSource, ...
user avatar
  • 24.7k
2 votes
Accepted

How can I activate GeoTIFF compression in QGIS 3.x gdal_translate?

Try 'OPTIONS':'COMPRESS=JPEG|JPEG_QUALITY=60' I executed the tool manually in QGIS, pressed Ctrl+Alt+H to see the command syntax:
user avatar
  • 51.3k
1 vote

PyQGIS: moving legend with changed reference point

From your screenshot, it is clear that your legend is being added to your layout, "except for being in the wrong place". You haven't shown or explained how you calculated the layout point ...
user avatar
  • 13.5k
1 vote

Adding a fixed table to layout in QGIS

Late to the party but an answer composerTitle = 'Layout 1' project = QgsProject.instance() projectLayoutManager = project.layoutManager() # Access to the layout by name layout = projectLayoutManager....
user avatar
  • 28.6k

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