2017-07-25 11 views
0

IBM天気予報データの予測の場合、昼夜の最高気温と最低気温を予測するキーがありますか?現在使用しています:IBM天気予報の昼夜の最高気温と最低気温

nightHigh = result.forecasts [0] .night.hi;
nightLow = result.forecasts [0] .night.wc;

API呼び出しから受け取ったJSONを次に示します。

{ 
"metadata": { 
    "language": "en-US", 
    "transaction_id": "1500467819366:918701294", 
    "version": "1", 
    "latitude": 36.11, 
    "longitude": -115.17, 
    "units": "e", 
    "expire_time_gmt": 1500469259, 
    "status_code": 200 
}, 
"forecasts": [ 
    { 
     "class": "fod_long_range_daily", 
     "expire_time_gmt": 1500469259, 
     "fcst_valid": 1500472800, 
     "fcst_valid_local": "2017-07-19T07:00:00-0700", 
     "num": 1, 
     "max_temp": 98, 
     "min_temp": 81, 
     "torcon": null, 
     "stormcon": null, 
     "blurb": null, 
     "blurb_author": null, 
     "lunar_phase_day": 25, 
     "dow": "Wednesday", 
     "lunar_phase": "Waning Crescent", 
     "lunar_phase_code": "WNC", 
     "sunrise": "2017-07-19T05:38:06-0700", 
     "sunset": "2017-07-19T19:55:22-0700", 
     "moonrise": "2017-07-19T02:05:45-0700", 
     "moonset": "2017-07-19T16:14:29-0700", 
     "qualifier_code": null, 
     "qualifier": null, 
     "narrative": "More clouds than sun. Highs in the upper 90s and lows in the low 80s.", 
     "qpf": 0, 
     "snow_qpf": 0, 
     "snow_range": "", 
     "snow_phrase": "", 
     "snow_code": "", 
     "night": { 
      "fcst_valid": 1500516000, 
      "fcst_valid_local": "2017-07-19T19:00:00-0700", 
      "day_ind": "N", 
      "thunder_enum": 0, 
      "daypart_name": "Tonight", 
      "long_daypart_name": "Wednesday night", 
      "alt_daypart_name": "Tonight", 
      "thunder_enum_phrase": "No thunder", 
      "num": 2, 
      "temp": 81, 
      "hi": 95, 
      "wc": 82, 
      "pop": 0, 
      "icon_extd": 2900, 
      "icon_code": 29, 
      "wxman": "wx1600", 
      "phrase_12char": "P Cloudy", 
      "phrase_22char": "Partly Cloudy", 
      "phrase_32char": "Partly Cloudy", 
      "subphrase_pt1": "Partly", 
      "subphrase_pt2": "Cloudy", 
      "subphrase_pt3": "", 
      "precip_type": "rain", 
      "rh": 44, 
      "wspd": 9, 
      "wdir": 135, 
      "wdir_cardinal": "SE", 
      "clds": 61, 
      "pop_phrase": "", 
      "temp_phrase": "Low 81F.", 
      "accumulation_phrase": "", 
      "wind_phrase": "Winds SE at 5 to 10 mph.", 
      "shortcast": "Partly cloudy", 
      "narrative": "Partly cloudy skies. Low 81F. Winds SE at 5 to 10 mph.", 
      "qpf": 0, 
      "snow_qpf": 0, 
      "snow_range": "", 
      "snow_phrase": "", 
      "snow_code": "", 
      "vocal_key": "D2:DA02:X3000300021:S300021:TL81:W06R02", 
      "qualifier_code": null, 
      "qualifier": null, 
      "uv_index_raw": 0, 
      "uv_index": 0, 
      "uv_warning": 0, 
      "uv_desc": "Low", 
      "golf_index": null, 
      "golf_category": "" 
     }, 
     "day": { 
      "fcst_valid": 1500472800, 
      "fcst_valid_local": "2017-07-19T07:00:00-0700", 
      "day_ind": "D", 
      "thunder_enum": 0, 
      "daypart_name": "Today", 
      "long_daypart_name": "Wednesday", 
      "alt_daypart_name": "Today", 
      "thunder_enum_phrase": "No thunder", 
      "num": 1, 
      "temp": 98, 
      "hi": 99, 
      "wc": 90, 
      "pop": 10, 
      "icon_extd": 2800, 
      "icon_code": 28, 
      "wxman": "wx1230", 
      "phrase_12char": "M Cloudy", 
      "phrase_22char": "Mostly Cloudy", 
      "phrase_32char": "Mostly Cloudy", 
      "subphrase_pt1": "Mostly", 
      "subphrase_pt2": "Cloudy", 
      "subphrase_pt3": "", 
      "precip_type": "rain", 
      "rh": 36, 
      "wspd": 11, 
      "wdir": 137, 
      "wdir_cardinal": "SE", 
      "clds": 75, 
      "pop_phrase": "", 
      "temp_phrase": "High 98F.", 
      "accumulation_phrase": "", 
      "wind_phrase": "Winds SE at 10 to 15 mph.", 
      "shortcast": "More clouds than sun", 
      "narrative": "Mostly cloudy. High 98F. Winds SE at 10 to 15 mph.", 
      "qpf": 0, 
      "snow_qpf": 0, 
      "snow_range": "", 
      "snow_phrase": "", 
      "snow_code": "", 
      "vocal_key": "D1:DA01:X2600280011:S280013:TH98:W06R03", 
      "qualifier_code": null, 
      "qualifier": null, 
      "uv_index_raw": 8.22, 
      "uv_index": 8, 
      "uv_warning": 0, 
      "uv_desc": "Very High", 
      "golf_index": 7, 
      "golf_category": "Good" 
     } 
    } 
], 
"address": "Las Vegas", 
"temperatureUnits": "fahrenheit", 
"phrase": "You don't need umbrella. Today's rain fall probability is 10% in Las Vegas." 

}

wc

答えて

0

風チル、しない最低温度の指標です。

最も近いのはresult.forecasts[:].max_tempresult.forecasts[:].min_tempで、1日全体の最高気温と最低気温のキーです。

「日中予測」 APIを使用しているようです。 「時間別予測」の APIを選択すると、毎日の気温データが表示され、昼夜の最小値または最大値を解析できます