Open flaparoo opened 1 year ago
I agree with your assessment. Right now, the only validity check is made against the cached version, not one that comes in as a new report, which is what I guess happened here.
Under normal circumstances, the API is designed to return expired reports if that is still the latest one provided by the regional service. However, I do agree that an invalid report, even if it's the most recent, should trigger the nearest fallback when explicitly specified. I don't agree with changing it under other circumstances.
This work can be included alongside #33 since they both involve the nearest onfail handling.
Hi
My interpretation of requesting a TAF for the nearest airport would be that the nearest valid report is returned. However, the API currently returns a TAF from the nearest airport, regardless whether or not it is still valid.
For example, the request
https://avwx.rest/api/taf/-31.52,115.94?onfail=nearest
resulted in (filtered forend_time
,meta
andraw
):Note the report end-time of "0409" but the request was made almost 2.5h later (ie. after "0411"). Also note that I've tried the
onfail=nearest
option, but it didn't make a difference.An airport with a 24/7 TAF (YPEA) would be available only slightly further away from the requested location.