source: subversion/sites/www.openstreetbrowser.org/src/profiler_xml.php @ 16554

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

Files missing (please don't ask me why)

  • Property svn:executable set to *
File size: 852 bytes
Line 
1#!/usr/bin/php
2<?
3$sql=pg_connect("dbname=gis");// user=www password=cityrunner host=localhost");
4
5$dom=new DOMDocument();
6$dom->load("/osm/skunkosm/render/overlay_ch.xml");
7
8//$box=array(1823787.494884305,6138504.867525934,1825010.487336868,6139727.859978498);
9$box=array(1813797.75987783, 6130153.02441634, 1834395.04941202, 6151816.81425115);
10
11$layers=$dom->getElementsByTagname("Layer");
12foreach($layers as $l) {
13  print "* Layer, class ".$l->getAttribute("name")."\n";
14  $params=$l->getElementsByTagname("Parameter");
15  foreach($params as $p) {
16    if($p->getAttribute("name")=="table") {
17      $time=time();
18      $res=pg_query("select * from {$p->firstChild->data} where way && setSRID('BOX3D($box[0] $box[1],$box[2] $box[3])'::box3d,900913)");
19      print "Time: ".(time()-$time)."s\n";
20      print "Rows: ".pg_num_rows($res)."\n";
21    }
22  }
23}
Note: See TracBrowser for help on using the repository browser.