WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Custom Website Templates => Topic started by: Jasiu on February 11, 2021, 09:15:45 AM

Title: get METAR conditions problem when using API
Post by: Jasiu on February 11, 2021, 09:15:45 AM
As noted in this GitHub discussion:

  https://github.com/weather-gov/api/issues/168 (https://github.com/weather-gov/api/issues/168)

the "latest observation" for a station that is returned from the NWS API is not always a full METAR report. Those that are will have a rawMessage field and a non-empty cloudLayer.

The code currently doesn't check for this and the null result is written to the cache file.

I only tried this out when I saw the GitHub discussion. I don't have $useMetarAPI set true in my code.