SageTV Community

SageTV Community (
-   SageTV Australia/New Zealand (
-   -   Traffic congestion and traffic cams (

zzmystique 04-23-2008 05:37 PM

Traffic congestion and traffic cams
Would like to add Traffic congestion and traffic cams information for Auckland to the Online services Menu - from the urls below. Any ideas on how to
achieve it? Thanks

traffic cams
northcote road
tristram ave
onewa road
Esmonde Road

congestion info

JREkiwi 04-23-2008 11:57 PM

I used to use the Weather Suite customization to show them, but I think the last time I used it I was running SageTV 5. If you can get the basic Weather Suite running I can provide some config files.


doc 04-24-2008 08:34 AM


I dont know how you got on adding the following lines into the client properties file.

sagemc/wximage_title_1=Traffic Cam Northcote Road
sagemc/wximage_title_2=Traffic Cam Tristram Ave
sagemc/wximage_title_3=Traffic Cam Onewa Road
sagemc/wximage_title_4=Traffic Cam Esmonde Road

But the last pic you were on about has a base picture, and the green/yellow/red lines are super-imposed on top.

The only way I could think of generating the pic to display is to use
converthtmltoimage to copy the webpage to a bmp file, and then use irfanview to crop it to the right size.

To do this...

Download ConvertHTMLtoImage_Trial.exe from

(The trial works, but leaves a small watermark on the picture)

Install irfanview 4.10 from

Create a batch file with lines similar to below, depending on where you run it from.

"c:\program files\convert html to image\ConvertHTMLtoImage.exe" /url /delay 5 /format bmp /name output.bmp

"c:\program files\irfanview\i_view32" "C:\program files\convert html to image\output.bmp" /crop=(187,133,310,478) /convert="C:\program files\convert html to image\output.jpg"

Once you've created the jpg file, you can then add a couple of extra lines to the properties file to point to this jpg file.

I can't test any of this until the weekend, so let me know if any of it works.

If anyone else knows of an easier way to do this, I'm all ears!

doc 04-24-2008 01:29 PM

1 Attachment(s)
OK, here goes. It took me all day at work to get this working!!!!!!

It works on my test pc running SageMC. I haven't tested it on an MVP though.

Copy the following lines into on ther server.
For your MVP I guess you'd copy them into the appropriate properties file in the clients folder instead.

sagemc/wximage_title_1=Northcote Road
sagemc/wximage_title_2=Tristram Ave
sagemc/wximage_title_3=Onewa Road
sagemc/wximage_title_4=Esmonde Road
sagemc/wximage_title_5=Congestion Map

If you already have entries in there, you can delete them.
If you omit the whole lines for 6 & 7, SageMC will create them and point them to weather for the states. If you want them blank, leave them as shown above.
If you want other images, then add them like the other ones.

Form the Congestion Map, SageMC will load the picture c:\batch\output.jpg

On the congestion map web page there is a jpeg picture, but the green, yellow and red lines are superimposed on top of it, so you can't just point to the map.

The only thought I had was to take a screen print of the web page, and then crop the image to use just the bit required.

This is a bit long winded and there may be better ways of doing it, but it works.

Firstly, install
ConvertHTMLtoImage from (the trial version will do)
and irfanview from

I created a folder c:\batch, and made a batch file in it that had the following lines in it.

del "c:\program files\convert html to image\output.bmp"
del c:\batch\output.jpg

"c:\program files\convert html to image\ConvertHTMLtoImage.exe" /url /delay 5 /format bmp /name output.bmp

"c:\program files\irfanview\i_view32" "C:\program files\convert html to image\output.bmp" /crop=(187,133,310,478) /convert="C:\batch\output.jpg"

When you run this batch file, it will create the output.jpg file that SageMC will display on the screen.

You could create a scheduled task to run this batch file every 10 or 15 minutes between certain times of the day.

A good time would be before picking someone up at the airport :p

I'm not sure how often that congestion map is updated - it says 8:08 pm and the cams show up as 7.24 am. The watermark is because its the trial version of converthtmltoimage, but I'd guess you could live with that.

Let me know how you get on.


zzmystique 04-24-2008 09:28 PM

Doc - Followed your instructions - then renamed the .properties file in the client folder on the server - reloaded the Sagemc customisation on the MVP. All seems to be working. Thankyou. :jump:

John - Do you have NZ map info like US ones? Thanks


doc 04-25-2008 07:12 AM


I've found 2 maps that might be of interest, but theres not a great deal about really.

Add these lines to the properties file along with the previous ones.

sagemc/wximage_title_6=Satellite Image
sagemc/wximage_title_7=Rain Map

and add the following lines to the bath file you made before.

del "c:\program files\convert html to image\rain.bmp"
del c:\batch\rain.jpg

"c:\program files\convert html to image\ConvertHTMLtoImage.exe" /url /delay 5 /format bmp /name rain.bmp

"c:\program files\irfanview\i_view32" "C:\program files\convert html to image\rain.bmp" /crop=(148,305,344,313) /convert="C:\batch\rain.jpg"

Are they of any use?

doc 04-28-2008 02:28 AM


I found a different satellite image thats more local than the other one, but its in black and white :(

If you want to try it, generate the jpg file in the same way as the others

del "c:\program files\convert html to image\satellite.bmp"
del c:\batch\satellite.jpg

"c:\program files\convert html to image\ConvertHTMLtoImage.exe" /url /delay 5 /format bmp /name satellite.bmp

"c:\program files\irfanview\i_view32" "C:\program files\convert html to image\satellite.bmp" /crop=(148,305,339,467) /convert="C:\batch\satellite.jpg"

I've removed the 'www.' from the front of the URL so that it displays correctly. It also seems to work ok without it, so theres no need to put it at the beginning.

You'll have to remove one of the other maps as there appears to be a limit of 7.

zzmystique 04-29-2008 04:36 AM

Thanks Doc

Will check it out and see which map I prefer.


JREkiwi 05-15-2008 02:29 AM


Originally Posted by zzmystique (Post 279110)
John - Do you have NZ map info like US ones?

Anne, sorry for the lack of reply, but no I don't have one. Not only that but I can't find my configuration file that I did have. :bang:


zzmystique 05-23-2008 03:03 AM

Not a problem John, thanks for looking.


All times are GMT -6. The time now is 09:39 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2022, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.