source: subversion/sites/www.openstreetbrowser.org/src/rerender_area @ 16536

Last change on this file since 16536 was 16536, checked in by skunk, 11 years ago

Feature: Rerender area

  • Calls the 'dirty' feature of mod_tile for a specified area and specified zoom levels to make it

rerender

  • Property svn:executable set to *
File size: 844 bytes
Line 
1#!/usr/bin/php
2<?
3function current_load() {
4  $p=fopen("/proc/loadavg", "r");
5  $r=fgets($p);
6  fclose($p);
7  ereg("^([0-9\.]+) ", $r, $m);
8  return $m[1];
9}
10
11$left=65;
12$right=69;
13$top=40;
14$down=44;
15$from_zoom=7; /* positions for left/right/top/down from that zoom level */
16$min_zoom=8;
17$max_zoom=9;
18$tileset="base";
19$steps=2; // depends on renderd
20
21for($zoom=$min_zoom; $zoom<=$max_zoom; $zoom++) {
22  $mul=pow(2, $zoom-$from_zoom);
23  print "$zoom $mul:  ".floor($left*$mul)." ".ceil($right*$mul)."\n";
24  for($i=floor($left*$mul); $i<=ceil($right*$mul); $i+=$steps) {
25    for($j=floor($top*$mul); $j<=floor($down*$mul); $j+=$steps) {
26      while(current_load()>1.0) {
27        print "Waiting for lower load\n";
28        sleep(10);
29      }
30      system("wget -O - http://localhost/tiles/$tileset/$zoom/$i/$j.png/dirty > /dev/null");
31      sleep(5);
32    }
33  }
34}
Note: See TracBrowser for help on using the repository browser.