Google hurricane maps update

29 September 2005 @ late at night | Comments (64)

After many hours of tinkering with every latest Web 2.0 fad, I’ve managed to scrape together an improved implementation of storm tracking with Google Maps.

Tools

Ajax

I chose to use Sajax for the XMLHttpRequest transactions, for which I could also have used XAJAX, eliminating the need for callback functions and providing some nifty DOM manipulation functions via XML response, but I didn’t stumble upon XAJAX until just recently and didn’t feel like re-rebuilding. I also really would have loved to jump on Rails for this one, but it’ll have to wait until another day. That one’s been on my to-do list for months now…

Permalinks

Moving toward Ajax presents some challenges by itself, like allowing for permalinks. Not only did it need to be able to accept permalinks for any map created via the Ajax interface, but also redirect old permalinks to the new format.

The old permalinks relied on two querystring variables, year & storm (?year=2005&storm=katrina); new permalinks use chained storm ids that consist of year/storm id (?2005s1&2005s12). In order to not break old permalinks there is an initial querystring check, followed by a 301 permanent redirect if it finds a storm match. All of the querystring processing is done server-side via PHP.

So the coolest thing about the permalink change? Now you can compare stuff. For instance, Camille vs. Katrina or Gilbert vs. Allen.

Layout

I’ve tried to keep everything as cross-browser as possible, but liquid layouts are quite a pain so please report any “deal-breaker” strangeness you encounter. I’ve tried this thing out in a ton of browsers, including all of Google Maps’ supported browsers, without finding any major bugs.

The worst layout issue I’ve found is Opera 8’s miscalculation of the body/html 100%. I could use overflow:hidden to prevent the scrolling page, but there really is no way of performing an Opera-only CSS rule and it’s not a horrible usability hit, since the extra page height/width and scrollbar doesn’t negatively affect page functionality.

Data

I managed to migrate all data into MySQL that I had collected from Unisys and formatted as XML. This allows for more powerful and easier querying, less overhead from XML processing from within PHP, and more potential for cool additional features, like “smart-searching” (if I ever get around to implementing them). It also eliminates the possibility of more than one person triggering a cache update during heavy traffic by flagging a cache lock in the database while an update is in progress.

Observations

Was it necessary to use Ajax? Well… quite honestly, no. But Google Maps is not accessible to anyone without JavaScript enabled anyways, so that exempted me from a few of the major Ajax mistakes.

Additionally, I feel that I’ve done a fairly good job navigating the remaining items on that list by simplifying the interface, providing immediate visual cues (but not too many), cascading local changes to the page title and current storm list, allowing for permalinks, and (_not Ajax-related_) making the liquid layout work consistently in all supported browsers.

To Do

  • Live updating of page titles via both permalinks & Ajax DONE
  • Center on storm when selected DONE
  • Display storm list w/ “Current Map” pane active for permalink entrance DONE
  • Add “Select All / None” for storm list DONE
  • Display last updated timestamp for current year’s data DONE
  • Zoom-to-bounds for each storm’s link
  • Smart-searching… popup? separate page?

Known Issues

  • Solve occasional initial connection lag issue (Sajax bug?)

64 comments

2

Thanks, Alicson. I don’t believe I’ve ever been sweat before.

Andrew → compooter.org
3

bug on line 8

matt vaughn
4

Could you be any more specific? For instance, what version of OS & browser are you using?

Andrew → compooter.org
5

this is amazing, how do you combine the data to show the tracks and where do you download the software to generate your own google application like this embedded into the web page?

I’m looking to do something similar with natural hazards but am new to the google hacking world and don’t know what’s where!

Many thanks

Lucy

Lucy
6

Hi,

I’am having trouble printing bubbles for a
selected hurricane. I have tried all combinations
of clear,reset,link and list actions.

One time it worked but couldn’t repeat it.

I would like to present these bubble tracks tonight
at 7 PM Pacific Time to a Weather Club.

Could you help me before the club meeting?

Thank You,
John

John Satterlee
7

I’ve updated the maps with a print stylesheet so hopefully now it’s a little easier to print. It still overflows a bit into a second print page, but it’s much better than before. Thanks for alerting me to the problem, John.

Andrew → compooter.org
8

I would love to add your address centering code to the site I maintain at austinaa.org.

Craig → austinaa.org
9

I’m using Ontok for the geocoding. The code I’m using is pretty much taken straight from their REST example. Although, I’ll likely be changing geocoders soon because I don’t like being limited to only the United States; an international solution would be ideal.

Editor's note: I am now using Yahoo for geocoding.

Andrew → compooter.org
10

It’s an awesome app. You should add the Google scale bar, so I can eyeball/measure distances.

cdwolff
11

Andrew, fantastic tool. I really like the ability to view past hurricanes – I wanted to see the 1979 David, and voila, there it is. Thanks for this—and all your contributions to the Textpattern world.

mistersugar → mistersugar.com
12

I would appreciate having the cities in Mexico placed on the map to see how close the storm comes to a specific place such as Playa del Carmen on the Mayan Riviera where I have a house.
Otherwise, an excellent map and many thanks.
Daniel W. Miller

Dr. Daniel W. Miller → danielwmiller.net
13

Daniel, unfortunately the actual attributes of the map itself are out of my control, since it is entirely the property of Google Maps.

Andrew → compooter.org
14

One of the most refined mashups I have seen. Adding a (transparent :->) north arrow and a scale bar would make it really a cartographers friend.

Is it possible to open the source in order to map other things, like free GPS tracks articles?

GeometaJoe → geometa.info
15

Ok, I’ve added the scale reference bar, which is actually a feature that I hadn’t known existed within the default Google Maps. I’ll look into perhaps some sort of compass solution; perhaps a toggle-able (Flash?) overlay. Thanks for the feedback.

As far as opening the source, it’s really nothing that majestic. Most of the muscle is done from within JavaScript; PHP is used mainly for scraping, updating, and retrieving the MySQL data. Perhaps I’ll roundup the tools and do some basic demos? If you have any specific questions I’d be happy to answer.

Andrew → compooter.org
16

That was rapid! When zooming in I noticed that the track line is being drawn from the latest observation to the origin. Would’nt it be more intuitive to draw it the other way round?

GeometaJoe → geometa.info
17

Another vote for a date and time stamp

Douglas Johnson
18

So just to clarify, GeometaJoe – you’re referring to moving the white ‘pin’ marker to the origin point, rather than the finish point of dissipated hurricanes? And Douglas, I guess the ‘last updated’ would apply to only the current year… let me see what I can do.

Andrew → compooter.org
19

I found a link to the hurricane tracker off of an article about Google Vs. Microsoft. This is amazing what you have done. I have tried a lot of Hurricane tracking software on my computer and this beats most of them because of the more detailed results of the location near to where I live.

Keep up the good work.

Sperry Russ → newcreations.us
20

I’m just referring to the drawing order of markers and the coordinates of the tracking line which should be from the origin to the finish point of the hurricane.

Another nice thing for better readability would be to suppress overlapping markers – just the markers (except origin and finish marker); now, they look overcrowded in default (reset) zoom level. The more you zoom in from level to level the more will appear.

Permalink is a nice feature. I’m suggesting here that the zoom level (“&z=4”) and map/satellite/hybrid type (“&t=k”) should also be maintained/accepted.

Another new call could take over the remaining known parameters from Google Maps: (“ll=47.349444,8.719167&spn=0.1,0.1”). If you add this complementing request (without hurricane ids) you could add your service to Wikipedia: see e.g. the location link in the info box of http://en.wikipedia.org/wiki/New_orleans : When users click on New Orleans (or save the alternate link) they can check if a hurricane is passing nearby.

GeometaJoe → geometa.info
21

Ok – later today (post- Chargers vs Eagles) I’ll look into implementing your suggestions. I appreciate your feedback. Here’s what I’ll try adding:

  • Zoom (&z=4)
  • Map view type (&t=k)
  • Lat/Lon (&ll=x,y)
  • Last updated time
Andrew → compooter.org
22

Ok, I’ve added latitude/longitude and zoom permalink support, as well as reporting the last updated timestamp. I’ll look into the map type perhaps tomorrow.

Andrew → compooter.org
23

I like the way you presented the data, Very Slick. I wanted to do the same thing, but for a different set of data, seismic stations. I was hoping to get your premission to “steal” your code as a base for my project.

Brian → dtm.ciw.edu/savage
24

Depends on what you mean by “steal” ;-)

Andrew → compooter.org
25

“Steal” – copy you code, modify it for my purposes, give you credit (link) for initial design

Brian → dtm.ciw.edu/savage
26

Steal away, Brian. I must warn you that my JavaScript likely carries with it some pretty hefty memory leaks in Internet Explorer (not uncommon for most Google Maps applications) that I’ll be trying to iron out over the next couple of weeks. I’d be happy to help you if you run into any problems. Additionally, the Usenet group for Google Maps API can also be very helpful.

Andrew → compooter.org
27

I can’t overstate how impressed I am with your hurricane tracking gmap. After hurting my leg 3 wks ago and trapped indoors I elected to try my hand at hacking gmaps. I’m not off the first page yet and after seeing your work guess I should just give up now! Thanks for such an awe inspiring gmap to whoever created it.

Regards, Vince Flagler Beach, FL

Vince → geocities.com/vcomunale
28

After a few days of using your code as a base, I have something worth looking at.

http://exit13.no-ip.org/~brian/weed/weed.cgi

Thanks very much for your beautiful design.

Brian → dtm.ciw.edu/savage
29

Will the storm names for West Pacific Storms prior to 2004 be added at a later time?

Ron → njkproject.info
30

Perhaps, but only if I add them manually (which would be a lot of work). However, this is “on my list” of things that should be addressed. I’m sort of limited at the moment, since I am bound by the best track data sets available to me from the Joint Typhoon Warning Center, which do not include storm names.

Andrew → compooter.org
31

I’ve done a bit of searching around and I think it will be possible to add all the W. Pacific storm names. I’ll have to change data sets and write a new import script, so it’ll take me a short while.

Andrew → compooter.org
32

Andrew,

Very nice piece of work!!! I really love how you add the layers dynamically based on the year and toggle. Could I “borrow” you general code here for a non-profit educational site? Ok, maybe just outright use it, but it would be ASP.NET. I would be happy to email you details but would rather not post the site on here. I would be happy to give you full credit as this is a very important site.

One thing I would need to figure out is how to draw a bounding box around multiple markers to select more then one marker as I would be creating a query from this.

Donald Curry
33

Wow, love your little piece of work. It’s bookmarked along with the NOAA Hurricane Center’s web site. Useful, simple, and original.

A little note however… the recent trackings for Tropical Storm Zeta have it listed as a “tropical depression” on January 2nd and 3rd, when in fact it has strengthened over these past two days.

Your tracking lists a wind speed of 25kts, when in fact it is experiencing winds of 55kts with gusts to 65kts (NOAA-NHC).

Just thought you might want to know.

Jacques Daviault → n/a
34

First, let’s say that your hurricane map is very useful. It’s a very good idea to use the Google map engine to display tropical cyclone data.

Second, there is something buggy in your database. The storms of the last year (2005) have been missorted. Normally, TS Arlene should have index #1, TS Bret #2 and so on… Then TS Zeta must be indexed as #31. But in your database, indexes have been inverted, so Zeta is now #1 then Arlene as #31. I looked in other years and everything is working fine.

Third, I’m sorry for my poor English…

Goodbye

The Shadow Knows → en.wikipedia.org/wiki/User:The_Shadow_Knows
35

Thanks for the alert. It looks as though Unisys moved the 2005 data to a different format, but the Best Track still isn’t available. I’ll update when I get a chance.

Andrew → compooter.org
36

This is great! We might just use this internally for our marketing folks and storm tracking teams here at Briggs & Stratton. Hurricanes have a huge impact on Generator sales.

Thanks!

Joseph → briggsandstratton.com
37

I love the layout and general attention to detail you have here. Excellent! The only thing I can’t figure out is how did you do that Legend and have it overlaid on the Google Map?

Cheers!

Ryan
38

@Ryan: I used a simple technique involving relative/absolute positioning. Basically, the map container div is styled to position:relative and the map legend div is using position:absolute.

Andrew → compooter.org
39

Hi,

Awesome application!!! Two questions: Where are you pulling this data from? And can I get I get you do to a dump of one of the hurricanes (Rita). I need all raw data (lat, long, max. sustained wind, category of storm, etc, etc) you’re displaying for an app. I’m developing. You would of course me noted as the source and your help is GREATLY appreciated.
-Jordan

Jordan Spatz
40

The data is from Unisys and here’s a text file containing data for Hurricane Rita.

Andrew → compooter.org
41

SWEET! Thanks for the help!!! I was gonna to hand copy down all this information from your track data otherwise. And that’d be no fun..so I REALLY do appreciate it!!!

Jordan Spatz
42

This has to be the best map going of its kind. I run a news website on the Gulf Coast and I have a few questions for you. 1.) Will you be updating for 2006? 2.) Is the map auto updating once the data source for a new storm is setup? 3.) Would you be willing to liscence your code for the mashup out to someone else to reproduce? Thanks! This map is awesome!

Mike Wilson → 2theadvocate.com/
43

@Mike, thank you for the positive feedback.

Yes, this map will be updating for 2006. There is a light transition from one year to the next, migrating the “current” data to an archived format. There is also a small bit of maintenance required once a “best track” data set is released, but it’s otherwise mainenance-free (unless the site experiences unusually heavy traffic).

As far as licensing the code out, I’ll contact you via email.

Andrew → compooter.org
44

When you hover your mouse over a pin, the wind speed is noted in mph. However, the wind speed you are actually displaying at the moment is knots, incorrectly labeled as mph.

Take a look at any storm’s popup info window and you’ll see that you have the correct information in that.

Chris
45

Fixed, thanks.

Andrew → compooter.org
46

It would be cool to see one storm and all of the tracks from the advisory to show trend analysis and track movements.

Aerocream → swflhams.com
47

Andrew…you’ve done an excellent job with this app! I’m glad I found it. I check it everyday for Atlantic status. One quick question…would it make sense to default the map to current year and have a pulldown for prior years? Maybe even default the maps to show active storms automatically?

Greg
48

@Greg, that’s a pretty good idea ;-)

Done.

Andrew → compooter.org
49

Andrew,

What a great app! Would you please contact me re: licensing your code? You have accomplished something very similar (and in a very graceful way!) to a project I want to start.

Thanks!
David

David
50

Great site for lots of information. Is there a directory of local symbols? I don’t read any of the Japanese alphabets very but some of the symbols don’t even relate to that. I’ve figured out traffic lights, bus stops and train stations but it would be helpful to have a complete listing.

George Petruff
51

George, I’m not sure I understand your question.

Andrew → compooter.org
52

Andrew, I’m looking at Nagaski and Isahaya, Japan (my daughter is living and teaching in Isahaya right now) and I’m trying to make sense of some of the obvious symbols (not the Japanese writing…Kanji, Hiragana or Katakana) like the one that looks like a running person or the open book or the building. Traffic lights are red/yellow/green flags and bus stops are small circles on a verticle line with a base. I just wondered if the was a legend or some kind of list of these symbols available somewhere.

Hope that clarifies my request.

George Petruff
53

Ah ok, I see what you mean now. The map platform is Google Maps, so everything you see on that map besides the hurricane path overlays is made by Google. Perhaps they have a legend somewhere?

Andrew → compooter.org
54

I shall check it out…...thanks. I’m watching Shanshan now as it looks like it will run right over where my daughter is living.

George Petruff
55

Hi Andrew, We would like to have your website listed on our Google Maps Directory at http://www.gmapsdirectory.com Feel free to visit the directory and submit your site.

Abraham Leiderman → gmapsdirectory.com
56

Your site has been added to mapshark.com. Great job on the map.

Andrew Mitton → mapshark.com
57

Two hurricane hitting FL not listed in 1987 book “Hurricane Climatology for the Atlantic and Gulf Coasts of United States”. Namely Storm 5 on 7/30/1993 and Storm 1 on 6/24/1945. Can you provide me the source of data for these two hurricanes?

Mark Schwartz
58

Best track data for:

Andrew → compooter.org
59

Hi Andrew,

I’m currently compiling a survey of innovative online GIS for natural hazards and disasters and would love to get some feedback from you – can you drop me a line on l.stanbrough AT ucl.ac.uk.

Great work!

Lucy Stanbrough

Lucy stanbrough → the-online-gis-survey.co.uk
60

Hi,
I was looking at the Unisys data that you pointed to and it all looks like historical data. Do you know of a source of fairly real time Hurricane data?

Thanks,
Stephen

Stephen → milkshakemedia.com
61

Is it possible to use this map to do a kind of turn on and turn off for my map to track storms when they are active. My site is www.thebutlerchain.com/mymap.htm

What I would love to do is kind of a KML overlay when a client wants to track a storm compared to their home on my site? Could that be possible like Google is talking about.

Christopher → thebutlerchain.com/mymap.htm
62

the conversion of kt to miles is not correct.exampleL10 k=6.2 m

f vincenty
63

WOULD BE NICE IF YOU COULD PRINT A COPY TO COMPARE PLOT FROM ONE DAY TO THE NEXT.

DVC TEXAS
64

@f vincenty:

You’ve got your units and prefixes all mixed up.

@DVC:

Yes, that would be very nice. These maps are generated utilizing Google Maps. Any printing difficulties you may be experiencing are caused by Google Maps, not my application.

You may have better luck if you try taking a screenshot (or hitting the “print screen” button).

Andrew → compooter.org

Post your comment

Jump back to top

Name

Email (kept private)

Website

Message*

Textile Help

* Off-topic or offensive comments may be edited or deleted.

Previously

Elsewhere