SageTV Community  

Go Back   SageTV Community > SageTV International User Forums > SageTV Australia/New Zealand
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Australia/New Zealand SageTV and SageTV Recorder Users from the Land Down Under - This forum is for you to post about specific issues using SageTV software in Australia and New Zealand.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-23-2008, 05:37 PM
zzmystique's Avatar
zzmystique zzmystique is offline
Sage Advanced User
 
Join Date: May 2004
Location: New Zealand
Posts: 211
Question 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
http://metservice.co.nz/default/inde...r_auck_nthcote
http://traffic.transit.govt.nz/ViewCamera.do?id=30
tristram ave
http://metservice.co.nz/default/inde..._auck_tristram
http://traffic.transit.govt.nz/ViewCamera.do?id=20
onewa road
http://metservice.co.nz/default/inde...=tr_auck_onewa
http://traffic.transit.govt.nz/ViewCamera.do?id=50
Esmonde Road
http://traffic.transit.govt.nz/ViewCamera.do?id=40

congestion info
http://traffic.transit.govt.nz/Traff...iew=congestion
====
__________________
ZZMystique
My setup: Server: SageTV v7, Intel i5, 8GB, 180GB SSD, 4TB HDD, Win7HP & (DVB Viewer Pro with DVB Viewer for SageTV using 2xTBS6281 DVB-T2).
Reply With Quote
  #2  
Old 04-23-2008, 11:57 PM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
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.

John
Reply With Quote
  #3  
Old 04-24-2008, 08:34 AM
doc's Avatar
doc doc is offline
Sage Fanatic
 
Join Date: Jun 2006
Location: Leicester, England
Posts: 918
Anne

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
sagemc/wximage_url_1=http\://traffic.transit.govt.nz/ViewCameraImage.do?id=30
sagemc/wximage_url_2=http\://traffic.transit.govt.nz/ViewCameraImage.do?id=20
sagemc/wximage_url_3=http\://traffic.transit.govt.nz/ViewCameraImage.do?id=50
sagemc/wximage_url_4=http\://traffic.transit.govt.nz/ViewCameraImage.do?id=40


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 http://www.converthtmltoimage.com/Download.html

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


Install irfanview 4.10 from
http://www.irfanview.com/

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 traffic.transit.govt.nz/Traffic.do?view=congestion /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!
Reply With Quote
  #4  
Old 04-24-2008, 01:29 PM
doc's Avatar
doc doc is offline
Sage Fanatic
 
Join Date: Jun 2006
Location: Leicester, England
Posts: 918
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 sage.properties 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
sagemc/wximage_title_6=
sagemc/wximage_title_7=
sagemc/wximage_url_1=http\://traffic.transit.govt.nz/ViewCameraImage.do?id\=30
sagemc/wximage_url_2=http\://traffic.transit.govt.nz/ViewCameraImage.do?id\=20
sagemc/wximage_url_3=http\://traffic.transit.govt.nz/ViewCameraImage.do?id\=50
sagemc/wximage_url_4=http\://traffic.transit.govt.nz/ViewCameraImage.do?id\=40
sagemc/wximage_url_5=c\:\\batch\\output.jpg
sagemc/wximage_url_6=
sagemc/wximage_url_7=


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 http://www.converthtmltoimage.com/Download.html (the trial version will do)
and irfanview from http://www.irfanview.com

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 traffic.transit.govt.nz/Traffic.do?view=congestion /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

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.

Doc
Attached Images
File Type: jpg congestion.JPG (40.1 KB, 449 views)

Last edited by doc; 04-24-2008 at 01:36 PM.
Reply With Quote
  #5  
Old 04-24-2008, 09:28 PM
zzmystique's Avatar
zzmystique zzmystique is offline
Sage Advanced User
 
Join Date: May 2004
Location: New Zealand
Posts: 211
Smile

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.

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

Anne
__________________
ZZMystique
My setup: Server: SageTV v7, Intel i5, 8GB, 180GB SSD, 4TB HDD, Win7HP & (DVB Viewer Pro with DVB Viewer for SageTV using 2xTBS6281 DVB-T2).
Reply With Quote
  #6  
Old 04-25-2008, 07:12 AM
doc's Avatar
doc doc is offline
Sage Fanatic
 
Join Date: Jun 2006
Location: Leicester, England
Posts: 918
Anne

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
sagemc/wximage_url_6=http\://image.weather.com/images/sat/new_zealsat_720x486.jpg
sagemc/wximage_url_7=c\:\\batch\\rain.jpg

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 metservice.co.nz/default/index.php?alias=akradar /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?

Last edited by doc; 04-28-2008 at 02:29 AM.
Reply With Quote
  #7  
Old 04-28-2008, 02:28 AM
doc's Avatar
doc doc is offline
Sage Fanatic
 
Join Date: Jun 2006
Location: Leicester, England
Posts: 918
Anne

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 metservice.co.nz/default/index.php?alias=vissatellitelatest /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.
Reply With Quote
  #8  
Old 04-29-2008, 04:36 AM
zzmystique's Avatar
zzmystique zzmystique is offline
Sage Advanced User
 
Join Date: May 2004
Location: New Zealand
Posts: 211
Thanks Doc

Will check it out and see which map I prefer.

Anne
__________________
ZZMystique
My setup: Server: SageTV v7, Intel i5, 8GB, 180GB SSD, 4TB HDD, Win7HP & (DVB Viewer Pro with DVB Viewer for SageTV using 2xTBS6281 DVB-T2).
Reply With Quote
  #9  
Old 05-15-2008, 02:29 AM
JREkiwi's Avatar
JREkiwi JREkiwi is offline
Sage Icon
 
Join Date: Jan 2005
Location: Auckland, New Zealand
Posts: 2,132
Quote:
Originally Posted by zzmystique View Post
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.

John
Reply With Quote
  #10  
Old 05-23-2008, 03:03 AM
zzmystique's Avatar
zzmystique zzmystique is offline
Sage Advanced User
 
Join Date: May 2004
Location: New Zealand
Posts: 211
Not a problem John, thanks for looking.

Anne
__________________
ZZMystique
My setup: Server: SageTV v7, Intel i5, 8GB, 180GB SSD, 4TB HDD, Win7HP & (DVB Viewer Pro with DVB Viewer for SageTV using 2xTBS6281 DVB-T2).
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 12:27 PM.


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