Exemplo n.º 1
0
    $Region = $placemark->addChild('Region');
    $Region->setPoint($point, 0.01);
    $delta = $entry['gridimage_id'] % 30;
    $Region->setLod(50 + $delta, 1300 + $delta * $delta);
    $Region->setFadeExtent(10, 100);
    $folder->addChild($placemark);
}
$letterlength = $CONF['gridpreflen'][$prefix['reference_index']];
$sql_column = "concat(substring(grid_reference,1,{$letterlength}+1),substring(grid_reference,{$letterlength}+3,1))";
$most = $db->GetAll("select \r\ngrid_reference,x,y,\r\n{$sql_column} as hunk_square,\r\nsum(imagecount) as images\r\nfrom gridsquare \r\nwhere {$sql_where}\r\ngroup by hunk_square \r\nhaving images > 0 \r\norder by hunk_square");
foreach ($most as $id => $entry) {
    $x = intval(($entry['x'] - $prefix['origin_x']) / 10) * 10 + $prefix['origin_x'];
    $y = intval(($entry['y'] - $prefix['origin_y']) / 10) * 10 + $prefix['origin_y'];
    list($south, $west) = $conv->internal_to_wgs84($x, $y, $ri);
    list($north, $east) = $conv->internal_to_wgs84($x + 10, $y + 10, $ri);
    $networklink = new kmlNetworkLink(null, $entry['hunk_square']);
    $file = getKmlFilepath($kml->extension, 4, $square, $entry['hunk_square']);
    $UrlTag = $networklink->useUrl("http://" . $CONF['KML_HOST'] . $file);
    $html .= getHtmlLink($file, $entry['hunk_square'], 'in Hectad', " (at least {$entry['images']} images)");
    if (!isset($_GET['debug'])) {
        if (isset($_GET['newonly'])) {
            $db->Execute("insert ignore into kmlcache set `url` = 'hectad.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 4,`rendered` = 0");
        } else {
            $db->Execute("replace into kmlcache set `url` = 'hectad.php?gr={$entry['hunk_square']}',filename='{$file}',`level` = 4,`rendered` = 0");
        }
    }
    $UrlTag->setItem('viewRefreshMode', 'onRegion');
    $links->addChild($networklink);
    $Region2 = $networklink->addChild('Region');
    $Region2->setBoundary($north, $south, $east, $west);
    $Region2->setLod(450, -1);
Exemplo n.º 2
0
} elseif ($m[2] == 4 || isset($_GET['download'])) {
    if ($i) {
        $cache_file = "kml/{$i}/geograph.kmz";
    } else {
        $cache_file = "kml/geograph.kmz";
    }
    $mtime = filemtime($cache_file);
    //use the filename as a hash
    customCacheControl($mtime, $cache_file);
    Header("Content-Type: application/vnd.google-earth.kmz+xml; charset=utf-8; filename=geograph.kmz");
    Header("Content-Disposition: attachment; filename=\"geograph{$i}.kmz\"");
    header('Content-length: ' . filesize($cache_file));
    readfile($cache_file);
    exit;
} else {
    $networklink = new kmlNetworkLink(null, 'Geograph SuperLayer');
    $desc = <<<END_HTML
<table bgcolor="#000066" border="0"><tr bgcolor="#000066"><td bgcolor="#000066">
<a href="http://{$_SERVER['HTTP_HOST']}/"><img src="http://{$_SERVER['HTTP_HOST']}/templates/basic/img/logo.gif" height="74" width="257"/></a>
</td></tr></table>

<p><i>The Geograph British Isles project aims to collect geographically representative photographs and information for every square kilometre of the UK and the Republic of Ireland, and you can be part of it.</i></p>

<p>Click on the Camera Icon or Thumbnails to view a bigger image, and follow the link to view the full resolution image on the geograph website.</p>
END_HTML;
    if ($i) {
        require_once 'geograph/searchcriteria.class.php';
        require_once 'geograph/searchengine.class.php';
        $engine = new SearchEngine($i);
        $desc .= "<p>Displaying results for search for images<i>" . htmlentities2($engine->criteria->searchdesc) . "</i></p>";
    } else {