What does "country" actually conform to?

  • 2
  • Question
  • Updated 6 years ago
The "conditions" feature of the API returns a field, "country". What does this value actually conform to? It appears to just be a wunderground-specific country abbreviation, which differs from the country iso 3166 value. Basically, it's difficult to get a correct, standard handle on what country a current location is representing because "country" seems to be proprietary, "country_name" does not (maybe, never) appear in responses, and the country iso 3166 does not follow spec ( http://gsfn.us/t/2r3rx ).
Photo of TFWEATHER

TFWEATHER

  • 4 Posts
  • 1 Reply Like

Posted 7 years ago

  • 2
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 123 Reply Likes
We've added our ISO matching to our docs. We fill in a country code for all locations. Not all locations have an ISO code, so we use our own. You can find the matching of our country codes to ISO's here: http://www.wunderground.com/weather/a...

Where are you finding examples of country_name not appearing?
Photo of TFWEATHER

TFWEATHER

  • 4 Posts
  • 1 Reply Like
Thanks for making that more clear, but this is still weird. Your table shows "TB = TB". But as you just said, Tibet doesn't have an ISO code, so your table is misleading. Also, are we talking about the value of "country" or "country_iso3166"? It sounds like you're talking about the value of "country". You guys really should be following the ISO3166 standard more closely and update it as there are changes, or should no longer call it ISO3166. If you guys want to have a Wunderground country code for Tibet that's fine, don't have a value for the country_iso3166 for it. It makes it more difficult to implement caching and normalization if what is to be expected isn't actually returned.
Photo of john.coll

john.coll

  • 1 Post
  • 0 Reply Likes
I absolutely agree. ISO 3166 is an international standard and needs to be respected as such. It really is confusing naming something that isnt ISO 3166 as ISO 3166.

I was trying to match UK and tried both ISO 3166 values "GB" and "United Kingdom" for the country and both failed to match. This clearly indicates that I am going to have failures when I try to match a legitimate country code into wundrground values. Quess I have to create a separate table and manually work out what the mapping is. Nasty.

Please fix this - you have a wonderful service just marred by this.
thanks