From d294e647588f1aaac03d1b48faf64a9c1c4b9c61 Mon Sep 17 00:00:00 2001 From: Keira Dueck Date: Fri, 24 Sep 2021 03:53:10 -0700 Subject: [PATCH] update render scripts --- renderMaps.ps1 | 5 ++++- renderMaps.py | 1 + renderTiles.ps1 | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/renderMaps.ps1 b/renderMaps.ps1 index 3cb2243..04e35f1 100644 --- a/renderMaps.ps1 +++ b/renderMaps.ps1 @@ -1,6 +1,8 @@ # this is designed to run on keira's computer in particular. it shouldn't be *too* difficult to change, however. # note that to export... i think all you'll need tbh is uhhh the Roadgeek 2014 fonts, plus probably changing a few env vars somewhere +$python = "C:\Program Files\QGIS 3.20.3\bin\python-qgis" + Remove-Item "export" -Recurse -ErrorAction Ignore mkdir "export" | out-null @@ -10,13 +12,14 @@ Get-ChildItem "." -Filter *.qgs | Foreach-Object { if ($_.FullName -notmatch '\~$') { echo $_.FullName - Measure-Command { python-qgis .\renderMaps.py $_.FullName | Out-Default } + Measure-Command { & $python .\renderMaps.py $_.FullName | Out-Default } } } Measure-Command { Get-ChildItem "export" -Filter *.png | Foreach-Object -Parallel { + echo $_.FullName optipng $_.FullName } -ThrottleLimit 8 } \ No newline at end of file diff --git a/renderMaps.py b/renderMaps.py index 29944d5..8b5dbc4 100644 --- a/renderMaps.py +++ b/renderMaps.py @@ -14,6 +14,7 @@ settings = QgsLayoutExporter.ImageExportSettings() settings.dpi = 300 for layout in layouts: + print(layout.name()) QgsLayoutExporter(layout).exportToImage(os.path.join(os.getcwd(), "export", layout.name() + ".png"), settings) qgs.exitQgis() diff --git a/renderTiles.ps1 b/renderTiles.ps1 index 09a6845..8384b2e 100644 --- a/renderTiles.ps1 +++ b/renderTiles.ps1 @@ -1,12 +1,14 @@ # this is designed to run on keira's computer in particular. it shouldn't be *too* difficult to change, however. # note that to export... i think all you'll need tbh is uhhh the Roadgeek 2014 fonts, plus probably changing a few env vars somewhere +$python = "C:\Program Files\QGIS 3.20.3\bin\python-qgis" + Remove-Item "export-tiles" -Recurse -ErrorAction Ignore mkdir "export-tiles" | out-null $env:devilfishGitRev = $(git describe --tags --dirty --always) -Measure-Command { python-qgis .\renderTiles.py devilfish.qgs | Out-Default } +Measure-Command { & $python .\renderTiles.py devilfish.qgs | Out-Default } php renderTilesHTMLFixer.php