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

高分辨率网格10天预报

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

前提条件

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

接口说明

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

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

时间分辨率:逐3小时

更新频率:2次/天;北京时间10:00、22:00

通用请求参

名称

类型

示例值

描述

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.*;
import com.aliyun.teaopenapi.models.Config;

public class WeatherforecastDays {
    /**
     * 高分辨率网格10天预报(YB-10day-sj)
     * 按经纬度查询数据
     * 逐3小时
     * @param
     * @return
     */
    public static void main(String[] args) {

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

        Config config = new Config();
        config.setEndpoint("aliyunape.aliyuncs.com");
        config.setAccessKeyId("LT*************C");
        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:5F9B2319-36A3-5761-A145-F119C0192F9E
success:true
data:[{start_forecast_time=20220207160000, 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.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.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, 9999.0, 9999.0, 9999.0, 9999.0], tmax=274.7900085449219, tmin=0.0, pph=[3.0, 3.0, 1.0, 2.0, 2.0, 2.0, 3.0, 3.0, 3.0, 1.0, 1.0, 1.0, 1.0, 3.0, 3.0, 3.0, 3.0, 1.0, 1.0, 1.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 2.0, 1.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 1.0, 2.0, 3.0, 3.0, 3.0, 3.0, 3.0, 1.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 1.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 1.0, 1.0, 1.0, 3.0], erha=45.33000183105469, lon=91.13, wiv_wind=[3.6700000762939453, 0.23999999463558197, 0.1899999976158142, -0.4300000071525574, 3.059999942779541, 3.109999895095825, 2.700000047683716, 1.2200000286102295, -2.690000057220459, -2.450000047683716, -2.380000114440918, -1.159999966621399, 1.6200000047683716, 1.8700000047683716, 2.380000114440918, 2.680000066757202, 3.009999990463257, 1.809999942779541, 0.7099999785423279, 1.4600000381469727, 3.430000066757202, 1.8899999856948853, 2.309999942779541, 2.369999885559082, 2.5799999237060547, 2.359999895095825, 3.2100000381469727, 3.450000047683716, 1.7699999809265137, -1.8600000143051147, -2.0, -0.07000000029802322, 2.569999933242798, 1.5800000429153442, -0.36000001430511475, -2.380000114440918, -1.8200000524520874, -3.1500000953674316, -2.2100000381469727, -2.1700000762939453, -4.130000114440918, 1.5800000429153442, 1.4199999570846558, 2.6600000858306885, 3.0, 0.8999999761581421, 1.6299999952316284, 2.0899999141693115, 0.2800000011920929, -0.2199999988079071, -2.1700000762939453, 0.23999999463558197, 0.12999999523162842, 0.10999999940395355, 1.5299999713897705, 0.3700000047683716, -0.8899999856948853, -1.2000000476837158, -0.36000001430511475, -2.5299999713897705, 1.600000023841858, -2.180000066757202, -0.5299999713897705, 0.23999999463558197, 1.5800000429153442, 2.059999942779541, 1.8899999856948853, 1.5700000524520874, 1.7599999904632568, 2.240000009536743, 3.2899999618530273, 2.3299999237060547, 1.1799999475479126, 1.2300000190734863, 1.75, 1.809999942779541, 1.3899999856948853, 1.2899999618530273, 2.700000047683716, 1.9600000381469727], dswrf=[0.0, 0.0, 0.0, 0.0, 185.44000244140625, 460.6999816894531, 701.219970703125, 418.4640197753906, 0.0, 0.0, 0.0, 0.0, 187.94000244140625, 463.84002685546875, 762.8399658203125, 493.3280334472656, 0.0, 0.0, 0.0, 0.0, 185.09999084472656, 463.1520080566406, 778.1399536132812, 512.6880493164062, 0.0, 0.0, 0.0, 0.0, 191.25999450683594, 468.1440124511719, 774.0599975585938, 489.1520080566406, 0.0, 0.0, 0.0, 0.0, 167.72000122070312, 406.8599853515625, 736.9199829101562, 473.4560241699219, 0.0, 0.0, 0.0, 0.0, 199.1999969482422, 395.9599914550781, 732.760009765625, 490.94000244140625, 0.0, 0.0, 0.0, 0.0, 205.72000122070312, 489.5999755859375, 797.0999755859375, 508.0, 0.0, 0.0, 0.0, 0.0, 203.72000122070312, 485.1999816894531, 682.4199829101562, 417.7920227050781, 0.0, 0.0, 0.0, 0.0, 182.86000061035156, 432.384033203125, 770.0199584960938, 490.6600036621094, 0.0, 0.0, 0.0, 0.0, 165.67999267578125, 416.1920166015625, 727.97998046875, 464.4640197753906], ect=[0.0, 27.690000534057617, 37.63999938964844, 50.380001068115234, 15.130000114440918, 0.0, 0.0, 0.0, 0.0, 21.389999389648438, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 33.38999938964844, 0.0, 0.0, 0.0, 9.630000114440918, 19.34000015258789, 47.75, 53.72999954223633, 84.66999816894531, 84.62000274658203, 98.30000305175781, 70.94999694824219, 88.54000091552734, 35.02000045776367, 25.239999771118164, 86.97000122070312, 100.0, 42.79999923706055, 100.0, 92.31999969482422, 100.0, 9.119999885559082, 55.630001068115234, 99.08000183105469, 100.0, 26.81999969482422, 0.0, 0.0, 3.0299999713897705, 0.0, 53.68000030517578, 30.969999313354492, 100.0, 76.4000015258789, 94.41000366210938, 94.75, 100.0, 100.0, 0.0, 82.29000091552734, 100.0, 100.0, 73.16999816894531, 99.58000183105469, 62.95000076293945, 88.5, 26.56999969482422, 67.06999969482422, 99.25, 100.0, 39.36000061035156, 57.029998779296875, 74.0999984741211, 85.0199966430664, 89.06999969482422, 100.0, 100.0, 100.0, 100.0, 91.13999938964844, 74.83000183105469, 68.0999984741211], wiu_wind=[-2.1600000858306885, 1.3899999856948853, 1.5499999523162842, -0.38999998569488525, -1.100000023841858, -0.6600000262260437, -0.28999999165534973, -2.0199999809265137, -2.369999885559082, 1.059999942779541, 2.890000104904175, -2.869999885559082, -2.549999952316284, -2.7300000190734863, -1.2200000286102295, -1.4800000190734863, -1.3300000429153442, 1.190000057220459, 2.119999885559082, -0.5099999904632568, -0.25999999046325684, 0.3799999952316284, 0.20000000298023224, -0.6499999761581421, 2.049999952316284, 2.5, 2.0, 0.4399999976158142, -0.3700000047683716, -2.2300000190734863, -3.119999885559082, -1.559999942779541, 3.369999885559082, 2.5199999809265137, 3.75, 0.3499999940395355, -0.12999999523162842, -0.6499999761581421, -0.699999988079071, -1.5399999618530273, -2.049999952316284, 3.299999952316284, 0.7799999713897705, -0.18000000715255737, -1.309999942779541, -1.9900000095367432, -2.869999885559082, -1.9700000286102295, 2.5, 1.8200000524520874, 0.8399999737739563, -2.940000057220459, -2.7300000190734863, -3.240000009536743, -2.430000066757202, -2.869999885559082, -3.009999990463257, 2.190000057220459, 1.1399999856948853, -0.47999998927116394, -1.2200000286102295, -3.319999933242798, -2.640000104904175, -2.4200000762939453, -2.3399999141693115, -1.6299999952316284, -0.8999999761581421, -0.3499999940395355, -2.319999933242798, -0.8700000047683716, 0.5199999809265137, -2.490000009536743, -1.7999999523162842, -1.149999976158142, -0.09000000357627869, -1.0, -1.7699999809265137, -0.5899999737739563, 1.6299999952316284, 0.36000001430511475], dlwrf=[195.50808715820312, 201.9672393798828, 185.47332763671875, 167.3749237060547, 152.36172485351562, 158.19949340820312, 193.0157470703125, 211.10000610351562, 165.1977996826172, 160.12445068359375, 151.43788146972656, 150.35787963867188, 150.85130310058594, 156.48171997070312, 168.87548828125, 167.40980529785156, 148.45321655273438, 150.422119140625, 155.49229431152344, 157.45277404785156, 159.70237731933594, 163.44424438476562, 169.6538848876953, 168.6353302001953, 167.05491638183594, 164.6999969482422, 157.34890747070312, 155.97909545898438, 155.0095672607422, 159.41647338867188, 169.4264373779297, 185.03225708007812, 181.8543701171875, 180.9453887939453, 168.68711853027344, 160.8886260986328, 169.7534637451172, 188.38858032226562, 180.23727416992188, 186.10000610351562, 202.25927734375, 203.67576599121094, 250.97862243652344, 219.48167419433594, 141.10626220703125, 165.68777465820312, 164.1102752685547, 151.19606018066406, 133.37271118164062, 130.41668701171875, 126.4151611328125, 127.0999984741211, 131.60000610351562, 137.3048858642578, 153.0078125, 161.1999969482422, 171.04603576660156, 179.72817993164062, 160.4058837890625, 163.6900177001953, 153.67478942871094, 156.6234130859375, 202.78587341308594, 209.19981384277344, 172.0576934814453, 202.7421875, 193.5634765625, 185.00897216796875, 178.965576171875, 194.304443359375, 187.9779510498047, 196.65829467773438, 229.1753387451172, 203.39291381835938, 164.03648376464844, 163.79824829101562, 185.8796844482422, 198.23504638671875, 195.8506317138672, 201.9057159423828], erh=[26.559999465942383, 15.470000267028809, 7.739999771118164, 4.800000190734863, 21.299999237060547, 29.530000686645508, 29.0, 32.88999938964844, 18.940000534057617, 10.279999732971191, 6.389999866485596, 3.059999942779541, 11.800000190734863, 12.460000038146973, 21.600000381469727, 17.670000076293945, 28.649999618530273, 16.809999465942383, 3.5, 7.449999809265137, 16.549999237060547, 21.520000457763672, 27.030000686645508, 39.599998474121094, 13.84000015258789, 20.579999923706055, 2.700000047683716, 16.290000915527344, 29.729999542236328, 24.31999969482422, 22.1299991607666, 28.209999084472656, 45.33000183105469, 11.100000381469727, 8.770000457763672, 1.5199999809265137, 21.09000015258789, 27.770000457763672, 27.1299991607666, 30.299999237060547, 20.40999984741211, 23.209999084472656, 14.34000015258789, 5.289999961853027, 18.229999542236328, 17.600000381469727, 10.789999961853027, 16.8700008392334, 23.959999084472656, 14.210000038146973, 7.619999885559082, 13.069999694824219, 17.40999984741211, 25.940000534057617, 30.329999923706055, 41.2599983215332, 23.190000534057617, 13.75, 10.039999961853027, 22.520000457763672, 25.989999771118164, 26.5, 30.450000762939453, 22.389999389648438, 27.829999923706055, 12.789999961853027, 0.0, 12.470000267028809, 27.719999313354492, 27.700000762939453, 28.229999542236328, 39.81999969482422, 0.0, 6.050000190734863, 13.100000381469727, 6.96999979019165, 0.0, 8.199999809265137, 18.6299991607666, 17.84000015258789], tem=[270.0899963378906, 273.0899963378906, 278.6700134277344, 275.4200134277344, 275.0799865722656, 274.79998779296875, 271.8299865722656, 266.989990234375, 273.760009765625, 280.1400146484375, 279.0199890136719, 279.5400085449219, 278.1700134277344, 272.6199951171875, 272.2799987792969, 268.5199890136719, 270.3500061035156, 277.260009765625, 280.2799987792969, 278.0199890136719, 274.3399963378906, 272.2099914550781, 271.5400085449219, 274.7900085449219, 271.8900146484375, 272.739990234375, 276.2099914550781, 279.44000244140625, 272.19000244140625, 268.42999267578125, 269.0400085449219, 267.0299987792969, 273.94000244140625, 275.0199890136719, 275.2099914550781, 275.1600036621094, 273.1000061035156, 270.17999267578125, 267.1099853515625, 266.8900146484375, 272.25, 273.7900085449219, 275.3299865722656, 277.4100036621094, 272.42999267578125, 269.3999938964844, 268.6400146484375, 271.0199890136719, 270.92999267578125, 270.79998779296875, 277.989990234375, 275.739990234375, 271.4200134277344, 270.5299987792969, 273.3699951171875, 264.2799987792969, 271.05999755859375, 277.67999267578125, 275.07000732421875, 273.7799987792969, 273.6499938964844, 271.5400085449219, 268.9599914550781, 267.2200012207031, 272.1400146484375, 276.1700134277344, 280.04998779296875, 281.2300109863281, 275.6700134277344, 273.67999267578125, 269.8299865722656, 265.80999755859375, 274.3299865722656, 280.69000244140625, 281.3999938964844, 278.739990234375, 277.42999267578125, 276.79998779296875, 276.1600036621094, 272.3599853515625], lat=29.65}]

data字段说明

接口字段

字段名称

单位

ect

云量

%

pre

3小时降水量

毫米(mm)

erh

相对湿度

%

erha

最大相对湿度

%

pph

降水类型:1-降水;2-混合;3-降雪;4-冻雨;0-无

-

tem

温度

摄氏度(℃)

tmax

240小时内逐24小时最高温度

摄氏度(℃)

tmin

240小时内逐24小时最低温度

摄氏度(℃)

wiu_wind

U风速

m/s(米/秒)

wiv_wind

V风速

m/s(米/秒)

dlwrf

长波辐射

w/m^2

dswrf

短波辐射

w/m^2

start_forecast_time

预测开始时间

yyyyMMdd040000或yyyyMMdd160000

lat

纬度

lon

经度

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