Closed jywarren closed 2 years ago
Hope to be able to fix this in https://github.com/publiclab/mapknitter-exporter/blob/c8ea1be6f94915c4c62c23788b249e1466c2d415/lib/exporter.rb#L289
So we can force zoom levels with -z 4-22
for example, but they're all empty, so it somehow thinks these maps are really really tiny? zoom 32 is ridiculously small.
We should check the zoom manually in... QGIS?
Looks like the GeoTiff is wrong. It's a tiny speck near Null Island!
Examining full export log: https://gist.github.com/jywarren/384ba5632ba8d90e7ab884fb30aa59b1
So, up to the gdalwarp command, we seem OK - i checked those coordinates in this example:
gdalwarp -s_srs EPSG:3857 -te -71.4044638417 41.8194984457 -71.4029728831 41.8200378187 public/warps/1636053156/w312455.tif public/warps/1636053156/w312456.tif public/warps/1636053156/1636053156.tif
working tifs are OK
public/warps/1636053156/w312455.tif
So the compositing step would have to be the problem. What's wrong with this?
gdalwarp -s_srs EPSG:3857 -te -71.4044638417 41.8194984457 -71.4029728831 41.8200378187 public/warps/1636053156/w312455.tif public/warps/1636053156/w312456.tif public/warps/1636053156/1636053156.tif
Creating output file that is 627P x 227L.
Using band 4 of destination image as alpha.
Processing public/warps/1636053156/w312455.tif [1/2] : 0Using band 4 of source image as alpha.
...10...20...30...40...50...60...70...80...90...100 - done.
Processing public/warps/1636053156/w312456.tif [2/2] : 0Using band 4 of source image as alpha.
...10...20...30...40...50...60...70...80...90...100 - done.
Resolving this will fix https://github.com/publiclab/mapknitter/issues/1343
OK, would it work to run:
gdalwarp -s_srs EPSG:4326 -t_srs EPSG:4326 -te -71.4044638417 41.8194984457 -71.4029728831 41.8200378187 public/warps/1636053156/w312455.tif public/warps/1636053156/w312456.tif public/warps/1636053156/1636053156.tif
gdalwarp -s_srs EPSG:3857 -te -71.4044638417 41.8194984457 -71.4029728831 41.8200378187 public/warps/1636053156/w312455.tif public/warps/1636053156/w312456.tif public/warps/1636053156/1636053156.tif
So just adding -t_srs EPSG:4326
?
THAT ALMOST WORKS!!!
It generates tiles like:
https://4567-silver-iguana-7u06ru3n.ws-us18.gitpod.io/tms/1636492035b/16/19769/41163.png
But actually OSM ID editor tries to fetch
https://4567-silver-iguana-7u06ru3n.ws-us18.gitpod.io/tms/1636492035b/16/19768/41163.png
Notice 19768 instead of 19769 ☹️
How are we off by one?!?!?!
We should be able to test this with https://4567-silver-iguana-7u06ru3n.ws-us18.gitpod.io/tms/1636492035b/{z}/{x}/{-y}.png
L.tileLayer('https://4567-silver-iguana-7u06ru3n.ws-us18.gitpod.io/tms/1636492035b/{z}/{x}/{-y}.png', {
tms: true
}).addTo(map);
/export?url=https://mapknitter.org/maps/pvdtest/warpables.json&scale=100
OK, published the gem in https://github.com/publiclab/mapknitter-exporter/pull/79 - as 1.0.11, now moving to pull it into the Sinatra app at https://github.com/publiclab/mapknitter-exporter-sinatra/pull/144
Done! Let's let sinatra apps reboot... then test at https://mapknitter.org/maps/pvdtest 👍
OK, so the GeoTiff works with v1.0.11 of the gem
So i think i may have made a mistake on the gdal2tiles step. Let's re-run it in Sinatra in gitpod.
Currently it has s_srs of 900915 but I think it should be 4326.
OK, works in Leaflet now:
Works in Qgis!
OK, and in ID editor.
Now adding the quick link to open OpenStreetMap ID editor from the exports pane:
https://github.com/publiclab/mapknitter/commit/8e0c4923d21e3052832c8126dce91267378b72f3 https://github.com/publiclab/mapknitter/commit/6dfc357c85bd009d9128912db20f2f497f9e36e8
should get us URLS in format
Fixed this now! All good.
Tiles seem individually OK in the new TMS exports - https://github.com/publiclab/mapknitter/pull/1548 and https://github.com/publiclab/mapknitter-exporter-sinatra/pull/134
https://storage.googleapis.com/mapknitter-exports-warps/1635967451/tms/31/1073743569/1073741840.png
But as you can see they're only generating zoom level 31. That's not right... here's the gdal2tiles command:
gdal2tiles.py -k --s_srs EPSG:3857 -t 1636041238 -g AIzaSyAOLUQngEmJv0_zcG1xkGq-CXIPpLQY8iQ public/warps/1636041238/1636041238.tif public/tms/1636041238/
What's going wrong? Testing in the sinatra app in GitPod...