Big Ben feed

Showing 21-45 of 45 messages
Big Ben feed SidneyWinstonSmythe 7/29/05 1:16 PM
I updated this to put the clock in the right place, and also to give it a refresh interval of one second. Interesting to see whether that interval will work over remote connections.

Let me know how well it works remotely. Thanks - Sid
Re: Limited Time Only - Big Ben feed ExFiler 7/29/05 1:44 PM
It does show up, but the second hand only moves every 2 to 3 seconds. Must be the delay from you to me.
Re: Limited Time Only - Big Ben feed SidneyWinstonSmythe 7/29/05 1:48 PM
I set the refresh interval to 2 secs since I wasn't sure whether my connection was going to get pounded
Re: Limited Time Only - Big Ben feed Sirous_Nekooei 7/30/05 2:44 AM
That's really cool.
But, why didn't you put the overlay on the real BigBen?
Re: Limited Time Only - Big Ben feed SidneyWinstonSmythe 7/30/05 2:58 AM
I was in a hurry - if I can edit this post later I'll relocate it to an extruded tower in Westminster. You're right - for a little more effort it can look a lot better. Turns out that my server can easily handle the 2 sec refresh rate, so might also double it to 1 sec - Sid
Re: Limited Time Only - Big Ben feed Mike_in_Florida 7/30/05 6:30 AM was 'ok' - would be better on the actual Big Ben...good effort though...
Keep em coming...
Re: Limited Time Only - Big Ben feed SidneyWinstonSmythe 7/31/05 2:17 PM
OK, I stuck it on the real big ben
Re: Limited Time Only - Big Ben feed dulce 7/31/05 2:47 PM

Blog Google Earth en español

O coração, se pudesse pensar, pararia. (F. Pessoa)

Big Ben feed SidneyWinstonSmythe 8/24/05 12:07 PM
I dumped my ISP since they don't support KML or PHP - and got a provider who does.

Redid the clock animation in PHP - please see whether my first go at php works well enough.

I set the refresh rate to an ambitious one per sec.

Thanks - Sid

Re: Big Ben feed derekins 9/15/05 4:13 PM
Actually this is pretty cool!

If you could make a rotating London Eye in the background, I'd feel like I was in London!
Re: Big Ben feed jayhasbi 9/16/05 7:28 AM
Wonderful! This is one kmz that's staying in my My Places folder. Just cool.
Re: Big Ben feed Frank4 9/16/05 9:09 PM
Just thought I would let you know I wrote about your Big Ben app on Google Earth Blog.
Frank Taylor - Author of Google Earth Blog
All about Google Earth news, features, tips, technologies, and applications. Also read:
(If you have story ideas, please send me a private message.)
Re: Big Ben feed SidneyWinstonSmythe 9/19/05 1:40 AM
Thanks, it's very nice to be appreciated. The model is not complicated, in fact if you look at the KML you'll see three things: -
  • Polygons for the grey (Westminster) tower.
  • Coloured polygons sampled from a jpeg to make a crude picture of a clock face.
  • A dynamic link to the PHP below, which generates the KML for the clock hands on request.
Even the PHP is not too onerous once you look at the part of it that actually does the work.

Thanks - Sid


/** Clock class Definition
class AnalogueClock {
var $dFaceLon, $dFaceLat, $dFaceAlt;
var $dHourX, $dHourY;
var $dMinuteX, $dMinuteY;
var $dSecondX, $dSecondY;

var $dHourSize, $dMinuteSize, $dSecondSize;

var $sKml;
var $secondsFrac;
var $minutesFrac;
var $hoursFrac;

function AnalogueClock(){
$this->dFaceLon = 0.1;
$this->dFaceLat = 51.0;
$this->dFaceAlt = 20.0;
$this->dHourSize = 10.0;
$this->dMinuteSize = 10.0;
$this->dSecondSize = 10.0;

$this->sKml = "";
$this->sKml .= "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
$this->sKml .= "<kml xmlns=\"\">\n";
$this->sKml .= "<Folder>\n";
$this->sKml .= "<name>Kreation</name>\n";
$this->sKml .= "<open>1</open>\n";

$timeNow = getdate();
$secondsNow = $timeNow[seconds];
$minutesNow = $timeNow[minutes];
$hoursNow = $timeNow[hours];

if( $hoursNow > 12 )
$hoursNow -= 12;

$this->dSecondsFrac = $secondsNow/60.0;
$this->dMinutesFrac = ((60*$minutesNow) + $secondsNow) / 3600;
$this->dHoursFrac = ((3600*$hoursNow) + (60*$minutesNow) + $secondsNow) / 43200;

/** Writes a bit of KML to close the XML
function termKml(){
$this->sKml .= "</Folder>\n</kml>\n";

/** Creates KML for a hand - called for each of the hands
function generateHandKml($sPlaceName, $sCol, $dHandSize, $dRadians){
$dAngle = (3.14159/2)-$dRadians;
$dHoriz = 1.5*$dHandSize * cos($dAngle);
$dVert = $dHandSize * sin($dAngle);

$dHandAlt = $dVert + $this->dFaceAlt;
$dHandLon = $this->dFaceLon + ($dHoriz * $degreesPerMetre);
$dHandLat = $this->dFaceLat;

$this->sKml .= "<Placemark>\n";
$this->sKml .= "<name>" . $sPlaceName . "</name>\n";
$this->sKml .= "<Style>\n";
$this->sKml .= "<LineStyle>\n";
$this->sKml .= "<color>" . $sCol . "</color>\n";
$this->sKml .= "<width>50</width>\n";
$this->sKml .= "</LineStyle>\n";
$this->sKml .= "</Style>\n";
$this->sKml .= "<MultiGeometry>\n<Polygon>\n<tessellate>1</tessellate>\n";
$this->sKml .= "<altitudeMode>relativeToGround</altitudeMode>\n<outerBoundaryIs>\n<LinearRing>\n<coordinates>\n";
$this->sKml .= $this->dFaceLon . "," . $this->dFaceLat . "," . $this->dFaceAlt . " \n";
$this->sKml .= $dHandLon . "," . $dHandLat . "," . $dHandAlt . " \n";
$this->sKml .= "</coordinates>\n</LinearRing>\n</outerBoundaryIs>\n</Polygon>\n</MultiGeometry>\n</Placemark>\n";


/** Simple conversion of a 0-1 value to radians
function convertToRadians( $angle){
return 2.0*3.14159 *($angle);


/** Actual generation of KML

// Set the mime-type to "google earth"
header('Content-type: application/');

// Create an instance of a clock
$clock = new AnalogueClock;

// Work out the rotation of each of the hands
$seconds = $clock->convertToRadians( $clock->dSecondsFrac );
$minutes = $clock->convertToRadians( $clock->dMinutesFrac );
$hours = $clock->convertToRadians( $clock->dHoursFrac );

// Generate KML for each hand
$clock->generateHandKml("Hour Hand","#ffff0000", $clock->dHourSize, $hours);
$clock->generateHandKml("Minute Hand","#ff00ff00", $clock->dMinuteSize, $minutes);
$clock->generateHandKml("Second Hand","#ff0000ff", $clock->dSecondSize, $seconds);

// Actually write the KML out and finish
echo "$clock->sKml";
echo "$clock->sKml";

Re: Limited Time Only - Big Ben feed reeperbahn 9/20/05 12:53 AM
cool. works. but theres way to many polys in the clockface ... could be done with graphics?

- Jesper
Re: Limited Time Only - Big Ben feed SidneyWinstonSmythe 9/20/05 1:51 AM
The only way I know to get picture-like graphics in there is by sampling coloured polygons. I could halve the polys by drawing squares rather than triangles, and perhaps merge adjacent same-coloured polys.

Anyhow, whenever faced with performance issues, it's usually more cost effective to buy a faster machine, rather than spend time trying to speed up the code. Having built an AMD64 machine earlier this year, I'm not planning on writing efficient code for some time yet - S.
Re: Limited Time Only - Big Ben feed mdrogerson 10/28/05 8:06 AM
This is a nice little object.

Unfortunatley it slows my pc down considerably so I'm unable to keep it active.

One question I have is: Why didn't you remove the original hands from the image of the clock?

I think it would clean up the image and improve theis object a lot.

Well done, new ground has been broken!
"Shoot for the Moon, Even if you miss you'll land among the stars!"
Re: Limited Time Only - Big Ben feed SidneyWinstonSmythe 10/31/05 2:00 AM
I think the clock face graphic is the bit that slows your machine down. You should try switching it off and letting the rest of the model run without it. Currently GE is not very efficient at displaying graphics like this - even this crude picture puts a big load on your machine and the resolution is only 70x70.

As for the hands, it was sheer laziness. The big hurdle was getting the whole thing to run, and I just left the old hands on there. - Sid
Re: Limited Time Only - Big Ben feed FrankB 11/2/05 11:56 AM
If you turned the clock face the right way up, it would be even better.
Re: Big Ben feed WherethehellamI 11/15/05 12:01 PM
Nice 1 Sid, runs great on my machine.
Re: Big Ben feed echodawg 11/15/05 12:49 PM
great idea, I love it!

I'm working on a 3d model of a church in the center of Newport RI, USA that has a clock and would like to borrow your script with your permission.
sadly I am just learning html and know nothing about php(yet).

is it easy to switch it to eastern standard time(-5.00)? could it run off the comp's clock?

Re: Big Ben feed SidneyWinstonSmythe 11/15/05 3:22 PM
Help yourself to the script. Easy to convert to EST, just subtract 5 from the hours, should be a one liner. Good luck, let's see the link when you have it working!
Re: Big Ben feed echodawg 11/15/05 5:46 PM

here is the start of the model, it's already too detailed for GE to be practical.
can I also just delete all lines that reference the second hand and refesh it per minute or would I have to adjust the script?
Re: Big Ben feed SidneyWinstonSmythe 11/16/05 12:25 AM
Easy - remove the reference to the second hand, and set the network link to refresh once per minute.
Re: Big Ben feed Sanga 10/31/06 9:40 AM
I can't seem to locate the attachment/placemark. Am I missing something here.
-------------------- ::: Bring me a man who doesn't want money and I'll give him some. :::
Re: Big Ben feed philverney 11/1/06 2:04 PM
Hi Sanga,

You're not missing anything - the original placemark has been deleted. No trip to the opticians needed

Welcome to Google Earth!!
Follow Google Earth Outreach on Twitter!

Fan of Google Earth Outreach? Join our Facebook page!

"Google Earth is probably the best geographer's tool since the invention of compasses" - Wilma_Sweden