#!/bin/bash
OLEFT=132800
OTOP=452800

for A in `seq 0 5`;
do
LEFT=$(( $OLEFT + ( 574 * $A )))
RIGHT=$(( $LEFT + 574 ))

for B in `seq 0 5`;
do
BOTTOM=$(( $OTOP + ( 574 * $B )))
TOP=$(( $BOTTOM + 574 ))

FILE="$LEFT-$BOTTOM.gif"

if [ -f $FILE ]; then

echo "Got $FILE!"

else

wget -O $FILE  "http://www.rijkswaterstaat.nl/services/geoservices/basispakket/nationaalwegenbestand?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&BBOX=$LEFT,$BOTTOM,$RIGHT,$TOP&SRS=EPSG:28992&WIDTH=2048&HEIGHT=2048&LAYERS=AAA70&STYLES=&FORMAT=image/gif&TRANSPARENT=TRUE"

fi

done
done
