7

Is there an easy way to download a bunch of web map tiles (in /z/x/y.png format) and stitch them together into a single large image? I could probably script this using ImageMagick, but would prefer not to invent another wheel.

(The tiles in question are made by me in TileMill. I'm having serious problems with TileMill's export feature, and thought this might be a workaround.)

Mac or Linux only.

6

Ok, in the end this script did the job:

X1=456
Y1=307
X2=469
Y2=316
Z=9
for x in `seq $X1 $X2`; do
for y in `seq $Y1 $Y2`; do
echo "Getting ${x},${y}"
curl -s http://localhost:20008/tile/SteveCountryVic/${Z}/${x}/${y}.png -o ${Z}_${y}_${x}.png &
done
wait
done
montage -mode concatenate -tile "$((X2-X1+1))x" "${Z}_*.png" out_z${Z}_${X1}_${Y1}-${X2}_${Y2}.png

The only hassle is working out the values of X1,X2,Y1,Y2. Install imagemagick first:

sudo apt-get install imagemagick
3

I have successfully used taho.exe for such things. You can learn more about it from here:

http://www.dimitri-junker.de/eng/html/openstreetmap.html

You can change the source URL manually to fit your needs; even local addresses with file:/// will do.

You can switch the language to English under Bearbeiten -> Optionen. An English help manual is included in the Docu folder.

The programme DYJtracks from the same author and the same download page is a bit more comfortable to get a single map, and works even without a gpx file. But I don't know if you can get it running under Linux using wine.

2

This is what I did. No coding required.

I set the region using BigMap 2. http://bigmap.osmz.ru

Then I used Awesome Screenshot extension and set 'Capture Entire Page' https://chrome.google.com/webstore/detail/alelhddbbhepgpmgidjdcjakblofbmce

It might take awhile to capture the screen. It depends on how big your map is.

Finally, I save it to local file.

  • 1
    You can avoid using browser extensions if you download python or perl code (with the "Python" or "Perl" link) for selected tiles. If you selected less that 100 tiles, you can press "Queue" and receive a stitched image in a couple of minutes. – Ilja Zverev May 14 '14 at 15:12
2

Here's another option: https://github.com/ericfischer/tile-stitch

It's a simple command line tool where you specify the desired zoom level along with a bounding box or a center point w/ desired output dimensions in pixels.

The install instructions assume linux, but it compiled easily for me on OSX.

0

Please check out following links might be helpful for you.

http://ruessel.in-chemnitz.de/osm/qbigmap/

http://wiki.openstreetmap.org/wiki/Bigmap

https://github.com/migurski/modestmaps-py

  • Thanks. qbigmap: not enough doco for me to be able to build it or try out the binary. (Which "linux" does it target anyway? Is it GUI? Who knows?) Bigmap: can't use the online version, may play with code. modestmaps: not sure how I would use this to solve my problem. – Steve Bennett Oct 10 '13 at 7:30
0

You could use a GDAL TMS minidriver and gdal_translate. There several examples explaining how to specifically configure the minidriver depending by how the tile service is made. Furthermore, here's a post (in Italian, sorry!) written by @aborruso which also answers to your question. Hope this helps!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.