I am using PyQGIS to export a map layout like this
exporter = QgsLayoutExporter(layout)
settings = exporter.ImageExportSettings()
settings.dpi = 100
path = 'C:/data/test1.png'
exporter.exportToImage(path, settings)
If I save it as a tiff it is georeferenced but not when saving as a PNG.
Is there a way to export it as a georeferenced PNG, or would I need to add an extra step after the fact? E.g, using gdal translate with the exported tiff.
settings.generateWorldFile = Trueto your script to write a world file for your png or export to pdf and usesettings = exporter.PdfExportSettings()thensettings.writeGeoPdf = True– Ben W Jan 21 '22 at 05:29