How to differentiate between the PWS and airport when I have just the weather station ID?

  • 1
  • Question
  • Updated 4 years ago
Hi there

1. If I want to get the current condition from PWS I use:
http://api.wunderground.com/api/.../q...

2. If I want to get the current condition from the airport I use:
http://api.wunderground.com/api/.../q...

As you see the pws uses the 'pws:'.

So the question is how to differentiate between the PWS and airport when user gives me just the weather station ID? ... in our case IPLOVDIV10 and EGLC.

Br
Waldemar
Photo of WaldemarH

WaldemarH

  • 3 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of WaldemarH

WaldemarH

  • 3 Posts
  • 0 Reply Likes
After some inspection of the map it looks that all airports have 4 chars long id.

Now the question is what will happen if there will be more airports then there are 4 chars variations.
Photo of John Belmonte

John Belmonte

  • 18 Posts
  • 1 Reply Like
I don't think this will be a problem. Four alpha characters gives 456,976 (26^4) possible combinations. If four alpha-numeric characters are used, then the total possible combinations is 1,679,616 (36^4).

According to the World Fact Book, there were 41,821 total airports in 2013, less than 10% of the total possible alpha combinations.

https://www.cia.gov/library/publicati...
Photo of WaldemarH

WaldemarH

  • 3 Posts
  • 0 Reply Likes
Hi John

Thanks for the information... it's just what I needed. :)