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

0 Members and 1 Guest are viewing this topic.

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #200 on: January 05, 2012, 06:00:20 AM »
Actually I'm Steve but go ahead, it's the NWS!

Offline wingwing

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #201 on: January 05, 2012, 06:04:02 PM »
My app is working again with these changes.  Good luck!
.. could you share a little more info about how you modified the original?

Thanks,
Dennis

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #202 on: January 05, 2012, 06:13:57 PM »
After I looked at his script, I'm sure it will work to fetch the images for one site, but it didn't appear to accommodate multiple radar sites per page. I could be wrong!

Offline wingwing

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #203 on: January 05, 2012, 06:34:50 PM »
After I looked at his script, I'm sure it will work to fetch the images for one site, but it didn't appear to accommodate multiple radar sites per page. I could be wrong!
dang... I use four sites
.. hope you're wrong..  :grin:

Dennis

Offline wingwing

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #204 on: January 05, 2012, 08:04:02 PM »
wow... mine just started working again...
(I've not changed anything yet)

wonder who did what??

Dennis

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #205 on: January 05, 2012, 09:27:55 PM »
My app is working again with these changes.  Good luck!
.. could you share a little more info about how you modified the original?

Thanks,
Dennis
Script I posted (JSON_generator.php) is not a rewrite of the scripts written by ELDoradoWx. His JavaScript scripts (see http://www.eldoradocountyweather.com/scripts/radar-on-google-maps.txt) make an AJAX call to JSON_generator.php on the www.srh.noaa.gov site. You pass it a parameter that says how many frames you want, and it returns the file names for those images, which are then plugged into <img> elements on your site and displayed.

The version on www.srh.noaa.gov stopped working, but you could still look at the file names manually. For example, to see a directory listing for the current NCR images for station ATX, just look at http://radar.weather.gov/ridge/RadarImg/NCR/ATX/ from your browser.

So what I did was write a server-side (PHP) program that accessed that URL. It takes the HTML of the directory listing that comes back and scrapes (parses) it to get the file names and returns them. So it gives the same result as the JSON_generator.php on www.srh.noaa.gov, but it works completely differently (I think, since I don't have the source of NOAA's version of JSON_generator.php).  The only other difference is that it returns the files on the radar.weather.gov site, which seems to be more stable than the www.srh.noaa.gov site.

So if you are using one of ELDoradoWx's scripts on your site, what you need to do is the following. It is pretty simple actually:
1) Install my new JSON_generator.php program (and EasyWebFetch.php) on your site somewhere so you can call it. Let's say your site is "mysite.com" and you put these files in the directory "myradar".
2) Edit the script from ELDoradoWx and change any line similar to this:
  var stub="http://www.srh.noaa.gov/ridge2/JSON_generator.php?callback=CallBack&amp;frames="+Wrap;
to  instead call the script on your site like this:
  var stub="http://mysite.com/myradar/JSON_generator.php?callback=CallBack&amp;frames="+Wrap;
The important part is to change the URL to access JSON_generator.php on your site instead of the non-working version on the NOAA site.
3) Also edit the script so that it accesses the image files on radar.weather.gov instead of www.srh.noaa.gov
For example, in the function "CallBack" the first line is:
  var stub="http://www.srh.noaa.gov/";
Change that to
  var stub="http://radar.weather.gov/";

In summary, drop two files on your server, edit two lines in ELDoradoWx's script. Now everything should work again.

If the NOAA website is working again, that's great, but you still might want to make these changes, since radar.weather.gov seems to be both faster and more stable than the NOAA site.

To answer DaculaWeather, my JSON_generator.php program only fetches one station at a time, exactly the same as NOAA's JSON_generator.php program. ELDoradoWx's script calls this multiple times if you want to display more than one weather station. It works exactly the same as before.
« Last Edit: January 06, 2012, 12:42:26 AM by wmleler »

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #206 on: January 05, 2012, 09:45:40 PM »
Good information, thanks! Yes, it appears it's all working again. But I have all the files now so in the future if it happens again, I can swap.

I have 24 different loops that I HATE to have to change it I don't have to.  :-)

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #207 on: January 05, 2012, 10:11:06 PM »
By the way, many people in here asked if ELDoradoWx was going to rewrite his radar animation script to run on Google Maps V3 (instead of V2). I did that, and was thinking about posting the new scripts here for other people to use.

But if NOAA is switching over to Ridge 2, perhaps I should wait until that is done.

Also, we are looking at alternatives to Google Maps for several reasons. First, Google is now charging for their maps (only for heavy users, but we are definitely a heavy user), and second since Google Maps is closed source, it is hard to add features to it that we need.

I've already rewritten one of our maps to use the open source Leaflet mapping software (from Cloudmade). One of the advantages of Leaflet is that you can get your map imagery from anywhere, and there are some really nice maps out there. MapQuest has some map servers that are free and have some really nice looking maps (based on OpenStreetMap data).

So I may write the Ridge 2 weather radar scripts using Leaflet. We'll see.

Wm Leler
Flightstats.com

[helpful links]
http://leaflet.cloudmade.com/
http://open.mapquest.com/
http://www.fubra.com/blog/2011/11/24/google-maps-free-alternatives/
http://blog.nestoria.co.uk/why-and-how-weve-switched-away-from-google-ma
« Last Edit: January 06, 2012, 12:48:18 AM by wmleler »

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #208 on: January 05, 2012, 10:22:20 PM »
I would be very interested.

Offline wingwing

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #209 on: January 05, 2012, 10:25:31 PM »
Thank you... Very nice  work.

A GM v3 version would be great..
..could add nice pop ups over the  Nexrad for severe wx alerts etc.

Dennis

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #210 on: January 06, 2012, 02:21:45 AM »
Dennis, the current code I wrote for GM V3 only includes those features I needed (I didn't need multiple radar stations, for example), and would need to be cleaned up and documented.  I'm not sure if that is worth it to spend much more time on that code if I will just have to throw it away soon for Ridge 2.  Not to mention if I'm moving away from GM.

I could probably get permission to send you the code as it is, so you can see what it looks like and adapt it to your needs. It isn't actually all that much code (90 lines).

Offline wingwing

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #211 on: January 06, 2012, 09:19:58 AM »
I'd like to see it if possible.

I guess I do not understand all the implications of changing to Ridge 2.
.. I thought it should just be a matter of changing server/path/file names.

My application works on Android devices..
..it uses the current generation of wx scripts for GM v2 and geo location information from the phone to generate a nearest four sites view on the phone.
A virtual cell phone browser let's it all update as the user drives to provide dynamic updates..
..very near real time "follow me" nexrad depiction..

I've been unable to get it working on GM v3..

Thanks,
Dennis
« Last Edit: January 06, 2012, 02:11:56 PM by wingwing »

Offline wmleler

  • Member
  • *
  • Posts: 17
Re: How to Run US Animated Radar on Google Maps
« Reply #212 on: January 06, 2012, 12:08:14 PM »
I haven't looked at Ridge 2 in depth, but it seems like it will take more (maybe quite a bit more) than just changing servers.

I've written to NOAA to see if they have more technical information.

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #213 on: February 25, 2012, 03:36:10 PM »
Hey! I resemble that!

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #214 on: February 26, 2012, 09:05:07 AM »
I'm new to this and have been reading up on the projects discussed here.  There is some really great work being done and want to thank those that have put so much into it so far.  I have a question about this example:

http://www.eldoradocountyweather.com/radar/conus/conus-googlemap-radar.html

Is there a way to cause the page to open up to a zoomed & centered area of the midwest instead of the entire US?  Is there a sample code that I could view?

Thanks again for some wonderful work!

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #215 on: February 29, 2012, 01:03:40 PM »
Perhaps someone could help me out.  What I'm seeing is that the animation speed specified in ridge.html isn't being honored unless I have the opacity set to 100%.  At all other settings the speed is slow.  Please have a look here:

http://mymishawakaweather.com/ridge.html

Thanks!

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3206
    • North Georgia Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #216 on: March 01, 2012, 07:37:25 AM »
A few things...

1. You're loading a LOT of radar sites, it WILL be slow. I have a few that load 20 and yes, it is slow.
2. I would remove the opacity settings under the function Load() settings and see what happens.

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #217 on: March 01, 2012, 05:48:06 PM »
Thanks for the suggestion and yes, that seems to have taken care of it.  I think this issue might be hardware specific, and may not be as noticable on a higher-end system.  I'll leave opacity under the function Load() settings out of the code.  I wish there was a way to put the map labels over the radar echos but at the beginner level I can't begin to guess how.

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2429
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #218 on: March 02, 2012, 12:19:35 AM »
Perhaps someone could help me out.  What I'm seeing is that the animation speed specified in ridge.html isn't being honored unless I have the opacity set to 100%.  At all other settings the speed is slow.  Please have a look here:

http://mymishawakaweather.com/ridge.html

Thanks!
Golly, so much ground clutter.

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Offline tmabell

  • Forecaster
  • *****
  • Posts: 394
    • Mishawaka Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #219 on: March 02, 2012, 07:37:46 PM »
Yea, that's another thing I wish we could address.  If we could specify a color table or turn off cetain dbz returns it would be nice!  That wouldn't eliminate the clutter but it sure would reduce it some.

Offline ELDoradoWx

  • El Dorado Weather
  • Senior Contributor
  • ****
  • Posts: 298
  • Gentoo X = Complete_Control
    • El Dorado Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #220 on: March 06, 2012, 01:16:32 AM »
The Google Maps API2 has been deprecated for about a year now. It is my understanding that Google stopped doing updates for it at about the same time. I think, needless to say, I no longer work with it or support API2 radar. I moved over to API3 ani radar quite some time ago and recommend that others consider doing the same.


« Last Edit: September 14, 2012, 12:49:35 AM by ELDoradoWx »
-Danny
-root is everything

Offline weathermayhem

  • Member
  • *
  • Posts: 41
Re: How to Run US Animated Radar on Google Maps
« Reply #221 on: March 10, 2012, 06:24:39 PM »
Ok, enough is enough...

I have been working on this project for a few days, I really need the radar map located at
 http://www.eldoradocountyweather.com/current/misc/google-maps-radar/us-mosiac-radar.html

I did start on the API v2, but you cant get a key any longer, I have been messing around with el dorado's source code, but I cannot get anything working.

So anybody have any directions to get that exact radar with the API v3 on my website

Thanks,
Weathermayhem

Offline Farmtalk

  • Fitzweather
  • Forecaster
  • *****
  • Posts: 4745
    • WV Waterfalls
Re: How to Run US Animated Radar on Google Maps
« Reply #222 on: April 01, 2012, 02:51:07 PM »
I have the API2 working fine, I was wondering if you could get severe warnings to display on there and to show county lines as well as add radars products such as echo tops and base velocity.

Thanks! :-)


« Last Edit: April 01, 2012, 09:13:45 PM by farmtalk »
Joe Fitzwater
Chief Meteorologist for WVNS-TV 59 in Beckley, WV

Work Page on Facebook -> www.facebook.com/meteojoe
Work Page on Twitter -> https://twitter.com/meteojoe
Waterfalls -> www.wvfalls.com

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2429
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #223 on: April 27, 2012, 01:42:20 PM »
Ok, enough is enough...

I have been working on this project for a few days, I really need the radar map located at
 http://www.eldoradocountyweather.com/current/misc/google-maps-radar/us-mosiac-radar.html

I did start on the API v2, but you cant get a key any longer, I have been messing around with el dorado's source code, but I cannot get anything working.

So anybody have any directions to get that exact radar with the API v3 on my website

Thanks,
Weathermayhem

Thanks.  I like how I got your page to center on Stillwater when I load it.

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Offline sperryruss

  • Member
  • *
  • Posts: 4
    • North Lake Jackson Weather
Re: How to Run US Animated Radar on Google Maps
« Reply #224 on: August 15, 2012, 01:02:05 PM »
I read all the posts in this thread.

I have been working on getting a radar going on my weather site. I was able to get some parts of the v2 google maps radar that ELDoradoWx has going on my test server. But it seems that the v2 is going to expire in 2013 from Google. Sounds like I should get the v3 that he has but looking at the source I don't really understand what to do to get it going.

I also tried the scripts that wmleler posted (JSON_generator.php and EasyWebFetch.php) but it does not work. Maybe something has changed in those scripts since he did them?

Also I read that the NWS is going to change to something called ridge2?

So, I am just looking for suggestions as what might be best for me to do for this type of a weather radar map on my website?

Thanks,
Sperry

« Last Edit: August 15, 2012, 01:05:46 PM by sperryruss »