avwx-rest/avwx-api

Randomly outdated GeoNames metar

JanC opened this issue ยท 3 comments

JanC commented

Hi @flyinactor91 ๐Ÿ‘‹
I noticed that the api.geonames.org services randomly returns outdated metar when querying by coordinates.

Here are two consecutive calls with the same parameters with different results. The correct one is the 1st one (210920Z)

curl http://api.geonames.org/findNearByWeatherJSON\?lat\=35.237\&lng\=-120.643\&radius\=200\&username\=myusername | jq ".weatherObservation.observation"
"KSBP 210920Z AUTO 00000KT 10SM BKN020 BKN033 09/08 A3007 RMK AO2 T00890078 $"

curl http://api.geonames.org/findNearByWeatherJSON\?lat\=35.237\&lng\=-120.643\&radius\=200\&username\=myusername | jq ".weatherObservation.observation"
"KSBP 161415Z 00000KT 1 3/4SM -RA BR OVC005 11/09 A2998 RMK AO2 RAB12 P0000 T01060094"

This happens quite sporadically.

Have you had issues with that before? I wonder if it would be better to always query the aviationweather.gov service for the actual report and use geonames.org to only to get the station name and discard its returned report here

https://github.com/avwx-rest/AVWX-API/blob/8d21e3e89acb61c98fcd20bae1a650e2b861985b/avwx_api/handle/metar.py#L123

cheers

Oh wow that report is inconsistent. I was hoping to not make two calls, but clearly data accuracy is more important. Yeah I'll be sure to simplify that handling function.

f39e261 removed the code referencing the report fetched from GeoNames using only the station as though it was supplied by the user.

JanC commented

thanks!