阿里云首页 数智气象引擎 相关技术圈

高分辨率网格72小时逐小时天气预报

本文介绍如何通过数智气象引擎 Java SDK调用Weatherforecast方法获取数据。

前提条件

请仔细阅读通用流程文档中相关内容,了解代码操作步骤。

接口说明

接口说明:气象格点预报72小时频次1小时数据按经纬度查询

空间分辨率:5公里分辨率(0.05°),70°E~140°E,0°N~60°N

时间分辨率:逐1小时

更新频率:2次/天;北京时间08点、20点

通用请求参数

名称

类型

示例值

描述

OrderId

String

aliyunape_meteor12_public_cn-*********

查看订单

Endpoint

String

aliyunape.aliyuncs.com

固定值,请勿修改为其他值

AccessKeyId

String

LT************C

用于标识用户

AccessKeySecret

String

k9*******************el

用于验证用户的密钥,必须保密

注意

以上提供的参数是针对数智气象引擎下所有产品都会用到的参数。

请求参数

参数名称

是否必选

说明

值示例

备注

lon

经度

139.95

经度,范围(70°E~140°E)

lat

纬度

49.95

纬度,范围(0°N~60°N)

代码示例

import com.aliyun.aliyunape20210908.Client;
import com.aliyun.aliyunape20210908.models.WeatherforecastRequest;
import com.aliyun.aliyunape20210908.models.WeatherforecastResponse;
import com.aliyun.teaopenapi.models.Config;

public class WeatherforecastHours {
    /**
     * 高分辨率网格72小时逐小时天气预报(YB-72hour-sj)
     * 按经纬度查询数据,预报时间为yyyymmdd080000或yyyymmdd200000
     * 逐1小时
     * @param
     * @return
     */
    public static void main(String[] args) {

        WeatherforecastRequest request = new WeatherforecastRequest();
        request.setOrderId("aliyunape_meteor12_public_cn-*******");
        request.setLon("103.71");  //经度
        request.setLat("36.10");  //纬度

        Config config = new Config();
        config.setEndpoint("aliyunape.aliyuncs.com");
        config.setAccessKeyId("LT****************LC");
        config.setAccessKeySecret("j**************************SI");

        try {
            Client client = new Client(config);
            WeatherforecastResponse response = client.weatherforecast(request);

            System.out.println("code:" + response.getBody().code);
            System.out.println("message:" + response.getBody().message);
            System.out.println("requestId:" + response.getBody().requestId);
            System.out.println("success:" + response.getBody().success);
            System.out.println("data:" + response.getBody().data);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

示例结果

code:200
message:操作成功
requestId:B9958BCB-21D7-5858-A8DD-C99F1B25473E
success:true
data:[{start_forecast_time=20211018080000, pre=[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.05000000074505806, 0.05000000074505806, 0.14000000059604645, 0.3100000023841858, 0.6000000238418579, 0.7699999809265137, 0.7300000190734863, 0.5699999928474426, 0.5199999809265137, 0.6000000238418579, 0.8700000047683716, 0.949999988079071, 0.5600000023841858, 0.14000000059604645, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0], tmax=286.0799865722656, ect=[2.4000000953674316, 2.5399999618530273, 2.7899999618530273, 2.559999942779541, 2.3499999046325684, 2.190000057220459, 3.2200000286102295, 4.28000020980835, 5.380000114440918, 12.0, 18.610000610351562, 25.270000457763672, 22.729999542236328, 20.200000762939453, 17.649999618530273, 27.43000030517578, 37.2599983215332, 47.02000045776367, 44.43000030517578, 41.86000061035156, 39.310001373291016, 53.33000183105469, 67.37000274658203, 81.37999725341797, 86.43000030517578, 91.41000366210938, 96.45999908447266, 97.04000091552734, 97.69999694824219, 98.31999969482422, 96.73999786376953, 95.16999816894531, 93.56999969482422, 93.18000030517578, 92.79000091552734, 92.36000061035156, 92.80000305175781, 93.16000366210938, 93.5999984741211, 92.51000213623047, 91.41000366210938, 90.33000183105469, 89.87000274658203, 89.41000366210938, 88.98999786376953, 90.38999938964844, 91.7699966430664, 93.20999908447266, 92.05000305175781, 90.93000030517578, 89.7699966430664, 85.08000183105469, 80.37000274658203, 75.68000030517578, 76.12999725341797, 76.54000091552734, 77.05999755859375, 73.16000366210938, 69.30999755859375, 65.44000244140625, 59.52000045776367, 53.61000061035156, 47.689998626708984, 47.61000061035156, 47.52000045776367, 47.439998626708984, 50.22999954223633, 53.0099983215332, 55.79999923706055, 66.98999786376953, 78.16999816894531, 89.36000061035156], wiu_wind=[0.25, -0.2800000011920929, -0.8899999856948853, -1.0800000429153442, -1.4299999475479126, -1.8799999952316284, -1.0299999713897705, -0.9300000071525574, -0.7599999904632568, -0.8600000143051147, -1.8700000047683716, -1.659999966621399, -2.0299999713897705, -1.590000033378601, -0.20999999344348907, 0.05999999865889549, -0.47999998927116394, -0.44999998807907104, -0.20000000298023224, 0.5899999737739563, 1.5099999904632568, 0.30000001192092896, -0.1599999964237213, -0.14000000059604645, -0.7400000095367432, -1.0399999618530273, -1.2000000476837158, -1.0499999523162842, -1.1100000143051147, -1.399999976158142, -1.2200000286102295, -1.0099999904632568, -0.6000000238418579, -0.949999988079071, -0.5, -0.12999999523162842, -0.20000000298023224, -0.3700000047683716, -0.3199999928474426, -0.47999998927116394, -0.6800000071525574, -0.7699999809265137, -0.5400000214576721, -0.5, -0.5899999737739563, -1.159999966621399, -0.8199999928474426, -1.2699999809265137, -1.1799999475479126, -1.7000000476837158, -1.2799999713897705, -1.409999966621399, -1.25, -1.0199999809265137, -1.440000057220459, -1.5499999523162842, -1.2300000190734863, -1.1799999475479126, -1.1399999856948853, -0.6800000071525574, -0.7099999785423279, -0.5299999713897705, -0.28999999165534973, -0.41999998688697815, -0.15000000596046448, -0.2199999988079071, -0.6200000047683716, -0.6100000143051147, -0.949999988079071, -1.0700000524520874, -0.4699999988079071, 0.07999999821186066], tmin=0.0, erha=89.48999786376953, lon=103.71, erh=[82.43000030517578, 75.6500015258789, 69.56999969482422, 64.55999755859375, 61.959999084472656, 55.47999954223633, 46.380001068115234, 45.13999938964844, 44.86000061035156, 45.2599983215332, 44.63999938964844, 41.900001525878906, 39.900001525878906, 38.77000045776367, 38.70000076293945, 39.86000061035156, 47.970001220703125, 54.369998931884766, 63.08000183105469, 69.11000061035156, 73.47000122070312, 78.23999786376953, 81.83000183105469, 81.08000183105469, 80.12999725341797, 76.47000122070312, 72.27999877929688, 69.5, 65.91000366210938, 63.77000045776367, 66.30000305175781, 64.80000305175781, 65.79000091552734, 54.68000030517578, 69.88999938964844, 77.69000244140625, 78.08999633789062, 78.62000274658203, 81.22000122070312, 81.62000274658203, 82.16000366210938, 65.41999816894531, 66.7699966430664, 66.80999755859375, 89.48999786376953, 84.13999938964844, 76.06999969482422, 66.33999633789062, 80.91000366210938, 75.29000091552734, 68.29000091552734, 63.459999084472656, 60.43000030517578, 53.880001068115234, 51.65999984741211, 51.88999938964844, 53.31999969482422, 56.95000076293945, 60.290000915527344, 66.9000015258789, 68.08000183105469, 68.69000244140625, 69.72000122070312, 71.22000122070312, 75.30999755859375, 76.9000015258789, 77.37999725341797, 78.91999816894531, 80.01000213623047, 80.86000061035156, 75.94000244140625, 71.94999694824219], wiv_wind=[-0.03999999910593033, -0.9300000071525574, -1.1399999856948853, -1.2100000381469727, -1.1200000047683716, -0.9300000071525574, -1.2799999713897705, -1.7100000381469727, -1.2400000095367432, -0.8399999737739563, -1.440000057220459, -0.36000001430511475, -0.6899999976158142, -1.100000023841858, -1.0099999904632568, -0.20999999344348907, -0.17000000178813934, 0.2199999988079071, -0.4099999964237213, -1.1200000047683716, -1.4500000476837158, -0.8600000143051147, -0.2199999988079071, -0.20000000298023224, 0.019999999552965164, -0.30000001192092896, -0.4000000059604645, -0.4000000059604645, -0.17000000178813934, -0.1899999976158142, -0.33000001311302185, -0.5199999809265137, -0.3199999928474426, -0.9300000071525574, -1.3300000429153442, -1.1299999952316284, -1.0499999523162842, -0.9599999785423279, -1.0800000429153442, -1.5199999809265137, -1.0499999523162842, -1.0700000524520874, -0.8999999761581421, -1.059999942779541, -0.5899999737739563, -0.5600000023841858, -0.25, -0.12999999523162842, -0.25999999046325684, -0.12999999523162842, -0.2800000011920929, -0.41999998688697815, -0.5799999833106995, -0.5199999809265137, -0.7900000214576721, -0.8600000143051147, -0.41999998688697815, -0.38999998569488525, -0.6399999856948853, -0.7099999785423279, -1.100000023841858, -0.8600000143051147, -0.7400000095367432, -0.5799999833106995, -0.17000000178813934, 0.14000000059604645, -0.15000000596046448, -0.30000001192092896, -0.4300000071525574, -0.7200000286102295, -0.6399999856948853, -0.8100000023841858], tem=[280.3699951171875, 281.3299865722656, 283.1499938964844, 284.5799865722656, 284.92999267578125, 285.8599853515625, 286.0799865722656, 286.0799865722656, 285.3599853515625, 284.6400146484375, 283.1099853515625, 282.8800048828125, 282.3599853515625, 281.760009765625, 281.0199890136719, 280.239990234375, 279.42999267578125, 278.57000732421875, 278.55999755859375, 278.4800109863281, 278.30999755859375, 278.1700134277344, 277.989990234375, 277.6600036621094, 278.7200012207031, 278.92999267578125, 279.7200012207031, 280.739990234375, 279.0400085449219, 279.32000732421875, 279.94000244140625, 280.260009765625, 280.9200134277344, 280.3999938964844, 281.3900146484375, 278.8999938964844, 278.5199890136719, 278.4599914550781, 280.1600036621094, 280.510009765625, 280.5299987792969, 280.0, 279.4200134277344, 279.010009765625, 279.2300109863281, 279.32000732421875, 279.3500061035156, 279.29998779296875, 279.55999755859375, 279.7200012207031, 281.1099853515625, 281.8299865722656, 282.4200134277344, 283.04998779296875, 283.17999267578125, 283.5299987792969, 283.57000732421875, 282.42999267578125, 281.6400146484375, 280.94000244140625, 280.19000244140625, 279.489990234375, 278.6499938964844, 278.0899963378906, 277.6000061035156, 277.1499938964844, 277.0, 277.0400085449219, 277.0899963378906, 276.989990234375, 276.8800048828125, 278.30999755859375], lat=36.1}]

data字段说明

字段名称

说明

单位

lon

经度点

lat

纬度点

erh

湿度

%

tem

温度指标(n天)

K

tmax

72小时内24小时最高温度

K

tmin

72小时内24小时最低温度

K

pre

1小时降水量

kg.m-2

erha

最大相对湿度

%

ect

云量

%

wiu_wind

U是东西风上的分量,西风为正

wiv_wind

V是南北风上的分量,南风为正。

start_forecast_time

预测开始时间

yyyymmdd080000或yyyymmdd200000

首页 数智气象引擎 API用户指南 SDK示例 Java示例 高分辨率网格72小时逐小时天气预报