avwx-rest / avwx-api

REST API for parsing aviation weather data
https://avwx.rest
MIT License
71 stars 89 forks source link

METAR based on coordinates: Reporting vs Non-reporting Stations #18

Closed vikaask closed 5 years ago

vikaask commented 5 years ago

METAR lookup based on coordinates pulls up non-reporting stations instead of prioritizing reporting stations.

Unable to use Reporting flag on search as well.

vikaask commented 5 years ago

In the past, the following lookup

https://avwx.rest/api/metar/33.2,-111.7?onfail=cache&options=info&format=json

would provide a METAR for KCHD airport. In the last 2 days, the same lookup is now trying to pull up a METAR from a non-reporting airport

{ "error": "5AZ3 does not publish reports", "timestamp": "2019-08-24T05:46:42.886751Z" }

This basically renders the Coordinates functionality useless as it would require being at the exact coordinates of a reporting airport to receive METAR data. In essence, I get the closest airport, but not the closest reporting airport's weather info.

devdupont commented 5 years ago

I have "reporting" and "airport" filters available for nearest station requests, so the logic is there. I'll need to change how parameters are validated to make this apply to report-based coordinate lookups.

vikaask commented 5 years ago

Yeah, strange though how coordinate lookups as recent as last week worked as expected. Any recent changes? I assume it's something related to the airport database changing to include those stations?

Sorry I'm pretty new to this so I'm still wrapping my brain around this stuff

devdupont commented 5 years ago

Yes the station database has been expanded to include all non-closed airports, seaplane bases, helipads, and remote weather stations. I used to pass the ident on the report services as is, but the expanding info database and desire to cut out non-existent station calls led me to validate idents against a comprehensive list.

The problem right now is that the idents and coordinates are converted at parameter validation. Iā€™d need to move station validation later or the filters earlier in order to make that happen. I might have time tomorrow. Otherwise it will have to wait until later in the week.

On Sat, Aug 24, 2019 at 9:30 PM vikaask notifications@github.com wrote:

Yeah, strange though how coordinate lookups as recent as last week worked as expected. Any recent changes? I assume it's something related to the airport database changing to include those stations?

Sorry I'm pretty new to this so I'm still wrapping my brain around this stuff

ā€” You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/avwx-rest/AVWX-API/issues/18?email_source=notifications&email_token=AATZ3DOAUMECTN23RBWMBX3QGHOEXA5CNFSM4IPFIFE2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5CKMZQ#issuecomment-524592742, or mute the thread https://github.com/notifications/unsubscribe-auth/AATZ3DPZHADCOFR6PQ3JIETQGHOEXANCNFSM4IPFIFEQ .

devdupont commented 5 years ago

I found a bug that was the source of this error after adding the airport filter. As mentioned above, I've added the filters, but the default values should suffice. The onfail default has also been changed to cache, so your query params can be simplified to:

https://avwx.rest/api/metar/33.2,-111.7?options=info

vikaask commented 5 years ago

Awesome! Thanks for the update and the quick fix!

tthamel commented 5 years ago

wait what dude is based out of chandler ? šŸ˜‚

On Fri, Aug 23, 2019 at 10:41 PM vikaask notifications@github.com wrote:

METAR lookup based on coordinates pulls up non-reporting stations instead of prioritizing reporting stations.

Unable to use Reporting flag on search as well.

ā€” You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/avwx-rest/AVWX-API/issues/18?email_source=notifications&email_token=AA3YXOVDJG65PALA7FE7CD3QGDCZ7A5CNFSM4IPFIFE2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HHFF4PA, or mute the thread https://github.com/notifications/unsubscribe-auth/AA3YXOVG2ITJHXZANPBOIXTQGDCZ7ANCNFSM4IPFIFEQ .

vikaask commented 5 years ago

Yours truly haha

devdupont commented 5 years ago

As long as you live between https://avwx.rest/api/station/CYLT and https://avwx.rest/api/station/NZSP AVWX should work for you šŸ˜„