Skip to content
This repository was archived by the owner on Sep 3, 2022. It is now read-only.

Filter functions

kirkmawa edited this page Dec 27, 2012 · 1 revision

Here, I'll attempt to explain what the included helper functions do in phpqbt. I originally wrote the code to get various information from warning products and insert them into a database. I've decided to leave the helper functions in the course of making phpqbt a standalone package.

get_vtec

One argument: the full warning text. Returns an array of all the Valid Time Extent Codes (or VTEC) in the warning text.

get_ugc

One argument: the full warning text. Returns a non-delimited list of UGC zones the message is valid for. If you want this in an array, simply comment out the $ugc = implode ($ugc); line in the function.

dbid_wng

One argument: any VTEC. Returns an ID code based on the issuing WFO, event type, and event tracking number.

get_polygon

One argument: the full warning text. Returns a list of latitude/longitude points, these draw the warning polygon on a map.

get_tmloc

One argument: the full warning text. Returns an indexed array with elements lat1, lng1, lat2, lng2. These are two lat/long points that represent a one-hour storm track, if it's given. This is typically only present in Severe Thunderstorm and Tornado warnings.

evt_times

One argument: any VTEC. Returns an indexed array with elements eff and exp. These are UNIX timestamps of the effective and expiry time of a message.

all_ww_points

One argument: the full warning text. This reads the parallelogram points of any watches present in an incoming SEV message. Returns an indexed array with elements named by currently effective watches. These elements contain lat/long point lists just like those returned by get_polygon.

get_pg_timezone

One argument: space-delimited polygon points returned by get_polygon. Returns the Olson timezone id of the center of the polygon.

Clone this wiki locally