ios – National Weather Service (NOAA) REST API returns nil for parameters of forecast

ios – National Weather Service (NOAA) REST API returns nil for parameters of forecast

The nil values, from what I can understand of the documentation, here and here, simply indicate that the data is unavailable.

Without making assumptions about NOAAs data architecture, its conceivable that the information available via the API may differ from what their website displays.

Missing values are represented by an empty element and xsi_nil=”true” (R2.2.1).

Nil values being returned seems to involve the time period. Notice the difference between the time-layout keys (see section 5.3.2) in 1 in these requests:

The data times are different.

<layout-key> element

The key is derived using the following convention:

  1. “k” stands for key.
  2. “p24h” implies a data period length of 24 hours.
  3. “n7” means that the number of data times is 7.
  4. “1” is a sequential number used to keep the layout keys unique.

Here, startDate is the factor. Leaving it off includes more time and might account for some requested data not yet being available.

Per documentation:

The beginning day for which you want NDFD data. If the string is empty, the start date is assumed to be the earliest available day in the database. This input is only needed if one wants to shorten the time window data is to be retrieved for (less than entire 7 days worth), e.g. if user wants data for days 2-5.

Im not experiencing the randomness you mention. The folks on NOAAs Yahoo! Groups forum might be able to tell you more.

ios – National Weather Service (NOAA) REST API returns nil for parameters of forecast

Leave a Reply

Your email address will not be published.