Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.5 (build 3282) - 23 February 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

ec-radar.php script dead due to Environment Canada website changes

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
saratogaWX
Posts: 1169
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

ec-radar.php script dead due to Environment Canada website changes

Post by saratogaWX »

It looks like Environment Canada has change the radar presentation to use a map-based version, and is no longer generating the images needed by the ec-radar.php script for operation.

I've started working on a replacement script, but for now, the old script is dead :(
User avatar
saratogaWX
Posts: 1169
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

Re: ec-radar.php script dead due to Environment Canada website changes

Post by saratogaWX »

Replacement scripts DONE!

I've shamelessly stolen the HAniS animation script set from Jerry Wilkins (thanks Jerry!) and with a tip from a Twitter follower, located a new set of Environment Canada radar .gif images that are being updated.

Use the update tool for Base-Canada, Plugin-*, 14-Apr-2021 to get the script set.

Note: you'll need to do changes to index.php (but an updated wxindex.php is included). Here's the 'README-wxecradar.txt' contents:
This is the README file for wxecradar scripts (Environment Canada Radar display using HAniS).

As of 30-Mar-2021, Environment Canada changed their Radar website to use a map to display radar information, and
stopped publishing radar images as .gif files on their main website. This rendered the former display script
of ec-radar.php obsolete and non-functional (since the images were no longer available).

Fortunately, the radar .gif images continue to be published on https://dd.weather.gc.ca/radar/PRECIPET/GIF/{sitename}/
BUT sadly, they no longer have the detail overlays of towns, highways, rivers on the new maps. So, the new .gif
radar images are a bit sparse but do otherwise display the 14-color versions of the original .gif images.

Contents:
wxradar.php (the linked-to script from the menu for radar display in Base-Canada template)
wxecradar-inc.php (provides selection capability and <iframe> for HAniS display)
wxecradar-iframe.php (provides contents to display in the <iframe>)
wxecradar-list-inc.php (list of current radar stations for display)
hanis_min.js (the HAniS script)
wxindex.php (updated to use wxecradar-iframe.php to display a radar image set)

All the files should be in the same directory (normally, the document root of the website).

If manually converting from an older wxindex.php to the new one, just replace:

------
<?php
// fetch fresh national radar image if needed .. you can chang it to
// 'NAT' = National radar view
// 'PAC' = Pacific region
// 'WRN' = Praries region
// 'ONT' = Ontario
// 'QUE' = Quebec
// 'ERN' = Atlantic region
$_REQUEST['site'] = 'NAT'; // one of the sites above, or your radar designator
$doPrint = false;
include_once("ec-radar.php");
?>
<img src="<?php echo $radarDir . 'radar-' . $_REQUEST['site'] . '-0.png'; ?>"
alt="Radar, courtesy of Environment Canada"
title="Radar, courtesy of Environment Canada" />
------

with

------
<?php
// fetch national radar image if needed
// 'PYR' = Pacific region
// 'PNR' = Praries region
// 'ONT' = Ontario
// 'QUE' = Quebec
// 'ATL' = Atlantic region
// or use the local radar site code like WKR or CASET .. see wxecradar-list-inc.php for codes

$radarLoc = 'ONT';

// $radarLoc = $SITE['ecradar']; // use Settings.php entry
$radar='RAIN'; // ='RAIN' or ='SNOW';
?>
<iframe name="wxradarshanis" width="617" height="<?php echo (in_array($radarLoc,array('PYR','PNR','ONT','QUE','ATL')))?'380':'555';?>" src="./wxecradar-iframe.php?radar=<?php echo $radar?>&amp;radarLoc=<?php echo $radarLoc?>&amp;lang=<?php echo $SITE['lang']; ?>" scrolling="no" style="border:none"></iframe>
------

Your Settings.php entry of:

$SITE['ecradar'] = 'WKR';

will determine the selected site in wxradar.php display

--------------
See the running version at Saratoga Base-Canada Demo.
Post Reply