Sunday, March 10, 2024

Staying out of the Ditch (Part II)

 

Staying Out of the Ditch

About four years ago, now, we had a helluva scare in Wyoming. A sudden gust of wind pushed us into the ditch. Emmy was driving; we had slowed down to about 45mph, thankfully.  

I'd like to try to avoid that again, if possible.

See Part I of this post where I cover off how I get the forecasted weather conditions for my current location.

A quick recap:

  • there's a GPS receiver on top of the RV that tells me my current location, as a latitude/longitude pair every minute
  • I'm calling the NOAA's weather API to get the weather forecast for my current location
  • I'm also calling the NOAA's Alerts API to pull any severe weather conditions that are around me.


"The World Needs More Lerts."

Just like I take my current latitude and longitude and get the hourly weather forecast for "here", I pass those coordinates into the NOAA Alerts API. The NOAA call returns a JSON packet with no alerts, or the ones issued for my area.



NOAA returns a ton of information. And, as before in the forecast return data, I only clip out the information I think is necessary to display.  That's

  • The Event (eg. Wind, Snow, Rain, Flood...)
  • Urgency (Immediate, Expected, Future, Past)
  • Certainty (Observed, Likely, Possible, Unlikely)
  • Severity (Extreme, Severe, Moderate, Minor)
  • SAME Code
  • Details

You can read the NOAA documentation for more information about the return values.   The first four are self-explanatory. The SAME code is a number that you can enter into a Weather Radio that supports such codes. Punch the SAME code into the weather radio, and it will watch for alerts in this area. A SAME code designates a geographic area (more or less).

The last column, details, is simply a constructed hyperlink to the details on this alert. Click it and it will retrieve the full alert data.

Here's an example:



We'll "start to end" Part II here.

Part III, when I get around to it, will go into the implementation details.  But before I end Part II, some thoughts on the "Why?"

Why Bother?

Isn't this "re-inventing the wheel"? Isn't this information -- and more -- already available from a number of apps on any phone in 2024?

Sure.

So why?

A couple of reasons, some selfish, some pragmatic:

  • The apps on a phone are "pull" in nature. I have to take action to get the information. I have to stop watching the road, and press buttons on my phone to request the data.  Pulling data in 2024 is insanely stupid, IMO. The computer(s) have all of the capability to push data to me.
  • The apps on a phone have a user-experience that appeals to their developers. That may or may not be the way I want to consume the data.
  • The apps on the phone have a UI that changes whenever the developer feels like it. That sometimes aggravates me. I just get the muscle-memory set to use the app with minimal thought, and the developer decides to change things.

I can continue to refine the experience to tailor the output to my needs.  Some of the things I've thought about for V2 are:

  • tailor the wind warnings for heightened alert if the direction will be broadside
  • play the Star Trek Red Alert sound when some urgent alert comes in
  • pull up alerts and forecasts for where I'm heading, instead of just where I am
  • add a NOAA radar screen so I can see a current radar

And so on. I'm sure I'll come up with some new ideas for the next revision. Even more so after I use this one in the RV for a while.









No comments :

Post a Comment