Author Topic: How to Run US Animated Radar on Google Maps  (Read 114784 times)

0 Members and 1 Guest are viewing this topic.

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #225 on: August 15, 2012, 01:12:09 PM »
I'm still using those scripts and they should still work.

The NWS is upgrading to the new Ridge2, but I haven't had time to figure that out yet.  If anyone has done it, I'd love some information on how to access the new weather images.

--wmleler

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3171
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #226 on: August 15, 2012, 01:42:07 PM »
I've got to change all of mine over (23 of them), I'll start looking at Danny's tonight to see what I have to do and I'll let you know. Danny's new one is much more comprehensive than the old one and it involves many more scripts. It might take me more than a few nights to work through it.

Offline sperryruss

  • Member
  • *
  • Posts: 4
    • North Lake Jackson Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #227 on: August 15, 2012, 03:45:53 PM »
I finally got the script going that wmleler wrote.

I looked up who Danny was and assume that you were talking about ElDoradoWx script for the v3 google maps? If so I will watch out for what you find out.

Sperry

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #228 on: August 15, 2012, 04:50:30 PM »
By the way, Flightstats (where I work) has switched away from the Google Maps API and is now using Leaflet. We are very happy with Leaflet. You can read more about this in our developer blog:
http://devblog.flightstats.com/2012/07/switching-mapping-apis.html

There is also an entry about switching to open source solutions:
http://devblog.flightstats.com/2012/07/wm-leler-talks-about-moving-away-from.html

Wm Leler

Offline sperryruss

  • Member
  • *
  • Posts: 4
    • North Lake Jackson Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #229 on: August 15, 2012, 09:58:44 PM »
I read those links. I think that the v3 google maps radar of ElDoradoWx incorporate Openstreets. I don't necessarily have to have google maps. Openstreets seem fine to me for the use of weather Radar. I just need to figure out how to get these things to work. I am not a programmer although I have dabbled in different languages slightly. Usually I try to find out how to use a script or code and modify it for myself at which I don't always succeed.  :-)

Thanks.

Sperry

Offline K4KMG

  • Contributor
  • ***
  • Posts: 106
    • K4KMG.com
Re: How to Run US Animated Radar on Google Maps
« Reply #230 on: September 07, 2012, 01:01:24 PM »
My Google maps radar pg stopped working a couple of days ago.  http://k4kmgweather.com/google-radar.php

Any idea what's going on? NWS issue? Google? Is this just a consequence of the changes being made at both places?

Thanks
Tom
Living 'Off Grid" in Central Florida. Pics at k4kmg.com

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #231 on: September 07, 2012, 01:38:09 PM »
Our weather radar stopped working a few days ago as well. The problem was the PHP script that returns the file names for the radar images -- it started returning bad names (missing the timestamp).  I reverse engineered the script, ran it on my own server, and now everything is working again.

You can grab my script from http://demo.flightstats-ops.com/NWS/JSON_generator.py
It is in Python rather than PHP. I have a PHP version too, but it is more complicated to install.  To use the PHP version, download http://demo.flightstats-ops.com/NWS/JSON_generator.php and http://demo.flightstats-ops.com/NWS/EasyWebFetch.php
Put either the Python or PHP version on your server, and change the URL that calls this script in you site, and everything should be working again.

Note that I think the NWS is starting to switch over to Ridge2 radar, which is why things are starting to break with the old (Ridge) radar.  Hopefully someone will figure out how to use Ridge2 soon (maybe even me if I find the time).

Offline K4KMG

  • Contributor
  • ***
  • Posts: 106
    • K4KMG.com
Re: How to Run US Animated Radar on Google Maps
« Reply #232 on: September 07, 2012, 01:54:13 PM »
Living 'Off Grid" in Central Florida. Pics at k4kmg.com

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #233 on: September 07, 2012, 02:01:46 PM »
You're using ridge2 data, not ridge?  I think mine is for ridge, but you can try it.

Just change the URL (everything up to the "?") to point to wherever you put your script on your server.

Gotta run, leaving town. Back Monday.

Offline K4KMG

  • Contributor
  • ***
  • Posts: 106
    • K4KMG.com
Re: How to Run US Animated Radar on Google Maps
« Reply #234 on: September 07, 2012, 02:14:08 PM »
Thanks but didn't work. No worries.

Tom
Living 'Off Grid" in Central Florida. Pics at k4kmg.com

Offline Chandra

  • Member
  • *
  • Posts: 12
Re: How to Run US Animated Radar on Google Maps
« Reply #235 on: September 07, 2012, 02:30:56 PM »
My National Weather Service Radar is not overlaying correctly.  The
webpage is http://156.42.96.39/alert/Google/radar.html.  I have had
this working on the webpage for over two years and two days ago it was
working fine.  Yesterday I noticed the problem.  When you open the
webpage the last 10 gif radar images from the Phx are supposed to
overlay and loop.  The images are coming from http://radar.weather.gov/ridge/RadarImg/NCR/IWA/
and the map isn't grabbing the time step on file name correctly.  IE
the latest image should be http://radar.weather.gov/ridge/RadarImg/NCR/IWA/IWA_20120907_1217_NCR..gif
and on the Google Map at the very bottom the url is supposed to be the
same thing and it is http://radar.weather.gov/ridge/RadarImg/NCR/IWA/IWA_20120907__NCR.gif.
Does anyone have any ideas or suggestions on how to get the radar working? Thanks.
Hydrologist, Engineering Department
The Flood Control District of Maricopa County
Phoenix, AZ 85009

Offline ingogliar

  • Member
  • *
  • Posts: 37
Re: How to Run US Animated Radar on Google Maps
« Reply #236 on: September 08, 2012, 02:06:09 PM »
My radar map will not work either - it had been fine up until a few days ago.

Does anyone have any ideas as to what happened?

Bob Ingoglia
http://heightsweather.info

Online SteveFitz1

  • Forecaster
  • *****
  • Posts: 340
    • http://www.TylerTexasWeather.Com
Re: How to Run US Animated Radar on Google Maps
« Reply #237 on: September 08, 2012, 02:37:33 PM »
My radar map will not work either - it had been fine up until a few days ago.

I was having the same problem. Go back to page 9 in this topic about 6 entries down to the response by wmleler. I just finished following his instructions and my radar is now working great.

Steve

Offline ingogliar

  • Member
  • *
  • Posts: 37
Re: How to Run US Animated Radar on Google Maps
« Reply #238 on: September 09, 2012, 09:28:15 AM »
Steve,

Thanks - you are correct - it works perfectly! Thank you.

Bob

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #239 on: September 10, 2012, 03:08:39 AM »
Glad to be of assistance!

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3171
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #240 on: September 11, 2012, 10:48:39 AM »
Yep... none of mine work now either. I hate having to create a separate page for each radar. The more I think about it the more I believe that Danny's solution, while more complex, will be more beneficial.

Offline Chandra

  • Member
  • *
  • Posts: 12
Re: How to Run US Animated Radar on Google Maps
« Reply #241 on: September 11, 2012, 11:22:54 AM »
I have still been unsuccessful at getting my radar working. 

I have tried the fix from wmleler.  I have the JSON_generator.php and EasyWebFetch.php on my webserver and have changed the two lines in ELDoradoWx's scripts to as suggested.  I have the JSON_generator.php file to just get Phoenix radar.  My map is at http://156.42.96.39/alert/Google/radar.html and ELDoradoWx's script is at http://156.42.96.39/alert/Google/nws_radar_test_revised.js and the php files are in http://156.42.96.39/alert/Google/php/

DaculaWeather what is Danny's solution?  My my map (when it was working) allows you to add up to 5 radars at one time. 

Any suggestions?
Hydrologist, Engineering Department
The Flood Control District of Maricopa County
Phoenix, AZ 85009

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3171
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #242 on: September 11, 2012, 11:51:26 AM »
Danny (EldoradoWX) is now using a totally different script. It involves multiple scripts and adds additional layers of complexity that the old script doesn't have.

I'll have to start working on that tonight since none of my 23 or so Google radars are now working.

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #243 on: September 11, 2012, 03:39:43 PM »
Some people have had some problems downloading my files without them getting corrupted. In particular, the files Chandra uploaded seem to be corrupted or empty. Not sure what the problem could be, but I've zipped up all three of them and attached them to this posting.

Please let me know if this works.  Remember, you only need either the single python file, or the two php files.

--wm
« Last Edit: September 11, 2012, 03:41:20 PM by wmleler »

Offline Chandra

  • Member
  • *
  • Posts: 12
Re: How to Run US Animated Radar on Google Maps
« Reply #244 on: September 11, 2012, 04:53:23 PM »
I saved and unzipped them and I am still not able to get the radar to work.  I tried using both .php files and then just the .py file. I have changed the file names within my .js and the radar names within the .php file.  I am just trying to get the radar NCR (Composite Ref.) working for IWA (Phoenix). 

Here is my map http://156.42.96.39/alert/Google/rain.html

I am getting this error message:

Message: Expected ';'
Line: 1
Char: 9
Code: 0
URI: http://156.42.96.39/alert/Google/php/JSON_generator.php?callback=CallBack&frames=10&rid=IWA&product=NCR&random=7988470934

This line of code is from the JavaScript file http://156.42.96.39/alert/Google/nws_radar_test_revised.js. My php files are located at http://156.42.96.39/alert/Google/php/EasyWebFetch.php and http://156.42.96.39/alert/Google/php/JSON_generator.php.  Is there any way I might need to edit proxy settings withing the EasyWebFetch.php file?

Thanks
Hydrologist, Engineering Department
The Flood Control District of Maricopa County
Phoenix, AZ 85009

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #245 on: September 11, 2012, 05:05:13 PM »
When I try to invoke your PHP file, I get a hung browser and then "Unknown error". There must be some reason your server isn't executing the PHP file.

You should be able to invoke the PHP file directly, like this (on my personal server):
http://zat.com/flightstats/NWS/JSON_generator.php?rid=IWA

Drop that URL into a browser and you can see the output for IWA (Phoenix).

You should be able to get the same response on your server.  If you can't, then something is not configured properly. Ask your hosting provider how to get PHP files to execute.

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3171
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #246 on: September 13, 2012, 09:59:07 AM »
Finally. I've got all of Danny's code working (almost) with the Google v3 stuff
http://www.daculaweather.com/current/misc/google-maps-radar/4_google_radar.php

What I don't have working is the preset radar views (I have no idea how it loads the settings for those unless their are some files I can't see).
It's a PITA because of the complexity of the code. IT didn't want to validate (and probably still doesn't) and I had to fix some quotes, things like <br /> instead of <br> etc. Lots of css tweaks to make it fit my page etc.

There are also some js files that are called by one of the scripts that loads that you can see. It was kind of a pain to track those down too.

I emailed Danny but I doubt seriously that he'll respond.

Just a caution for those that want to try this, is not for the faint of heart. I could write a small book about all the things I had to do and I would probably leave something out, so I won't be much help. Because there are so many things that could go wrong, trying to troubleshoot reverse engineering issues will be a PITA.

Offline Chandra

  • Member
  • *
  • Posts: 12
Re: How to Run US Animated Radar on Google Maps
« Reply #247 on: September 13, 2012, 01:19:45 PM »
wmleler - the Phoenix Composite Radar is overlaying on my maps now!  Yay!  I had to edit EasyWebFetch line 40-44 with my proxy settings to get out of the county network.  I was running into a firewall.  Thank you so much for your help and suggestions. 

One more question to  you, it seems as though this script will only overlay one radar and one product.  Is there any way to have multiple products and radars pull data from this JSON_generator.php file?

FYI for everyone - We work very closely with NWS so I called and talked with SRH's about the http://www.srh.noaa.gov/ridge2/JSON_generator.php file.  The JSON_generator.php file was was only running at SRH, and the server that it was running on was recently taken down.  They have a ticket in with NIDS (National Weather Service Information Dissemination System) to implement this script nationally, but are unsure of a timeline.
Hydrologist, Engineering Department
The Flood Control District of Maricopa County
Phoenix, AZ 85009

Offline DaculaWeather

  • It's a Jeep thing... you wouldn't understand.
  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3171
  • SCCA EM #156
    • North Georgia and US Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #248 on: September 13, 2012, 01:33:04 PM »
The government moves very slowly. Good luck on having it back up anytime soon.

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #249 on: September 13, 2012, 01:38:57 PM »
I wrote my JSON_generator.php to exactly simulate the one at the NWS site, so that it could be used by any script without change.  Most scripts call it multiple times if they want to display multiple products or radar stations.  But, it would not be difficult to modify the script if you wanted to.

Actually, here at Flightstats we are moving away from using this script. Its only purpose is to let you know what the file names are, so you can insert them into the HTML img tags.  Instead, we are setting up a proxy on our site so that we can read the directories from the client (using JavaScript) without running into the dreaded "same origin policy" problem.

By the way, if you are working closely with the NWS I would love to have more information about Ridge2 radar.  I have not been able to find much information on how to access the image files. I wrote to them but received no response. If you have that information (or can get it) and send it to me (or post it here), I will write JavaScript to access it and will be glad to share it in here.

Questions would be:
Is Ridge2 ready to be used by people like us?
How do we access the image files?
Are there other ways to access the images, like a tile server or other server?
Is there any sample code they can provide that accesses the new Ridge2 radar?
Is there any documentation on what is available?

Thanks!

 

anything