-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
68 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*.qgs~ | ||
export/* | ||
export-tiles/* | ||
|
||
# pywikibot nonsense | ||
logs/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# 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 2005 fonts, plus probably changing a few env vars somewhere | ||
|
||
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 } | ||
|
||
php renderTilesHTMLFixer.php | ||
|
||
Measure-Command { | ||
Get-ChildItem "export-tiles" -recurse -Filter *.png | Foreach-Object -Parallel { | ||
optipng $_.FullName | ||
} -ThrottleLimit 8 | ||
} | ||
|
||
Measure-Command { | ||
scp export-tiles/map.cdn.html syl.ae:~/public_html/wormrpmap.php | ||
aws s3 sync export-tiles/ s3://cdn.syl.ae/wormrp/map/ --acl public-read | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from qgis.core import * | ||
from qgis import processing | ||
from osgeo import gdal | ||
import os | ||
import sys | ||
from PyQt5.QtGui import QColor | ||
|
||
gdal.PushErrorHandler('CPLQuietErrorHandler') | ||
qgs = QgsApplication([], False) | ||
qgs.initQgis() | ||
|
||
sys.path.append('H:\\OSGeo4W\\apps\\qgis\\python\\plugins') | ||
|
||
import processing | ||
from processing.core.Processing import Processing | ||
Processing.initialize() | ||
|
||
project = QgsProject.instance() | ||
project.read(sys.argv[1]) | ||
|
||
processing.run("qgis:tilesxyzdirectory", {'EXTENT':'-91.145624973,-89.211017226,47.356527267,48.282137008 [EPSG:4326]','ZOOM_MIN':11,'ZOOM_MAX':15,'DPI':96,'BACKGROUND_COLOR':QColor(0, 0, 0, 0),'TILE_FORMAT':0,'QUALITY':75,'METATILESIZE':4,'TILE_WIDTH':256,'TILE_HEIGHT':256,'TMS_CONVENTION':False,'OUTPUT_DIRECTORY':'export-tiles','OUTPUT_HTML':'export-tiles/map.tpl.html'}) | ||
|
||
qgs.exitQgis() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
// this entire script is a hack lmao | ||
|
||
$version = $_SERVER['devilfishGitRev'] ?? "unknown"; | ||
$tpl = file_get_contents("export-tiles/map.tpl.html"); | ||
|
||
$tpl = str_replace( | ||
"Generated by TilesXYZ", | ||
'devilfish.qgs // renderTiles.ps1 | tag <a href="https://github.com/sylae/devilfish-map" target="_blank">'.$version.'</a> | '.date(DATE_ATOM), | ||
$tpl | ||
); | ||
$tpl = str_replace( | ||
"Leaflet Preview", | ||
'Devilfish, Minnesota', | ||
$tpl | ||
); | ||
|
||
$local = str_replace("file:///export-tiles", ".", $tpl); | ||
$cdn = str_replace("file:///export-tiles", "https://cdn.syl.ae/wormrp/map", $tpl); | ||
|
||
file_put_contents("export-tiles/map.local.html", $local); | ||
file_put_contents("export-tiles/map.cdn.html", $cdn); |