Skip to content

Commit

Permalink
update render scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
sylae committed Sep 24, 2021
1 parent e098e05 commit d294e64
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion renderMaps.ps1
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
}
1 change: 1 addition & 0 deletions renderMaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 3 additions & 1 deletion renderTiles.ps1
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit d294e64

Please sign in to comment.