#!/bin/bash
ARR="0 1 2 3 4 5 6 7"
SW=256
SH=256
P=""
mkdir -p m
for x in $ARR; do
for y in $ARR; do
echo "$x $y";
wget -O "m/$x-$y.png" "http://a.tiles.telegeography.com/maps/submarine-cable-map-2014/3/$x/$y.png"
P="$P -page +$[$x*$SW]+$[$y*$SH] m/$x-$y.png"
done;
done;
convert $P -mosaic map.png
rm -r m