# This simply counts how many levels we've gone through to decide on the total number of images # we'd generate grabbing some map data. # What zoom and grid we're starting with. $startkey = "03022"; $endkey = "03022333333333333"; $zoom = 4 # Count total files. $counter = 1; while ($testvalue != $endkey) { # setup and clear values. $total = $counter; $level1 = 0; $level2 = 1; $address = ""; $address[0] = $total; $filename = ""; # start counting. $sum = 5; # This just gets us started. It has no intrinsic value. while ($sum > 4) { $sum = $address[$level1]; while ($sum > 4) { $address[$level2]++; $sum = $sum - 4; $address[$level1] = $sum; $total = $sum; } $level1++; $level2++; $sum = $address[$level1]; } # Separate out our values. foreach $filename (@address) { $value--; $filename = $value . $filename; } # output final values. # echo "http:#r0.ortho.tiles.virtualearth.net/tiles/r$filename.png?g=45\n"; # echo "Total: $counter - Key: $filename<br>"; # if ($counter == 200) { die(); } $counter++; $testvalue = $startkey . $filename; $tracker++; if ($tracker >= 1000) { $totalcount = $totalcount + $tracker; print "$totalcount\n"; $tracker = 0; } #die(); } print $counter;