中国气象局开放平台接口使用说明书
- 格式:pdf
- 大小:558.08 KB
- 文档页数:10
气象资料业务系统(MDOS)台站用户使用手册省气象信息中心2013年5月1.平台使用环境(1)操作系统: WindowsXP及以上版本;(2)客户端浏览器:IE 8.0及以上或其他基于IE核浏览器;(3)显示分辨率为1024×768,建议1280×1024,以达到最好的显示效果。
2.平台基本操作MDOS操作平台分为五类用户,分别为系统管理员、省级数据监控员、省级数据处理员、台站级管理员、台站级数据处理员。
用户登录:在浏览器地址栏输入: 10.181.22.64:8080/,即可打开平台登录页面。
台站级数据处理员的用户名和用户密码都为台站号,如二十里铺的用户名和用户密码都为52866。
台站级管理员的用户名和用户密码都为g+台站号, 如二十里铺的用户名和用户密码都为g52866。
3. 数据处理流程数据处理流程分省级和台站级。
(1)省级数据监控:监控小时、小时辐射、分钟、日、日照等五类数据接收与上传信息。
流程:实时监控各台站数据传输接收和上传情况,整点时接收各台站小时数据、分钟数据、小时辐射数据;每日时间20:00监控日数据、日照数据传输接收情况。
(2)省级数据处理:对系统提示的各类疑误信息,进行疑误信息确认处理、向台站发送疑误查询信息并处理台站反馈、处理国家级的疑误查询信息并反馈、保障三级数据的一致性。
处理流程包括以下9类:流程1:正确,确认数据无误→处理完成。
流程2:交台站处理→查询台站→处理提交。
流程3:数据错误,省级修正→更改数据→(启动报警系统)通知台站→处理完成。
流程4:批量数据错误,省级批量数据错误→填写错误原因→数据置为缺测→处理完成。
流程5:处理台站的反馈→同意台站处理→确认无误(台站判断原数据无误)→处理完成。
流程6:处理台站的反馈→同意台站处理→数据修改(台站修改数据)→处理完成。
流程7:处理台站的反馈→不同意台站处理→重新查询(回到流程2)。
流程8:处理台站的反馈→不同意台站(修改)处理→使用原数据→结束。
气象资料业务系统(MDOS2.1)用户操作手册技术组2018年03月目录1 概述 (5)1.1开发背景 (5)1.2功能简介 (6)1.3平台组成 (7)1.4平台使用环境 (8)1.5平台基本操作 (8)1.6数据处理流程 (10)2 数据接收与上传监控 (13)2.1功能简介 (13)2.2监控概况 (13)2.3国家站监控情况 (17)2.4区域站监控情况 (18)2.5辐射站监控情况 (18)2.6酸雨站监控情况 (19)2.7土壤水分站监控情况 (19)2.8高空站监控情况 (20)2.9快速质控异常文件信息显示 (20)3 质控信息处理 (22)3.1功能简介 (22)3.2省级处理与查询反馈 (23)3.3统计值质控信息处理 (50)3.4台站处理与反馈 (51)3.5系统性偏差检测 (55)3.6台站更正数据文件人工干预 (59)3.7黑名单管理 (62)3.8观测项不一致 (68)4 数据质量分析与处理 (73)4.1功能简介 (73)4.2数据流转痕迹显示 (73)4.3观测数据人工质控 (74)5 快捷通道 (75)5.1功能简介 (75)5.2日清 (76)5.3月清 (79)5.4数据空间分析 (88)5.5综合一致性分析 (90)5.6探空曲线显示 (94)5.7任意数据修改 (95)5.8数据查询与质疑 (98)5.9支撑表与服务表数据对比 (102)6 文件制作与数据显示 (106)6.1功能简介 (106)6.2文件制作 (106)6.3观测数据显示 (117)6.4统计值显示 (119)7 元数据基本信息 (121)7.1功能简介 (121)7.1.1 模块功能 (121)7.1.2 模块组成 (121)7.1.3 用户分类 (122)7.1.4 页面构成 (123)7.2台站基本信息 (124)7.2.1 功能简介 (124)7.2.2 操作说明 (125)7.3图像、观测记录和规范信息 (139)7.3.1 功能简介 (139)7.3.2 操作说明 (139)7.4台站变动登记 (144)7.4.1 功能简介 (144)7.4.2 操作说明 (144)7.5台站疑误登记 (147)7.5.1 功能介绍 (147)7.5.2 操作说明 (147)7.6年报附加信息 (149)7.6.1 功能介绍 (149)7.6.2 操作说明 (149)7.7附加信息登记 (155)7.7.1 功能介绍 (155)7.7.2 操作说明 (155)7.8文件管理 (159)7.8.1 功能简介 (159)7.8.2 操作说明 (160)7.9元数据消息管理 (162)7.9.1 功能简介 (162)7.9.2 操作说明 (162)7.10变动信息及附加信息处理 (163)7.10.1 功能简介 (163)7.10.2 操作说明 (163)7.11疑误处理 (166)7.11.1 功能简介 (166)7.11.2 操作说明 (166)7.12土壤水分站信息表格导入 (168)7.12.1 新增功能简介 (168)7.12.2 操作说明 (168)7.13高空站沿革文件导入 (171)7.13.1 新增功能简介 (171)7.13.2 操作说明 (171)8 质量与处理情况 (173)8.1功能简介 (173)8.2疑误信息反馈情况统计 (173)8.3数据质量情况统计 (176)9 基本信息显示与管理 (179)9.1功能简介 (179)9.2台站信息管理 (179)9.3邻近参考站信息 (183)9.4参考要素信息显示 (185)9.5更正消息管理 (186)9.6更正数据文件管理 (187)9.7报警短信显示 (190)9.8提示消息管理 (191)10 系统管理 (193)10.1功能简介 (193)10.2用户管理 (194)10.3菜单管理 (197)10.4报警子系统配置管理 (200)1 概述1.1开发背景系统的核心需求是将现有运行在Windows Server + SQL Server 环境下的系统移植到Linux + Oracle 环境下,并与CIMISS 系统实现对接,对接体现在两个方面:数据源:系统将使用新建设的MDOS支撑库(读和写)和CIMISS 系统的SOD存储中的服务表(只读)数据;功能:CIMISS 在数据处理方面与MDOS系统进行双向交互,实时保证数据的准确性、一致性和完整性。
中国国家气象局城市天气ID及天气预报接口城市天气ID直辖市"北京","上海","天津","重庆""101010100","101020100","101030100","101040100"特别行政区"香港","澳门""101320101","101330101"黑龙江"哈尔滨","齐齐哈尔","牡丹江","大庆","伊春","双鸭山","鹤岗","鸡西","佳木斯","七台河","黑河","绥化","大兴安岭""101050101","101050201","101050301","101050901","1010 50801","101051301","101051201","101051101","101050401","1 01051002","101050601","101050501","101050701"吉林"长春","延吉","吉林","白山","白城","四平","松原","辽源","大安","通化""101060101","101060301","101060201","101060901","1010 60601","101060401","101060801","101060701","101060603","1 01060501"辽宁"沈阳","大连","葫芦岛","盘锦","本溪","抚顺","铁岭","辽阳","营口","阜新","朝阳","锦州","丹东","鞍山""101070101","101070201","101071401","101071301","101070501","101070401","101071101","101071001","101070801","1 01070901","101071201","101070701","101070601","101070301"内蒙古"呼和浩特","呼伦贝尔","锡林浩特","包头","赤峰","海拉尔","乌海","鄂尔多斯","通辽""101080101","101081001","101080901","101080201","1010 80601","101081001","101080301","101080701","101080501"河北"石家庄","唐山","张家口","廊坊","邢台","邯郸","沧州","衡水","承德","保定","秦皇岛""101090101","101090501","101090301","101090601","1010 90901","101091001","101090701","101090801","101090402","1 01090201","101091101"河南"郑州","开封","洛阳","平顶山","焦作","鹤壁","新乡","安阳","濮阳","许昌","漯河","三门峡","南阳","商丘","信阳","周口","驻马店""101180101","101180801","101180901","101180501","1011 81101","101181201","101180301","101180201","101181301","1 01180401","101181501","101181701","101180701","101181001" ,"101180601","101181401","101181601"山东"济南","青岛","淄博","威海","曲阜","临沂","烟台","枣庄","聊城","济宁","菏泽","泰安","日照","东营","德州","滨州","莱芜","潍坊""101120101","101120201","101120301","101121301","1011 20710","101120901","101120501","101121401","101121701","1 01120701","101121001","101120801","101121501","101121201","101120401","101121101","101121601","101120601"山西"太原","阳泉","晋城","晋中","临汾","运城","长治","朔州","忻州","大同","吕梁""101100101","101100301","101100601","101100401","1011 00701","101100801","101100501","101100901","101101001","1 01100201","101101101"江苏"南京","苏州","昆山","南通","太仓","吴县","徐州","宜兴","镇江","淮安","常熟","盐城","泰州","无锡","连云港","扬州","常州","宿迁""101190101","101190401","101190404","101190501","1011 90408","101190406","101190801","101190203","101190301","1 01190901","101190402","101190701","101191201","101190201" ,"101191001","101190601","101191101","101191301"安徽"合肥","巢湖","蚌埠","安庆","六安","滁州","马鞍山","阜阳","宣城","铜陵","淮北","芜湖","毫州","宿州","淮南","池州""101220101","101221601","101220201","101220601","1012 21501","101221101","101220501","101220801","101221401","1 01221301","101221201","101220301","101220901","101220701" ,"101220401","101221701"陕西"西安","韩城","安康","汉中","宝鸡","咸阳","榆林","渭南","商洛","铜川","延安""101110101","101110510","101110701","101110801","1011 10901","101110200","101110401","101110501","101110601","101111001","101110300"宁夏"银川","固原","中卫","石嘴山","吴忠""101170101","101170401","101170501","101170201","1011 70301"甘肃"兰州","白银","庆阳","酒泉","天水","武威","张掖","甘南","临夏","平凉","定西","金昌""101160101","101161301","101160401","101160801","1011 60901","101160501","101160701","101050204","101161101","1 01160301","101160201","101160601"青海"西宁","海北","海西","黄南","果洛","玉树","海东","海南""101150101","101150801","101150701","101150301","1011 50501","101150601","101150201","101150401"湖北"武汉","宜昌","黄冈","恩施","荆州","神农架","十堰","咸宁","襄阳","孝感","随州","黄石","荆门","鄂州""101200101","101200901","101200501","101201001","1012 00801","101201201","101201101","101200701","101200201","1 01200401","101201301","101200601","101201401","101200301"湖南"长沙","邵阳","常德","郴州","吉首","株洲","娄底","湘潭","益阳","永州","岳阳","衡阳","怀化","韶山","张家界""101250101","101250901","101250601","101250501","101251501","101250301","101250801","101250201","101250701","1 01251401","101251001","101250401","101251201","101250202" ,"101251101"浙江"杭州","湖州","金华","宁波","丽水","绍兴","衢州","嘉兴","台州","舟山","温州""101210101","101210201","101210901","101210401","1012 10801","101210501","101211001","101210301","101210601","1 01211101","101210701"江西"南昌","萍乡","九江","上饶","抚州","吉安","鹰潭","宜春","新余","景德镇","赣州""101240101","101240901","101240201","101240301","1012 40401","101240601","101241101","101240501","101241001","1 01240801","101240701"福建"福州","厦门","龙岩","南平","宁德","莆田","泉州","三明","漳州""101230101","101230201","101230701","101230901","1012 30301","101230401","101230501","101230801","101230601"贵州"贵阳","安顺","赤水","遵义","铜仁","六盘水","毕节","凯里","都匀""101260101","101260301","101260208","101260201","1012 60601","101260801","101260701","101260501","101260401"四川"成都","泸州","内江","凉山","阿坝","巴中","广元","乐山","绵阳","德阳","攀枝花","雅安","宜宾","自贡","甘孜州","达州","资阳","广安","遂宁","眉山","南充""101270101","101271001","101271201","101271601","1012 71901","101270901","101272101","101271401","101270401","1 01272001","101270201","101271701","101271101","101270301" ,"101271801","101270601","101271301","101270801","1012707 01","101271501","101270501"广东"广州","深圳","潮州","韶关","湛江","惠州","清远","东莞","江门","茂名","肇庆","汕尾","河源","揭阳","梅州","中山","德庆","阳江","云浮","珠海","汕头","佛山""101280101","101280601","101281501","101280201","1012 81001","101280301","101281301","101281601","101281101","1 01282001","101280901","101282101","101281201","101281901" ,"101280401","101281701","101280905","101281801","1012814 01","101280701","101280501","101280800"广西"南宁","桂林","阳朔","柳州","梧州","玉林","桂平","贺州","钦州","贵港","防城港","百色","北海","河池","来宾","崇左""101300101","101300501","101300510","101300301","1013 00601","101300901","101300802","101300701","101301101","1 01300801","101301401","101301001","101301301","101301201" ,"101300401","101300201"云南"昆明","保山","楚雄","德宏","红河","临沧","怒江","曲靖","思茅","文山","玉溪","昭通","丽江","大理""101290101","101290501","101290801","101291501","1012 90301","101291101","101291201","101290401","101290901","1 01290601","101290701","101291001","101291401","101290201"海南"海口","三亚","儋州","琼山","通什","文昌""101310101","101310201","101310205","101310102","1013 10222","101310212"新疆"乌鲁木齐","阿勒泰","阿克苏","昌吉","哈密","和田","喀什","克拉玛依","石河子","塔城","库尔勒","吐鲁番","伊宁""101130101","101131401","101130801","101130401","1011 31201","101131301","101130901","101130201","101130301","1 01131101","101130601","101130501","101131001"西藏"拉萨","阿里","昌都","那曲","日喀则","山南","林芝""101140101","101140701","101140501","101140601","1011 40201","101140301","101140401"台湾"台北","高雄""101340102","101340201"天气预报接口中国国家气象局天气预报接口总共提供了三个:/data/sk/101010100.html/data/cityinfo/101010100.html /data/101010100.html{"weatherinfo":{<!-- 基本信息 -->"city":"福州","city_en":"fuzhou","date_y":"2012年5月14日","date":"","week":"星期一","fchh":"08","cityid":"101230101",<!-- 从今天开始到第六天的每天的天气情况,这里的温度是摄氏温度 -->"temp1":"29℃~23℃","temp2":"26℃~20℃","temp3":"24℃~ 20℃","temp4":"25℃~20℃","temp5":"24℃~21℃","temp6":"25℃~22℃",<!-- 从今天开始到第六天的每天的天气情况,这里的温度是华氏温度 -->"tempF1":"84.2℉~73.4℉","tempF2":"78.8℉~68℉","tempF3 ":"75.2℉~68℉","tempF4":"77℉~68℉","tempF5":"75.2℉~69.8℉","tempF6":"77℉~71.6℉",<!-- 天气描述 -->"weather1":"阵雨转中雨","weather2":"中雨转小雨","weather3":"小雨","weather4":"小雨","weather5":"小雨转阵雨","weather6":"阵雨转小雨",<!-- 天气描述图片序号 -->"img1":"3","img2":"8","img3":"8","img4":"7","img5":"7","img 6":"99","img7":"7","img8":"99","img9":"7","img10":"3","img11":" 3","img12":"7","img_single":"3",<!-- 图片名称 -->"img_title1":"阵雨","img_title2":"中雨","img_title3":"中雨","img_title4":"小雨","img_title5":"小雨","img_title6":"小雨","img_title7":"小雨","img_title8":"小雨","img_title9":"小雨","img_title10":"阵雨","img_title11":"阵雨","img_title12":"小雨","img_title_single":"阵雨",<!-- 风速描述 -->"wind1":"微风","wind2":"微风","wind3":"微风","wind4":"微风","wind5":"微风","wind6":"微风","fx1":"微风","fx2":"微风", <!-- 风速级别描述 -->"fl1":"小于3级","fl2":"小于3级","fl3":"小于3级","fl4":"小于3级","fl5":"小于3级","fl6":"小于3级",<!-- 今天穿衣指数 -->"index":"热","index_d":"天气较热,建议着短裙、短裤、短套装、T恤等夏季服装。
【转载】C#调⽤国家⽓象局天⽓预报接⼝⼀.需求最近,刚好项⽬中有天⽓预报查询功能的需求,要求录⼊城市名称,获取该城市今⽇天⽓信息及相关⽓象⽣活辅助信息等。
例如:查询北京市天⽓结果为:今⽇北京天⽓:15℃~5℃阵⾬转阴,北风3-4级,天⽓冷,建议着棉服、⽻绒服、⽪夹克加⽺⽑衫等冬季服装。
年⽼体弱者宜着厚棉⾐、冬⼤⾐或厚⽻绒服。
洗车指数:不宜。
紫外线指数:最弱。
晨练指数:较不宜.舒适指数:较舒适。
还好,国家⽓象局提供相关接⼝,再此表⽰感谢,虽然个⼈觉得该api设计思路有待提⾼,但是相⽐于其他部委【如交通部】来说,⽓象局这个冷衙门有开源、开放的⼼态,相⽐⽽⾔,相当了不起。
期待后期能在接⼝规范、可提供查询城市数量等⽅⾯继续提⾼。
⼆.接⼝说明据我所知,⽓象局提供三个天⽓查询接⼝,如下:1、实时天⽓接⼝地址:/data/ sk/【城市代码】.html例如:查询北京实时天⽓结果:{"weatherinfo":{"city":"北京","cityid":"101010100","temp":"13","WD":"南风","WS":"2","SD":"59%","WSE":"2","time":"10:30","isRadar":"1","Radar":"JC_RADAR_AZ9010_JB"}}2、今⽇天⽓接⼝地址:/data/cityinfo/【城市代码】.html例如:查询北京今⽇天⽓结果:{"weatherinfo":{"city":"北京","cityid":"101010100","temp1":"15","temp2":"5℃","weather":"阵⾬转阴","img1":"d3.gif","img2":"n2.gif","ptime":"08:00"}}3、今⽇及未来天⽓接⼝【内容最详细】地址:/data/【城市代码】.html例如:查询北京今⽇及未来天⽓结果:{"weatherinfo":{"city":"北京","city_en":"beijing","date_y":"2013年10⽉22⽇","date":"","week":"星期⼆","fchh":"08","cityid":"101010100","temp1":"15℃~5℃","temp2":"15℃~4℃………【省略】"index_tr":"适宜","index_co":"较舒适","st1":"11","st2":"1","st3":"13","st4":"5","st5":"14","st6":"4","index_cl":"较不宜","index_ls":"不太适宜","index_ag":"不易发"}}字段说明:我刚好是调⽤这个接⼝,所以下⾯通过对应的实体及属性来说明上述返回结果中各字段的含义/// <summary>/// 天⽓查询结果信息实体/// </summary>public class WeatherinfoModel{/// <summary>/// 城市名称/// </summary>public String city{get;set;}/// <summary>/// 城市英⽂名称==拼⾳/// </summary>public String city_en{get;set;}/// <summary>/// 今⽇时间【年-⽉-⽇】/// </summary>public String date_y{get;set;}/// <summary>/// 为空,⽆⽤/// </summary>public String date{get;set;}/// <summary>/// 星期⼏/// </summary>public String week{get;set;}/// <summary>/// 系统更新时间/// </summary>public String fchh{get;set;}/// <summary>/// 城市代码/// </summary>public String cityid{get;set;}/// <summary>/// 今天及之后五天的摄⽒温度/// </summary>public String temp1{get;set;}public String temp2{get;set;}public String temp3{get;set;}public String temp4{get;set;}public String temp5{get;set;}public String temp6{get;set;}/// <summary>/// 今天及之后五天的华⽒温度/// </summary>public String tempF1{get;set;}public String tempF2{get;set;}public String tempF3{get;set;}public String tempF4{get;set;}public String tempF5{get;set;}public String tempF6{get;set;}/// <summary>/// 今天及之后五天的天⽓描述/// </summary>public String weather1{get;set;}public String weather2{get;set;}public String weather3{get;set;}public String weather4{get;set;}public String weather5{get;set;}public String weather6{get;set;}/// <summary>/// 天⽓描述图⽚序号/// </summary>public String img1{get;set;}public String img2{get;set;}public String img3{get;set;}public String img4{get;set;}public String img5{get;set;}public String img6{get;set;}public String img7{get;set;}public String img8{get;set;}public String img9{get;set;}public String img10{get;set;}public String img11{get;set;}public String img12{get;set;}public String img_single{get;set;}/// <summary>/// 图⽚名称/// </summary>public String img_title1{get;set;}public String img_title2{get;set;}public String img_title3{get;set;}public String img_title4{get;set;}public String img_title5{get;set;}public String img_title6{get;set;}public String img_title7{get;set;}public String img_title8{get;set;}public String img_title9{get;set;}public String img_title10{get;set;}public String img_title11{get;set;}public String img_title12{get;set;}public String img_title_single{get;set;} /// <summary>/// 今天及之后五天的风速描述/// </summary>public String wind1{get;set;}public String wind2{get;set;}public String wind3{get;set;}public String wind4{get;set;}public String wind5{get;set;}public String wind6{get;set;}/// <summary>/// 风速级别描述/// </summary>public String fx1{get;set;}public String fx2{get;set;}public String fl1{get;set;}public String fl2{get;set;}public String fl3{get;set;}public String fl5{get;set;}public String fl6{get;set;}/// <summary>/// 今天穿⾐指数/// </summary>public String index{get;set;}public String index_d{get;set;}/// <summary>/// 48⼩时穿⾐指数/// </summary>public String index48{get;set;}public String index48_d{get;set;}/// <summary>/// 紫外线及48⼩时紫外线/// </summary>public String index_uv{get;set;}public String index48_uv{get;set;}/// <summary>/// 洗车/// </summary>public String index_xc{get;set;}/// <summary>/// 旅游/// </summary>public String index_tr{get;set;}/// <summary>/// 舒适指数/// </summary>public String index_co{get;set;}/// <summary>/// ??/// </summary>public String st1{get;set;}public String st2{get;set;}public String st3{get;set;}public String st4{get;set;}public String st5{get;set;}public String st6{get;set;}/// <summary>/// 晨练/// </summary>public String index_cl{get;set;}/// <summary>/// 晾晒/// </summary>public String index_ls{ get; set; }/// <summary>/// 过敏/// </summary>public String index_ag{get;set;}}总结:从上⾯三个接⼝来看,调⽤的关键是获取【城市代码】,所以⽓象局⼜提供了三个查询城市代码接⼝。
国家⽓象局提供的天⽓预报接⼝及使⽤说明国家⽓象局提供的天⽓预报接⼝接⼝地址:对于第三个接⼝,返回信息⽐较全⾯,也是以json格式提供,格式如下{"weatherinfo": { //基本信息; "city":"北京","city_en":"beijing","date_y":"2012年2⽉16⽇", "date":"", "week":"星期四", "fchh":"11", "cityid":"101010100", //摄⽒温度 "temp1":"2℃~-7℃", "temp2":"1℃~-7℃","temp3":"4℃~-7℃", "temp4":"7℃~-5℃", "temp5":"5℃~-3℃", "temp6":"5℃~-2℃", //华⽒温度; "tempF1":"35.6℉~19.4℉","tempF2":"33.8℉~19.4℉", "tempF3":"39.2℉~19.4℉", "tempF4":"44.6℉~23℉", "tempF5":"41℉~26.6℉", "tempF6":"41℉~28.4℉", //天⽓描述;"weather1":"晴", "weather2":"晴", "weather3":"晴", "weather4":"晴转多云", "weather5":"多云", "weather6":"多云转阴", //天⽓描述图⽚序号"img1":"0", "img2":"99", "img3":"0", "img4":"99", "img5":"0", "img6":"99", "img7":"0", "img8":"1", "img9":"1", "img10":"99", "img11":"1","img12":"2", "img_single":"0", //图⽚名称; "img_title1":"晴", "img_title2":"晴", "img_title3":"晴", "img_title4":"晴", "img_title5":"晴","img_title6":"晴", "img_title7":"晴", "img_title8":"多云", "img_title9":"多云", "img_title10":"多云", "img_title11":"多云","img_title12":"阴", "img_title_single":"晴", //风速描述 "wind1":"北风3-4级转微风", "wind2":"微风", "wind3":"微风", "wind4":"微风","wind5":"微风", "wind6":"微风", //风速级别描述 "fx1":"北风", "fx2":"微风", "fl1":"3-4级转⼩于3级", "fl2":"⼩于3级", "fl3":"⼩于3级","fl4":"⼩于3级", "fl5":"⼩于3级", "fl6":"⼩于3级", //今天穿⾐指数; "index":"冷","index_d":"天⽓冷,建议着棉⾐、⽪夹克加⽺⽑衫等冬季服装。
附录 A(资料性)接口示例A.1 站点资料服务接口示例A.1.1 地面资料服务接口示例作为示例,表A.1给出了指定时间的地面资料检索接口。
表A.1指定时间的地面资料检索接口A.1.2 高空资料服务接口示例作为示例,表A.2给出了指定时间、高度、经纬度范围的高空资料检索接口。
表A.2指定时间、高度、经纬度范围的高空资料检索接口A.1.3 台风资料服务接口示例作为示例,表A.3给出了指定时间段、台风编号(国际)的台风资料检索接口。
表A.3指定时间段、台风编号(国际)的台风资料检索接口表A.3指定时间段、台风编号(国际)的台风资料检索接口(续)A.2数值格点资料解析接口示例A.2.1格点场解码要素服务接口示例作为示例,表A.4给出了指定时间、预报层次、预报时效的单场单要素检索接口。
表A.4 指定时间、预报层次、预报时效的单场单要素检索接口A.2.2经纬度点要素服务接口示例作为示例,表A.5给出了指定时间范围、预报层次、预报时段、经纬度的时间序列检索接口。
表A.5 指定时间范围、预报层次、预报时段、经纬度的时间序列检索接口表A.5指定时间范围、预报层次、预报时段、经纬度的时间序列检索接口(续)A.3文件类资料服务接口示例 A.3.1雷达资料服务接口示例作为示例,表A.6给出了指定时间段的雷达资料检索接口。
表A.6 指定时间段的雷达资料检索接口A.3.2卫星资料服务接口示例作为示例,表A.7给出了指定时间的卫星资料检索接口。
表A.7 指定时间的卫星资料检索接口A.3.3数值预报文件服务接口示例作为示例,表A.8给出了指定时间、预报要素的数值预报文件检索接口。
表A.8 指定时间、预报要素的数值预报文件检索接口附录B(规范性)常用接口参数定义清单表B.1给出了常用接口参数定义清单。
除此之外的参数,可按按需、按规则、参照示范进行扩展。
表B.1 接口参数定义清单表B.1接口参数定义清单(续)表B.1 接口参数定义清单(续)表B.1 接口参数定义清单(续)表B.1接口参数定义清单(续)表B.1接口参数定义清单(续)表B.1接口参数定义清单(续)(规范性)常用返回码定义清单表C.1给出了常用的接口参数定义。
{"城市代码": [{"省": "北京","市": [{"市名": "北京","编码": "101010100"},{"市名": "朝阳","编码": "101010300"},{"市名": "顺义","编码": "101010400"},{"市名": "怀柔","编码": "101010500"},{"市名": "通州","编码": "101010600"},{"市名": "昌平","编码": "101010700"},{"市名": "延庆","编码": "101010800"},{"市名": "丰台","编码": "101010900"},{"市名": "石景山","编码": "101011000"},{"市名": "大兴","编码": "101011100"{"市名": "房山","编码": "101011200" },{"市名": "密云","编码": "101011300" },{"市名": "门头沟","编码": "101011400" },{"市名": "平谷","编码": "101011500" },{"市名": "八达岭","编码": "101011600" },{"市名": "佛爷顶","编码": "101011700" },{"市名": "汤河口","编码": "101011800" },{"市名": "密云上甸子","编码": "101011900" },{"市名": "斋堂","编码": "101012000" },{"市名": "霞云岭","编码": "101012100" },{"市名": "北京城区","编码": "101012200"{"市名": "海淀","编码": "101010200"}]},{"省": "天津市","市": [{"市名": "天津","编码": "101030100"},{"市名": "宝坻","编码": "101030300"},{"市名": "东丽","编码": "101030400"},{"市名": "西青","编码": "101030500"},{"市名": "北辰","编码": "101030600"},{"市名": "蓟县","编码": "101031400"},{"市名": "汉沽","编码": "101030800"},{"市名": "静海","编码": "101030900"},{"市名": "津南","编码": "101031000"},{"市名": "塘沽","编码": "101031100"},{"市名": "大港","编码": "101031200"},{"市名": "武清","编码": "101030200"},{"市名": "宁河","编码": "101030700"}]},{"省": "上海","市": [{"市名": "上海","编码": "101020100"},{"市名": "宝山","编码": "101020300"},{"市名": "嘉定","编码": "101020500"},{"市名": "南汇","编码": "101020600"},{"市名": "浦东","编码": "101021300"},{"市名": "青浦","编码": "101020800"},{"市名": "松江","编码": "101020900"},{"市名": "奉贤","编码": "101021000"},{"市名": "崇明","编码": "101021100"},{"市名": "徐家汇","编码": "101021200"},{"市名": "闵行","编码": "101020200"},{"市名": "金山","编码": "101020700"}]},{"省": "河北","市": [{"市名": "石家庄","编码": "101090101"},{"市名": "张家口","编码": "101090301"},{"市名": "承德","编码": "101090402"},"市名": "唐山","编码": "101090501"},{"市名": "秦皇岛","编码": "101091101"},{"市名": "沧州","编码": "101090701"},{"市名": "衡水","编码": "101090801"},{"市名": "邢台","编码": "101090901"},{"市名": "邯郸","编码": "101091001"},{"市名": "保定","编码": "101090201"},{"市名": "廊坊","编码": "101090601"}]},{"省": "河南","市": [{"市名": "郑州","编码": "101180101"},{"市名": "新乡","编码": "101180301"{"市名": "许昌","编码": "101180401" },{"市名": "平顶山","编码": "101180501" },{"市名": "信阳","编码": "101180601" },{"市名": "南阳","编码": "101180701" },{"市名": "开封","编码": "101180801" },{"市名": "洛阳","编码": "101180901" },{"市名": "商丘","编码": "101181001" },{"市名": "焦作","编码": "101181101" },{"市名": "鹤壁","编码": "101181201" },{"市名": "濮阳","编码": "101181301" },{"市名": "周口","编码": "101181401"{"市名": "漯河","编码": "101181501"},{"市名": "驻马店","编码": "101181601"},{"市名": "三门峡","编码": "101181701"},{"市名": "济源","编码": "101181801"},{"市名": "安阳","编码": "101180201"}]},{"省": "安徽","市": [{"市名": "合肥","编码": "101220101"},{"市名": "芜湖","编码": "101220301"},{"市名": "淮南","编码": "101220401"},{"市名": "马鞍山","编码": "101220501"},{"市名": "安庆",},{"市名": "宿州","编码": "101220701" },{"市名": "阜阳","编码": "101220801" },{"市名": "亳州","编码": "101220901" },{"市名": "黄山","编码": "101221001" },{"市名": "滁州","编码": "101221101" },{"市名": "淮北","编码": "101221201" },{"市名": "铜陵","编码": "101221301" },{"市名": "宣城","编码": "101221401" },{"市名": "六安","编码": "101221501" },{"市名": "巢湖","编码": "101221601" },{"市名": "池州",},{"市名": "蚌埠","编码": "101220201"}]},{"省": "浙江","市": [{"市名": "杭州","编码": "101210101"},{"市名": "舟山","编码": "101211101"},{"市名": "湖州","编码": "101210201"},{"市名": "嘉兴","编码": "101210301"},{"市名": "金华","编码": "101210901"},{"市名": "绍兴","编码": "101210501"},{"市名": "台州","编码": "101210601"},{"市名": "温州","编码": "101210701"},{"市名": "丽水","编码": "101210801"},{"市名": "衢州","编码": "101211001"},{"市名": "宁波","编码": "101210401"}]},{"省": "重庆","市": [{"市名": "重庆","编码": "101040100"},{"市名": "合川","编码": "101040300"},{"市名": "南川","编码": "101040400"},{"市名": "江津","编码": "101040500"},{"市名": "万盛","编码": "101040600"},{"市名": "渝北","编码": "101040700"},{"市名": "北碚","编码": "101040800"},"市名": "巴南","编码": "101040900" },{"市名": "长寿","编码": "101041000" },{"市名": "黔江","编码": "101041100" },{"市名": "万州天城","编码": "101041200" },{"市名": "万州龙宝","编码": "101041300" },{"市名": "涪陵","编码": "101041400" },{"市名": "开县","编码": "101041500" },{"市名": "城口","编码": "101041600" },{"市名": "云阳","编码": "101041700" },{"市名": "巫溪","编码": "101041800" },{"市名": "奉节","编码": "101041900" },"市名": "巫山","编码": "101042000" },{"市名": "潼南","编码": "101042100" },{"市名": "垫江","编码": "101042200" },{"市名": "梁平","编码": "101042300" },{"市名": "忠县","编码": "101042400" },{"市名": "石柱","编码": "101042500" },{"市名": "大足","编码": "101042600" },{"市名": "荣昌","编码": "101042700" },{"市名": "铜梁","编码": "101042800" },{"市名": "璧山","编码": "101042900" },{"市名": "丰都","编码": "101043000" },"市名": "武隆","编码": "101043100"},{"市名": "彭水","编码": "101043200"},{"市名": "綦江","编码": "101043300"},{"市名": "酉阳","编码": "101043400"},{"市名": "秀山","编码": "101043600"},{"市名": "沙坪坝","编码": "101043700"},{"市名": "永川","编码": "101040200"}]},{"省": "福建","市": [{"市名": "福州","编码": "101230101"},{"市名": "泉州","编码": "101230501"},{"市名": "漳州","编码": "101230601"{"市名": "龙岩","编码": "101230701"},{"市名": "晋江","编码": "101230509"},{"市名": "南平","编码": "101230901"},{"市名": "厦门","编码": "101230201"},{"市名": "宁德","编码": "101230301"},{"市名": "莆田","编码": "101230401"},{"市名": "三明","编码": "101230801"}]},{"省": "甘肃","市": [{"市名": "兰州","编码": "101160101"},{"市名": "平凉","编码": "101160301"},{"市名": "庆阳",},{"市名": "武威","编码": "101160501" },{"市名": "金昌","编码": "101160601" },{"市名": "嘉峪关","编码": "101161401" },{"市名": "酒泉","编码": "101160801" },{"市名": "天水","编码": "101160901" },{"市名": "武都","编码": "101161001" },{"市名": "临夏","编码": "101161101" },{"市名": "合作","编码": "101161201" },{"市名": "白银","编码": "101161301" },{"市名": "定西","编码": "101160201" },{"市名": "张掖",}]},{"省": "广东","市": [{"市名": "广州","编码": "101280101"},{"市名": "惠州","编码": "101280301"},{"市名": "梅州","编码": "101280401"},{"市名": "汕头","编码": "101280501"},{"市名": "深圳","编码": "101280601"},{"市名": "珠海","编码": "101280701"},{"市名": "佛山","编码": "101280800"},{"市名": "肇庆","编码": "101280901"},{"市名": "湛江","编码": "101281001"},{"编码": "101281101" },{"市名": "河源","编码": "101281201" },{"市名": "清远","编码": "101281301" },{"市名": "云浮","编码": "101281401" },{"市名": "潮州","编码": "101281501" },{"市名": "东莞","编码": "101281601" },{"市名": "中山","编码": "101281701" },{"市名": "阳江","编码": "101281801" },{"市名": "揭阳","编码": "101281901" },{"市名": "茂名","编码": "101282001" },{"市名": "汕尾","编码": "101282101" },{"编码": "101280201"}]},{"省": "广西","市": [{"市名": "南宁","编码": "101300101"},{"市名": "柳州","编码": "101300301"},{"市名": "来宾","编码": "101300401"},{"市名": "桂林","编码": "101300501"},{"市名": "梧州","编码": "101300601"},{"市名": "防城港","编码": "101301401"},{"市名": "贵港","编码": "101300801"},{"市名": "玉林","编码": "101300901"},{"市名": "百色","编码": "101301001"},{"市名": "钦州","编码": "101301101"},{"市名": "河池","编码": "101301201"},{"市名": "北海","编码": "101301301"},{"市名": "崇左","编码": "101300201"},{"市名": "贺州","编码": "101300701"}]},{"省": "贵州","市": [{"市名": "贵阳","编码": "101260101"},{"市名": "安顺","编码": "101260301"},{"市名": "都匀","编码": "101260401"},{"市名": "兴义","编码": "101260906"},{"市名": "铜仁","编码": "101260601"},{"市名": "毕节","编码": "101260701"},{"市名": "六盘水","编码": "101260801"},{"市名": "遵义","编码": "101260201"},{"市名": "凯里","编码": "101260501"}]},{"省": "云南","市": [{"市名": "昆明","编码": "101290101"},{"市名": "红河","编码": "101290301"},{"市名": "文山","编码": "101290601"},{"市名": "玉溪","编码": "101290701"},{"市名": "楚雄","编码": "101290801"},{"市名": "普洱","编码": "101290901"},{"市名": "昭通","编码": "101291001"},{"市名": "临沧","编码": "101291101"},{"市名": "怒江","编码": "101291201"},{"市名": "香格里拉","编码": "101291301"},{"市名": "丽江","编码": "101291401"},{"市名": "德宏","编码": "101291501"},{"市名": "景洪","编码": "101291601"},{"市名": "大理","编码": "101290201"},{"市名": "曲靖","编码": "101290401"},{"市名": "保山","编码": "101290501"}]},{"省": "内蒙古","市": [{"市名": "呼和浩特","编码": "101080101"},{"市名": "乌海","编码": "101080301"},{"市名": "集宁","编码": "101080401"},{"市名": "通辽","编码": "101080501"},{"市名": "阿拉善左旗","编码": "101081201"},{"市名": "鄂尔多斯","编码": "101080701"},{"市名": "临河","编码": "101080801"},{"市名": "锡林浩特","编码": "101080901"},{"市名": "呼伦贝尔","编码": "101081000"},{"市名": "乌兰浩特","编码": "101081101"},{"市名": "包头","编码": "101080201"},{"市名": "赤峰","编码": "101080601"}]},{"省": "江西","市": [{"市名": "南昌","编码": "101240101"},{"市名": "上饶","编码": "101240301"},{"市名": "抚州","编码": "101240401"},{"市名": "宜春","编码": "101240501"},{"市名": "鹰潭","编码": "101241101"},{"市名": "赣州","编码": "101240701"},{"市名": "景德镇","编码": "101240801"},{"市名": "萍乡","编码": "101240901"},"市名": "新余","编码": "101241001"},{"市名": "九江","编码": "101240201"},{"市名": "吉安","编码": "101240601"}]},{"省": "湖北","市": [{"市名": "武汉","编码": "101200101"},{"市名": "黄冈","编码": "101200501"},{"市名": "荆州","编码": "101200801"},{"市名": "宜昌","编码": "101200901"},{"市名": "恩施","编码": "101201001"},{"市名": "十堰","编码": "101201101"},{"市名": "神农架","编码": "101201201"{"市名": "随州","编码": "101201301"},{"市名": "荆门","编码": "101201401"},{"市名": "天门","编码": "101201501"},{"市名": "仙桃","编码": "101201601"},{"市名": "潜江","编码": "101201701"},{"市名": "襄樊","编码": "101200201"},{"市名": "鄂州","编码": "101200301"},{"市名": "孝感","编码": "101200401"},{"市名": "黄石","编码": "101200601"},{"市名": "咸宁","编码": "101200701"}]},{"省": "四川","市": [{"市名": "成都","编码": "101270101"},{"市名": "自贡","编码": "101270301"},{"市名": "绵阳","编码": "101270401"},{"市名": "南充","编码": "101270501"},{"市名": "达州","编码": "101270601"},{"市名": "遂宁","编码": "101270701"},{"市名": "广安","编码": "101270801"},{"市名": "巴中","编码": "101270901"},{"市名": "泸州","编码": "101271001"},{"市名": "宜宾","编码": "101271101"},{"市名": "内江","编码": "101271201"},{"市名": "资阳","编码": "101271301"},{"市名": "乐山","编码": "101271401"},{"市名": "眉山","编码": "101271501"},{"市名": "凉山","编码": "101271601"},{"市名": "雅安","编码": "101271701"},{"市名": "甘孜","编码": "101271801"},{"市名": "阿坝","编码": "101271901"},{"市名": "德阳","编码": "101272001"},{"市名": "广元","编码": "101272101"},{"市名": "攀枝花","编码": "101270201"}]},{"省": "宁夏","市": [{"市名": "银川","编码": "101170101"},{"市名": "中卫","编码": "101170501"},{"市名": "固原","编码": "101170401"},{"市名": "石嘴山","编码": "101170201"},{"市名": "吴忠","编码": "101170301"}]},{"省": "青海省","市": [{"市名": "西宁","编码": "101150101"},{"市名": "黄南","编码": "101150301"},{"市名": "海北","编码": "101150801"},{"市名": "果洛","编码": "101150501"},{"市名": "玉树","编码": "101150601"},{"市名": "海西","编码": "101150701"},{"市名": "海东","编码": "101150201"},{"市名": "海南","编码": "101150401"}]},{"省": "山东","市": [{"市名": "济南","编码": "101120101"},{"市名": "潍坊","编码": "101120601"},{"市名": "临沂","编码": "101120901"},{"市名": "菏泽","编码": "101121001"},{"市名": "滨州","编码": "101121101"},{"市名": "东营","编码": "101121201"{"市名": "威海","编码": "101121301" },{"市名": "枣庄","编码": "101121401" },{"市名": "日照","编码": "101121501" },{"市名": "莱芜","编码": "101121601" },{"市名": "聊城","编码": "101121701" },{"市名": "青岛","编码": "101120201" },{"市名": "淄博","编码": "101120301" },{"市名": "德州","编码": "101120401" },{"市名": "烟台","编码": "101120501" },{"市名": "济宁","编码": "101120701" },{"市名": "泰安","编码": "101120801"。
国家气象中心气象信息共享门户系统技术方案1项目概况随着国家气象中心天气预报业务精细化水平的发展,预报产品不断丰富,对外辐射能力不断增强。
现有业务流程中存在的业务系统部署多,业务系统之间彼此独立,数据到产品缺乏统一的管理系统,协调能力不足等问题,已无法满足当前快速发展的现代化天气业务的需求。
气象信息共享门户将在国家气象中心现有业务基础上建立完善业务流转与控制体系,优化中心的预报服务业务流程,提高数据流转和产品利用效率,减少预报服务过程中的人为干预,降低中间环节的复杂度与出错率,增强预报服务协同能力,推进预报和服务业务系统的建设应用,促进天气监视、预报及决策服务平台专业化发展,为国家气象中心现代天气发展及服务能力提升打下良好基础。
同时将建立业务系统规范和数据规范,建立标准化的数据和服务,对预报员、服务人员和业务管理人员身份、权限进行数字化的管理,对国家气象中心主要预报、服务业务系统的运行、数据流转状态等实现实时监视,实现对整个中心业务系统的数据衔接与流转控制,实现对预报员身份信息、准入系统信息、业务监控信息、产品流转状态、任务调度等所有实时信息的显示和统计分析,实现预报产品和服务产品的分发控制,并增强国家气象中心互联网展示气象产品的水平。
2业务需求分析2.1 业务现状分析国家气象中心是全国天气预报的国家级中心,也是世界气象组织亚洲区域气象中心、核污染扩散紧急响应中心,其前身中央气象台,成立于1950年3月1日。
50多年来,国家气象中心有了巨大发展。
国家气象中心的气象服务包括为党中央、国务院和有关政府部门制订指导国民经济发展、组织指挥防灾减灾科学决策所需气象信息的决策气象服务,通过电视、广播、报纸、网站等媒介为公众提供公益气象服务,向国家重点工程、企事业单位趋利避害组织生产所需的专业气象服务,为全国省级气象部门提供指导性气象服务。
国家气象中心建立了针对台风、暴雨、寒潮、高温、沙尘暴、大雾等各类灾害性天气的预报警报系统,开展了0-3天的定量降水预报,4-7天逐日要素滚动预报,10-30 天的延伸期预报;基本形成了警报信息服务、决策气象服务、专业气象服务和专项气象服务等构成的气象服务体系。
全国天气预报接口查询天气预报在APP中常用的一个常用功能,聚合数据全国天气预报接口可以根据根据城市名/id查询天气、根据IP查询天气、据GPS坐标查询天气、查询城市天气三小时预报,并且支持全国不同城市天气预报查询。
代码描述:基于JAVA的全国天气预报接口调用示例,根据文档中注明的需求参数,调用接口返回数据。
关联数据:全国天气预报接口接口地址:https:///docs/api/id/39step1:选择本文所示例的接口"全国天气预报接口" url:/docs/api/id/39/aid/87step2:每个接口都需要传入一个参数key,相当于用户的令牌,所以第一步你需要申请一个keystep3:看文档!!!学过java的同学们都知道,当我们对一个类或者方法不明白其意图和思想时,我们可以去查看文档,这里也不例外,而且对于英文不是特别好的同学来说很幸运的是,聚合网站上的文档都是中文版本的,比起阅读java源码里的英文文档应该轻松很多.全国天气预报接口下面有六个子接口,打开第一个接口链接,看文档发现需要传入一个城市名或者城市ID参数,这个参数我们可以通过第六个子接口获取(接口之间参数的调用类似于java中方法之间的调用),即支持城市列表获取.所以示例中我们先调用这个接口.调用接口涉及到请求网络资源的问题,这里我封装了一个工具类,包含GET和POST两种方法step4:上代码Demo1:网络访问工具类(封装get和post方法)1.package juheAPI;2.3.import java.io.BufferedReader;4.import java.io.BufferedWriter;5.import java.io.InputStream;6.import java.io.InputStreamReader;7.import java.io.OutputStream;8.import java.io.OutputStreamWriter;9.import .HttpURLConnection;10.import .URL;11.import java.util.Map;12.13.public class PureNetUtil {14.15.public static String get(String url){16.return post(url,null);17.}18.19.public static String post(String url,Map param){20.HttpURLConnection conn=null;21.try{22.URL u=new URL(url);23.conn=(HttpURLConnection) u.openConnection();24.StringBuffer sb=null;25.if(param!=null){//如果请求参数不为空26.sb=new StringBuffer();27.28.//默认为false,post方法需要写入参数,设定true29.conn.setDoOutput(true);30.//设定post方法,默认get31.conn.setRequestMethod("POST");32.//获得输出流33.OutputStream out=conn.getOutputStream();34.//对输出流封装成高级输出流35.BufferedWriter writer=new BufferedWriter(new OutputStreamWriter(out));36.//将参数封装成键值对的形式37.for(Map.Entry s:param.entrySet()){38.sb.append(s.getKey()).append("=").append(s.getValue()).append("&");39.}40.//将参数通过输出流写入41.writer.write(sb.deleteCharAt(sb.toString().length()-1).toString());42.writer.close();//一定要关闭,不然可能出现参数不全的错误43.sb=null;44.}45.conn.connect();//建立连接46.sb=new StringBuffer();47.//获取连接状态码48.int recode=conn.getResponseCode();49.BufferedReader reader=null;50.if(recode==200){51.//Returns an input stream that reads from this open connection52.//从连接中获取输入流53.InputStream in=conn.getInputStream();54.//对输入流进行封装55.reader=new BufferedReader(new InputStreamReader(in));56.String str=null;57.sb=new StringBuffer();58.//从输入流中读取数据59.while((str=reader.readLine())!=null){60.sb.append(str).append(System.getProperty("line.separator"));61.}62.//关闭输入流63.reader.close();64.if(sb.toString().length() == 0) {65.return null;66.}67.return sb.toString().substring(0,68.sb.toString().length() - System.getProperty("line.separator").length());69.}70.} catch(Exception e) {71. e.printStackTrace();72.return null;73.}finally{74.if(conn!=null)//关闭连接75.conn.disconnect();76.}77.return null;78.}79.80.}Demo2:调用获取城市列表接口示例1.package juheAPI;2.3.import net.sf.json.JSONArray;4.import net.sf.json.JSONObject;5.6.7.8.public class GetCityList {9.10.public static String excute(){11.String url="/weather/citys?key=***a7558b2e0bedaa19673f74a6809ce";//接口URL12.//PureNetUtil是一个封装了get和post方法获取网络请求数据的工具类13.return PureNetUtil.get(url);//使用get方法14.}15.16.public static String getIDBycityName(String cityName) {17.String result=excute();//返回接口结果,得到json格式数据18.if(result!=null){19.JSONObject obj=JSONObject.fromObject(result);20.result=obj.getString("resultcode");//得到返回状态码21.if(result!=null&&result.equals("200")){//200表示成功返回数据22.result=obj.getString("result");//得到城市列表的json格式字符串数组23.JSONArray arr=JSONArray.fromObject(result);24.for(Object o:arr){//对arr进行遍历25.//将数组中的一个json个数字符串进行解析26.obj=JSONObject.fromObject(o.toString());27.28.//以city这个key为线索判断所需要寻找的这条记录29.result=obj.getString("district");30.//防止输入城市名不全,如苏州市输入为苏州,类似与模糊查询31.if(result.equals(cityName)||result.contains(cityName)){32.result=obj.getString("id");//得到ID33.return result;34.}35.}36.}37.}38.return result;39.}40.public static void main(String[] args) {41.System.out.println(getIDBycityName("香港"));42.}43.}Demo3:调用根据城市名/id查询天气1.package juheAPI;2.3.import net.sf.json.JSONObject;4.5.6.7.public class WeatherReportByCity {8.9.public static String excute(String cityName){10.String url=//此处以返回json格式数据示例,所以format=2,以根据城市名称为例,cityName传入中文11."/weather/index?cityname="+cityName+"&key=***a7558b2e0bedaa19673f74a6809ce";12.return PureNetUtil.get(url);//通过工具类获取返回数据13.}14.15.public static String GetTodayTemperatureByCity(String city) {16.String result=excute(city);17.if(result!=null){18.JSONObject obj=JSONObject.fromObject(result);19.20.result=obj.getString("resultcode");21.22.if(result!=null&&result.equals("200")){23.result=obj.getString("result");24.//此时result中数据有多个key,可以对其key进行遍历,得到对个属性25.obj=JSONObject.fromObject(result);26.//今日温度对应的key是today27.result=obj.getString("today");28.obj=JSONObject.fromObject(result);29.//今日温度对应当key是temperature30.result=obj.getString("temperature");31.return result;32.}33.}34.return result;35.}36.public static void main(String[] args) {37.System.out.println(GetTodayTemperatureByCity("苏州"));38.}39.}Demo4:调用天气种类及表示列表接口示例1.package juheAPI;2.3.import net.sf.json.JSONArray;4.import net.sf.json.JSONObject;5.6.7.8.public class GetWeatherSignAndTypeList {9.//接口地址,因为只需要传入一个固定的key为参数,所以设为常量10.private static final String URL= "/weather/uni?key=***a7558b2e0bedaa19673f74a6809ce";11.12.public static String excute(){13.return PureNetUtil.get(URL);//调用工具类获取接口数据14.}15.16.public static String getWeatherByWid(String wid) {17.String result=excute();//获取接口数据18.if(result!=null){19.JSONObject obj=JSONObject.fromObject(result);20.result=obj.getString("resultcode");21.22.if(result!=null&&result.equals("200")){23.24.result=obj.getString("result");25.JSONArray arr=JSONArray.fromObject(result);26.for(Object o:arr){//遍历数组27.obj=JSONObject.fromObject(o.toString());28.//如果遍历到需要的数据后直接返回结果,根据key(wid)得到value判断是否等于传入参数29.if(obj.getString("wid").equals(wid)){30.result=obj.getString("weather");31.return result;32.}33.}34.}35.}36.return result;37.}38.public static void main(String[] args) {39.System.out.println(getWeatherByWid("10"));40.}41.}step5:调用接口时候如果状态码不是200,仔细参考文档说明,也就是返回step3:看文档!。
气象APP安装使用说明书2015-1-15v1.0.1目录气象APP安装使用说明书 (1)目录 (1)1.APP安装与使用 (2)1.1 APP安装 (2)1.2 APP使用 (2)2.外部服务器部署 (6)2.1 外部服务器部署要求 (6)2.2 外部服务器运行说明 (6)3.内部服务器部署 (6)3.1 内部服务器部署 (6)3.2 内部服务器运行说明 (6)4.数据说明与维护管理 (6)4.1 数据来源说明 (6)4.2 数据维护管理 (7)4.3 数据清理 (11)1.A PP安装与使用1.1APP安装a.在气象局官方渠道获取APP的下载,如气象局微信公共帐号等b.请使用android3.2(尽量4.0以上)以上版本的手机安装c.点击下载的apk便进行安装,点击同意和下一步直到安装完成位置d.在手机已安装程序中找到刚才安装完毕的" 气象“APP,点击进入使用1.2APP使用a.点击后进入APP预读界面,如下图所示:b.进入首页,最顶端会显示短预警通知,“天气“右侧分别为分享和播音按钮,下左侧巨型方块内显示实时天气,实时天气下方为预警信号,背景为天气现象动态图,中下侧为7天预报,最下方为菜单,如下图所示c.点击短预警和预警信号,进入详情页面,点击空气质量值进入详情页面,点击7天预报面板上下箭头可隐藏和显示,左右可滑动。
d.点击雨温实况,进入页面,24小时和48小时可切换,如下图所示:e.点击区县预报,进入页面,上端为12县7天预报,点击各县名称可切换,左右可滑动,下方为生活指数,如下图f.点击设置,进入页面,点击“气象灾害预警“开关可开启和关闭预警的推送消息。
点击检查更新可查看更新最新版本如下图所示:g.点击关注我们,进入页面,扫描二维码可关注气象微信公共帐号,亦可添加微博h.点击关于我们,进入页面,即可看到天气现象和预警的说明2.外部服务器部署2.1外部服务器部署要求服务器端最低要求:系统 linux/windows 、带宽8M、内存2G50G硬盘注:部署时请卸载已有的mysql数据库2.2外部服务器运行说明保证服务器的正常运行,如出现断网、宕机、中毒、遭受攻击等情况,应及时解决。
中国气象局卫星数据广播系统CMACast数据播发平台CMACast接收监控软件用户指南国家气象信息中心中国华云技术开发公司2010年12月目录1 CMACAST小站接收监控软件概述 (3)2 CMACAST小站接收监控软件功能介绍 (6)2.1查询系统状态 (6)2.2查询通道状态 (7)2.3查询浏览系统日志 (11)2.4推送文件 (13)3 CMACAST小站接收监控软件参数设置介绍 (14)3.1设置通道参数 (14)3.2设置流媒体转发参数 (18)3.3设置接收机参数 (19)3.4修改密码 (20)3.5设置文件推送参数 (21)4 CMACAST小站接收监控软件帮助介绍 (23)4.1小站升级介绍 (23)4.2小站帮助介绍 (27)4.3关于CMAC AST介绍 (27)1 CMACAST小站接收监控软件概述CMACAST小站接收监控软件是中国气象局卫星数据广播系统(CMACast)卫星小站专用软件,基于C/S架构,主要实现以下功能:●查询系统状态●查询通道状态●查询系统日志●推送文件CMACAST小站接收监控软件主界面如图错误!未找到引用源。
所示:图0-1:CMACAST小站接收监控软件主界面图如图错误!未找到引用源。
所示,CMACAST小站接收监控软件主界面分为以下三部分:➢主界面上部包含以下信息:●软件系统名称和标志,即中国气象局卫星广播系统;●日期和时间显示当前系统的时间信息;●站点状态信息;●接收机状态;实时显示接收机的ID、IP、入锁状态(分为已入锁和未入锁两种状态)、信号强度(取值范围0~100%)、Eb/N0(信噪比,一般取值在0~15之间)、误码率、数据率(当前文件传输的总速率,单位为Kbps)。
●导航栏;包括系统状态、通道状态、查询浏览、文件推送、系统设置、帮助。
说明:单击导航栏中的各导航项,可进入相应功能界面执行相关操作,具体请参见CMACAST小站接收监控软件功能介绍。
Package‘daymetr’September15,2023Title Interface to the'Daymet'Web ServicesVersion1.7.1Description Programmatic interface to the'Daymet'web services(<>).Allows for easy downloads of'Daymet'climate data directly to your R workspace or your computer.Routines for both single pixel data downloads andgridded(netCDF)data are provided.Depends R(>=3.6)Imports sf,terra,ncdf4,httr,tidyr,tibble,tools,utilsLicense AGPL-3LazyData trueByteCompile trueRoxygenNote7.2.3Suggests ggplot2,dplyr,knitr,markdown,covr,testthatVignetteBuilder knitrURL https:///bluegreen-labs/daymetrBugReports https:///bluegreen-labs/daymetr/issuesNeedsCompilation noAuthor Koen Hufkens[aut,cre](<https:///0000-0002-5070-8109>), BlueGreen Labs[cph,fnd]Maintainer Koen Hufkens<**********************>Repository CRANDate/Publication2023-09-1514:52:05UTCR topics documented:calc_nd (2)daymet_grid_agg (3)daymet_grid_offset (4)12calc_nd daymet_grid_tmean (5)download_daymet (6)download_daymet_batch (8)download_daymet_ncss (9)download_daymet_tiles (11)nc2tif (12)read_daymet (13)tile_outlines (14)Index15 calc_nd Count days meeting set criteriaDescriptionFunction to count the number of days in a given time period that meet a given set of criteria.This can be used to extract indices such as Growing Degree Days(tmin>0),or days with precipitation (prcp!=0).Usagecalc_nd(file,start_doy=1,end_doy=365,criteria,value,internal=FALSE,path=tempdir())Argumentsfile path of afile containing the daily gridded Daymet datastart_doy numeric day-of-year at which counting should begin.(default=1)end_doy numeric day of year at which counting should end.(default=365)criteria logical expression(">=",">","<=","<","==","!=")to evaluatevalue the value that the criteria is evaluated againstinternal return to workspace(TRUE)or write to disk(FALSE)(default=FALSE)path path to which to write data to disk(default=tempdir())ValueA raster object in the R workspace or afile on disk with summary statistics for every pixel whichmeet the predefined criteria.Outputfiles if written tofile will be named nd_YYYY.tif(with YYYY the year of the processed tile or ncss netCDFfile).daymet_grid_agg3 Examples##Not run:#download daily gridded data#using default settings(data written to tempdir())download_daymet_ncss()#read in the Daymet file and report back the number#of days in a year with a minimum temperature lower#than15degrees Cr<-calc_nd(file.path(tempdir(),"tmin_daily_1980_ncss.nc"),criteria="<",value=15,internal=TRUE)#plot the outputterra::plot(r)##End(Not run)daymet_grid_agg Aggregate daily Daymet dataDescriptionAggregates daily Daymet data by time interval to create convenient seasonal datasets for data ex-ploration or modelling.Usagedaymet_grid_agg(file,int="seasonal",fun="mean",internal=FALSE,path=tempdir())Argumentsfile The name of thefile to be e daily gridded Daymet data.int Interval to aggregate by.Options are"monthly","seasonal"or"annual".Sea-sons are defined as the astronomical seasons between solstices and equinoxes(default="seasonal")fun Function to be used to aggregate data.Genertic R functions can be used."mean"and"sum"are suggested.na.rm=TRUE by default.(default="mean") internal logical If FALSE,write the output to a tiffile using the Daymetfile format protocol.4daymet_grid_offset path path to a directory where outputfiles should be ed only if internal= FALSE(default=tempdir())Valueaggregated daily Daymet data as a tifffile written to disk or a raster stack when data is returned to the workspace.Examples##Not run:#This code calculates the average minimum temperature by#season for a subset region.#download default ncss tiled subset for1980#(daily tmin values only),works on tiles as welldownload_daymet_ncss()#Finally,run the functiondaymet_grid_agg(file=file.path(tempdir(),"/tmin_daily_1980_ncss.nc"),int="seasonal",fun="mean")##End(Not run)daymet_grid_offset Returns a time shifted(offset)datasetDescriptionReturns an offset dataset with data running from offset DOY in year-1to offset DOY in the current year.Two years of data(730data layers)are required for this function to work.The output serves as input for further data processing and/or ecosystem modelling efforts.Usagedaymet_grid_offset(data,offset=264)Argumentsdata rasterStack or rasterBrick of730layers(2consecutive years)offset offset of the time series in DOY(default=264,sept21)daymet_grid_tmean5 Examples##Not run:my_subset<-daymet_gridded_offset(mystack,offset=264)##End(Not run)daymet_grid_tmean Averages tmax and tmin’Daymet’gridded productsDescriptionCombines data into a single mean daily temperature(tmean)gridded output(geotiff)for easy post processing and modelling.Optionally a raster object is returned to the current workspace.Usagedaymet_grid_tmean(path=tempdir(),product,year,internal=FALSE)Argumentspath full path location of the daymet tiles(default=tempdir())product either a tile number or a ncss product nameyear which year to processinternal TRUE/FALSE(if FALSE,write the output tofile)using the Daymetfile format protocol.Examples##Not run:#This code calculates the mean temperature#for all daymet tiles in a user provided#directory.In this example we first#download tile11935for tmin and tmax#download a tiledownload_daymet_tiles(tiles=11935,start=1980,end=1980,param=c("tmin","tmax"),path=tempdir())#calculate the mean temperature and export#the result to the R workspace(internal=TRUE)#If internal=FALSE,a file tmean_11935_1980.tif#is written into the source path(path_with_daymet_tiles)tmean<-daymet_grid_tmean(path=tempdir(),tile=11935,year=1980,internal=TRUE)##End(Not run)download_daymet Function to download single location’Daymet’dataDescriptionFunction to download single location’Daymet’dataUsagedownload_daymet(site="Daymet",lat=36.0133,lon=-84.2625,start=2000,end=as.numeric(format(Sys.time(),"%Y"))-2,path=tempdir(),internal=TRUE,silent=FALSE,force=FALSE,simplify=FALSE)Argumentssite the site name.lat latitude(decimal degrees)lon longitude(decimal degrees)start start of the range of years over which to download dataend end of the range of years over which to download datapath set path where to save the data if internal=FALSE(default=NULL)internal TRUE or FALSE,if TRUE returns a list to the R workspace if FALSE puts the down-loaded data into the current working directory(default=FALSE) silent TRUE or FALSE(default),to provide verbose outputforce TRUE or FALSE(default),override the conservative end year settingsimplify output data as a tibble,logical FALSE or TRUE(default=TRUE)ValueDaymet data for a point location,returned to the R workspace or written to disk as a csvfile.Examples##Not run:#The following commands download and process Daymet data#for10years of the>30year of data available since1980.daymet_data<-download_daymet("testsite_name",lat=36.0133,lon=-84.2625,start=2000,end=2010,internal=TRUE)#We can now quickly calculate and plot#daily mean temperature.Also,take note of#the weird format of the header.This format#is not altered as to keep compatibility#with other ways of acquiring Daymet data#through the ORNL DAAC website.#The below command lists headers of#the downloaded nested list.#This data includes information on the site#location etc.The true climate data is stored#in the"data"part of the nested list.#In this case it can be accessed through#daymet_data$data.Other attributes include#for example the tile location(daymet_data$tile),#the altitude(daymet_data$altitude),etc.str(daymet_data)#load the tidyverse(install if necessary)if(!require(tidyverse)){install.package(tidyverse)}library(tidyverse)#Calculate the mean temperature from min#max temperatures and convert the year and doy#to a proper date format.daymet_data$data<-daymet_data$data|>mutate(tmean=(tmax..deg.c.+tmin..deg.c.)/2,date=as.Date(paste(year,yday,sep="-"),"%Y-%j"))#show a simple graph of the mean temperatureplot(daymet_data$data$date,daymet_data$data$tmean,xlab="Date",ylab="mean temperature")#For other practical examples consult the included8download_daymet_batch #vignette.##End(Not run)download_daymet_batch This function downloads’Daymet’data for several single pixel loca-tion,as specified by a batchfile.DescriptionThis function downloads’Daymet’data for several single pixel location,as specified by a batchfile.Usagedownload_daymet_batch(file_location=NULL,start=1980,end=as.numeric(format(Sys.time(),"%Y"))-1,internal=TRUE,force=FALSE,silent=FALSE,path=tempdir(),simplify=FALSE)Argumentsfile_locationfile with several site locations and coordinates in a comma delimited format: site,latitude,longitudestart start of the range of years over which to download dataend end of the range of years over which to download datainternal assign or FALSE,load data into workspace or save to discforce TRUE or FALSE(default),override the conservative end year settingsilent suppress the verbose output(default=FALSE)path set path where to save the data if internal=FALSE(default=tempdir())simplify output data to a tibble,logical FALSE or TRUE(default=TRUE)ValueDaymet data for point locations as a nested list or data written to csvfilesExamples##Not run:#The download_daymet_batch()routine is a wrapper around#the download_daymet()function.It queries a file with#coordinates to easily download a large batch of daymet#pixel locations.When internal=TRUE,the data is stored#in a structured list in an R variable.If FALSE,the data#is written to disk.#create demo locations(two sites)locations<-data.frame(site=c("site1","site2"),lat=rep(36.0133,2),lon=rep(-84.2625,2))#write data to csv filewrite.table(locations,paste0(tempdir(),"/locations.csv"),sep=",",s=TRUE,s=FALSE,quote=FALSE)#download data,will return nested list of daymet datadf_batch<-download_daymet_batch(file_location=paste0(tempdir(),"/locations.csv"),start=1980,end=1980,internal=TRUE,silent=TRUE)#For other practical examples consult the included#vignette.##End(Not run)download_daymet_ncss Function to geographically subset’Daymet’regions exceeding tilelimitsDescriptionFunction to geographically subset’Daymet’regions exceeding tile limitsUsagedownload_daymet_ncss(location=c(34,-82,33.75,-81.75),start=1980,end=1980,param="tmin",frequency="daily",mosaic="na",path=tempdir(),silent=FALSE,force=FALSE,ssl=TRUE)Argumentslocation location of a bounding box c(lat,lon,lat,lon)defined by a top left and bottom-right coordinatesstart start of the range of years over which to download dataend end of the range of years over which to download dataparam climate variable you want to download vapour pressure(vp),minimum and maximum temperature(tmin,tmax),snow water equivalent(swe),solar radia-tion(srad),precipitation(prcp),day length(dayl).The default setting is ALL,this will download all the previously mentioned climate variables.frequency frequency of the data requested(default="daily",other options are"monthly"or"annual").mosaic which tile mosiac to source from(na=Northern America,hi=Hawaii,pr= Puerto Rico),defaults to"na".path directory where to store the downloaded data(default=tempdir())silent suppress the verbose outputforce TRUE or FALSE(default),override the conservative end year settingssl TRUE(default)or FALSE,override default SSL settings in case of CA issues ValuenetCDF datafile of an area circumscribed by the location bounding boxExamples##Not run:#The following call allows you to subset gridded#Daymet data using a bounding box location.This#is an alternative way to query gridded data.The#routine is particularly helpful if you need certain#data which stradles boundaries of multiple tiles#or a smaller subset of a larger tile.Keep in mind#that there is a6GB upper limit to the output file#so querying larger regions will result in an error.#To download larger areas use the download_daymet_tiles()#function.#Download a subset of a/multiple tilesdownload_daymet_tiles11 #into your current working directory.download_daymet_ncss(location=c(34,-82,33.75,-81.75),start=1980,end=1980,param="tmin",path=tempdir())#For other practical examples consult the included#vignette.##End(Not run)download_daymet_tiles Function to batch download gridded’Daymet’data tilesDescriptionFunction to batch download gridded’Daymet’data tilesUsagedownload_daymet_tiles(location=c(18.9103,-114.6109),tiles,start=1980,end=1980,path=tempdir(),param="ALL",silent=FALSE,force=FALSE)Argumentslocation location of a point c(lat,lon)or a bounding box defined by a top left and bottom-right coordinates c(lat,lon,lat,lon)tiles which tiles to download,overrides geographic constraintsstart start of the range of years over which to download dataend end of the range of years over which to download datapath where should the downloaded tiles be stored(default=tempdir())param climate variable you want to download vapour pressure(vp),minimum and maximum temperature(tmin,tmax),snow water equivalent(swe),solar radia-tion(srad),precipitation(prcp),day length(dayl).The default setting is ALL,this will download all the previously mentioned climate variables.silent suppress the verbose outputforce TRUE or FALSE(default),override the conservative end year setting12nc2tif Valuedownloads netCDF tiles as defined by the Daymet tile gridExamples##Not run:Download a single tile of minimum temperaturedownload_daymet_tiles(location=c(18.9103,-114.6109),start=1980,end=1980,param="tmin")#For other practical examples consult the included#vignette.##End(Not run)nc2tif Converts netCDF(nc)files to geotiffDescriptionConversion to.tif to simplify workflows if the data that has been downloaded is to be handled in other software(e.g.QGIS).Usagenc2tif(path=tempdir(),files=NULL,overwrite=FALSE,silent=FALSE)Argumentspath a character string showing the path to the directory containing Daymet.ncfiles (default=tempdir())files a character vector containing the name of one or morefiles to be converted (optional)overwrite a logical controlling whether allfiles will be written,or whetherfiles will not be written in the event that there is already a.tif of thatfile.(default=NULL) silent limit verbose output(default=FALSE)ValueConverted geotifffiles of all netCDF data in the provided directory(path).read_daymet13 Examples##Not run:#The below command converts all netCDF data in#the provided path to geotiff files.Existing#files will be overwritten.If set to FALSE,#files will not be overwritten.#download the datadownload_daymet_ncss(param="tmin",frequency="annual",path=tempdir(),silent=TRUE)#convert files from nc to tifnc2tif(path=tempdir(),overwrite=TRUE)#print converted filesprint(list.files(tempdir(),"*.tif"))##End(Not run)read_daymet Read Single Pixel Daymet dataDescriptionReads Single Pixel Daymet data into a nested list or tibble,preserving header data and criticalfile name information.Usageread_daymet(file,site,skip_header=FALSE,simplify=TRUE)Argumentsfile a Daymet Single Pixel datafilesite a sitename(default=NULL)skip_header do not ingest header meta-data,logical FALSE or TRUE(default=FALSE)simplify output tidy data(tibble),logical FALSE or TRUE(default=TRUE)ValueA nested data structure including site meta-data,the full header and the data as a‘data.frame()‘.14tile_outlines Examples##Not run:#download the datadownload_daymet(site="Daymet",start=1980,end=1980,internal=FALSE,silent=TRUE)#read in the Daymet filedf<-read_daymet(paste0(tempdir(),"/Daymet_1980_1980.csv"))#print data structureprint(str(df))##End(Not run)tile_outlines tile_outlinesDescriptionLarge simple feature collection containing the outlines of all the Daymet tiles available as well as projection information.This data was converted from a shapefile as provided on the Daymet main website.Usagetile_outlinesFormatSpatialPolygonDataFrameTileID tile ID numberXMin minimum longitudeXMax maximum longitudeYMin minimum latitudeYMax maximum latitudeIndex∗datasetstile_outlines,14calc_nd,2daymet_grid_agg,3daymet_grid_offset,4daymet_grid_tmean,5download_daymet,6download_daymet_batch,8download_daymet_ncss,9download_daymet_tiles,11nc2tif,12read_daymet,13tile_outlines,1415。