基于mineMap的地图台风灾害预警轨迹可视化方案

2023-10-27 18:21

本文主要是介绍基于mineMap的地图台风灾害预警轨迹可视化方案,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

1.需求概要
可视化界面显示气象云图及台风中心运动变化,实时数据显示;
2.效果预览
在这里插入图片描述
方案实施
1.>图层构成分析:
可视范围内构成的应该包含基础图层和动态移动图层,运动线路,运动风标,及运动信息框;
2.>结构拆分:
//:基于单图层创建多个根据风力大小为半径的风面圆图层;
数据组装:

      /*** @Description:圆心处理* @Author: ShiWei* @Date: 2020-09-07*/makeWindGeo(fea,i) {const cen = turf.point(fea[i].geometry.coordinates)// 圆形展示return turf.sector(cen, fea[i].properties.r10, 0, 360)},if( winData.length!==0){let dataObj=winData.data;let r7=Math.floor(Math.random() * 200 + 20);let r10= Math.floor(Math.random() * 300 + 50);dataObj.map((item,index) =>{let properties={wl:parseFloat(item.mws),r10:r10,r7:r7,startTime:item.startTime,endTime:item.endTime,centerPres:item.centerPres,mws:item.mws,mwsMax:item.mws};let point=[];//单点信息point.push(parseFloat(item.lon),parseFloat(item.lat))stp.push(this.mapController.makeFeature("Point",point,properties))features.push(this.makeWindGeo(stp,index))})let source = this.mapController.makeFeatureCollection(features)this.mapController.addSource(this.map, "circle-source-1", source)this.drwWinCircle('win-circle','circle-source-1',this.map)
      /*** @Description: 绘制圆形风力面 采用单图层绘制多个同类面* @Author: ShiWei* @Date: 2020-09-07*/drwWinCircle(id,source,map){if (map.getLayer(id)) {map.removeLayer(id)}map.addLayer({"id": id,"type": "fill","source": source,"paint": {"fill-color": "#35e2ce","fill-opacity": 0.2,}});},

2.同操作拆分出风面中心点point,及轨迹线路

      if( winData.length!==0){let dataObj=winData.data;let r7=Math.floor(Math.random() * 200 + 20);let r10= Math.floor(Math.random() * 300 + 50);dataObj.map((item,index) =>{let properties={wl:parseFloat(item.mws),r10:r10,r7:r7,startTime:item.startTime,endTime:item.endTime,centerPres:item.centerPres,mws:item.mws,mwsMax:item.mws};let point=[];//单点信息point.push(parseFloat(item.lon),parseFloat(item.lat))//风力轨迹坐标line.push(point);stp.push(this.mapController.makeFeature("Point",point,properties))infos.push({point:point,properties})//中心点winCenter.push(this.mapController.makeFeature("Point",point,properties))features.push(this.makeWindGeo(stp,index))})features.map((ite,idx)=>{markerList.push(ite.geometry.coordinates[0][0])})let source = this.mapController.makeFeatureCollection(features)let winCenterSource = this.mapController.makeFeatureCollection(winCenter)this.mapController.addSource(this.map, "center-source-1", winCenterSource)this.drwWinCenter('win-center','center-source-1',this.map)let geo = {type: "FeatureCollection",features: [{type: "Feature",geometry: {"type": "LineString", "coordinates": line},properties: {}}]}//运动数装倒序组装this.infoList=infos.reverse();this.mapController.addSource(this.map, "line-source-1", geo);this.drwWinLine('line-win',"line-source-1",this.map)this.addMarker(this.map,line)this.moveList=line.reverse();minemaputil.fitBounds(this.map, source, { padding: 200 });}

3.绘制中心点及轨迹路线

  /*** @Description:风圈中心位置标识* @Author: ShiWei* @Date: 2020-09-08*/drwWinCenter(id,source,map){if (map.getLayer(id)) {map.removeLayer(id)}map.addLayer({"id": id,"type": "circle","source": source,"paint": {"circle-color": {"property": "wl","stops": [[0, "rgba(255,255,255,0.60)"],[1, "rgba(230,230,230,0.60)"],[2, "rgba(204,204,204,0.60)"],[3, "rgba(179,179,179,0.60)"],[4, "rgba(154,154,154,0.60)"],[5, "rgba(62,217,230,0.60)"],[6, "rgba(79,214,203,0.60)"],[7, "rgba(85,207,137,0.60)"],[8, "rgba(109,214,106,0.60)"],[9, "rgba(160,230,69,0.60)"],[10, "rgba(213,230,69,0.60)"],[11, "rgba(255,232,79,0.60)"],[12, "rgba(245,188,56,0.60)"],[13, "rgba(245,144,56,0.60)"],[14, "rgba(235,103,47,0.60)"],[15, "rgba(218,73,43,0.60)"],[16, "rgba(190,46,45,0.60)"],[17, "rgba(129,56,184,0.60)"],[18, "rgba(67,2,116,0.60)"]]},"circle-radius": 10}});},/*** @Description:绘制风力轨迹线路* @Author: ShiWei* @Date: 2020-09-08*/drwWinLine(id,source,map){map.addLayer({"id": id,"type": "line","source": source,"layout": {"line-join": "round","line-cap": "round"},"paint": {"line-color": "#64a7c2","line-width": 2,"line-opacity": 0.6}});},

4.风标

/*** @Description:风圈引导标记* @Author: ShiWei* @Date: 2020-09-08*/addMarker(map,data){if(this.markerLister) {this.markerLister.remove();}let el = document.createElement('div');el.style.zIndex = 120;el.className = 'pin-wheel-marker';let p = document.createElement('div');p.className = 'pin-wheel-inner';el.appendChild(p);this.markerLister= new minemap.Marker(el, {offset: [-17, -17]}).setLngLat(data[data.length-1]).addTo(map);this.addInfoMarker(0)},

5.动态信息窗

 /*** @Description:动态信息窗体* @Author: ShiWei* @Date: 2020-09-08*/addInfoMarker(i){let data=this.infoList;if(this.infoMarker) {this.infoMarker.remove();}let el=document.createElement('div');el.className="info-content";let line=document.createElement('li')line.className='info-line'el.appendChild(line)let infoM=document.createElement('div');infoM.className='info-cls'let info=document.createElement('div');info.className='info-menu'let tt = document.createElement('li');tt.innerHTML='持续时间'+data[i].properties.startTime+'--'+data[i].properties.startTime;info.appendChild(tt);let qy=document.createElement('li');qy.innerHTML='中心气压'+data[i].properties.centerPres+'百帕';info.appendChild(qy);let fsMin =document.createElement('li');fsMin.innerHTML='最小风速'+data[i].properties.mws+'米/秒';info.appendChild(fsMin);infoM.appendChild(info)el.appendChild(infoM)this.infoMarker= new minemap.Marker(el, {offset: [8, -60]}).setLngLat(data[i].point).addTo(this.map);},

实时播放,暂停,重置

/*** @Description:播放风力轨迹* @Author: ShiWei* @Date: 2020-09-08*/winStart(){if(this.moveList.length>0){let count=0;if(this.tep!==""){count=this.tep;}else {count=0;}this.moveTimer=setInterval(()=>{this.markerLister.setLngLat(this.moveList[count])this.addInfoMarker(count)this.tep=count;count++;if(count===this.moveList.length){clearInterval(this.moveTimer);this.moveTimer=null;this.markerLister.setLngLat(this.moveList[0])this.addInfoMarker(0)}},2000)}},/*** @Description:暂停* @Author: ShiWei* @Date: 2020-09-08*/winStop(){if( this.moveTimer){clearInterval(this.moveTimer);this.moveTimer=null;}this.moveTimer=setInterval(()=>{let count=this.tep;this.markerLister.setLngLat(this.moveList[count])this.addInfoMarker(count)this.tep=count;count++;if(count===this.moveList.length){clearInterval(this.moveTimer);this.moveTimer=null;this.markerLister.setLngLat(this.moveList[0])this.addInfoMarker(0)}},2000)},/*** @Description:重置* @Author: ShiWei* @Date: 2020-09-08*/rest(){this.tep="";clearInterval(this.moveTimer);this.moveTimer=null;this.markerLister.setLngLat(this.moveList[0])this.addInfoMarker(0)},

注意:利用turf将坐标转换成多边形;利用reverse()将数据顺序倒序达到预期效果
1 const cen = turf.point(fea[i].geometry.coordinates) // 圆形展示 return turf.sector(cen, fea[i].properties.r10, 0, 360) 2. reverse()

在这里插入图片描述

这篇关于基于mineMap的地图台风灾害预警轨迹可视化方案的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/287522

相关文章

Redis 多规则限流和防重复提交方案实现小结

《Redis多规则限流和防重复提交方案实现小结》本文主要介绍了Redis多规则限流和防重复提交方案实现小结,包括使用String结构和Zset结构来记录用户IP的访问次数,具有一定的参考价值,感兴趣... 目录一:使用 String 结构记录固定时间段内某用户 IP 访问某接口的次数二:使用 Zset 进行

解读Redis秒杀优化方案(阻塞队列+基于Stream流的消息队列)

《解读Redis秒杀优化方案(阻塞队列+基于Stream流的消息队列)》该文章介绍了使用Redis的阻塞队列和Stream流的消息队列来优化秒杀系统的方案,通过将秒杀流程拆分为两条流水线,使用Redi... 目录Redis秒杀优化方案(阻塞队列+Stream流的消息队列)什么是消息队列?消费者组的工作方式每

MySQL分表自动化创建的实现方案

《MySQL分表自动化创建的实现方案》在数据库应用场景中,随着数据量的不断增长,单表存储数据可能会面临性能瓶颈,例如查询、插入、更新等操作的效率会逐渐降低,分表是一种有效的优化策略,它将数据分散存储在... 目录一、项目目的二、实现过程(一)mysql 事件调度器结合存储过程方式1. 开启事件调度器2. 创

Python中的可视化设计与UI界面实现

《Python中的可视化设计与UI界面实现》本文介绍了如何使用Python创建用户界面(UI),包括使用Tkinter、PyQt、Kivy等库进行基本窗口、动态图表和动画效果的实现,通过示例代码,展示... 目录从像素到界面:python带你玩转UI设计示例:使用Tkinter创建一个简单的窗口绘图魔法:用

Java解析JSON的六种方案

《Java解析JSON的六种方案》这篇文章介绍了6种JSON解析方案,包括Jackson、Gson、FastJSON、JsonPath、、手动解析,分别阐述了它们的功能特点、代码示例、高级功能、优缺点... 目录前言1. 使用 Jackson:业界标配功能特点代码示例高级功能优缺点2. 使用 Gson:轻量

Redis KEYS查询大批量数据替代方案

《RedisKEYS查询大批量数据替代方案》在使用Redis时,KEYS命令虽然简单直接,但其全表扫描的特性在处理大规模数据时会导致性能问题,甚至可能阻塞Redis服务,本文将介绍SCAN命令、有序... 目录前言KEYS命令问题背景替代方案1.使用 SCAN 命令2. 使用有序集合(Sorted Set)

MyBatis延迟加载的处理方案

《MyBatis延迟加载的处理方案》MyBatis支持延迟加载(LazyLoading),允许在需要数据时才从数据库加载,而不是在查询结果第一次返回时就立即加载所有数据,延迟加载的核心思想是,将关联对... 目录MyBATis如何处理延迟加载?延迟加载的原理1. 开启延迟加载2. 延迟加载的配置2.1 使用

Android WebView的加载超时处理方案

《AndroidWebView的加载超时处理方案》在Android开发中,WebView是一个常用的组件,用于在应用中嵌入网页,然而,当网络状况不佳或页面加载过慢时,用户可能会遇到加载超时的问题,本... 目录引言一、WebView加载超时的原因二、加载超时处理方案1. 使用Handler和Timer进行超

无人叉车3d激光slam多房间建图定位异常处理方案-墙体画线地图切分方案

墙体画线地图切分方案 针对问题:墙体两侧特征混淆误匹配,导致建图和定位偏差,表现为过门跳变、外月台走歪等 ·解决思路:预期的根治方案IGICP需要较长时间完成上线,先使用切分地图的工程化方案,即墙体两侧切分为不同地图,在某一侧只使用该侧地图进行定位 方案思路 切分原理:切分地图基于关键帧位置,而非点云。 理论基础:光照是直线的,一帧点云必定只能照射到墙的一侧,无法同时照到两侧实践考虑:关

高效+灵活,万博智云全球发布AWS无代理跨云容灾方案!

摘要 近日,万博智云推出了基于AWS的无代理跨云容灾解决方案,并与拉丁美洲,中东,亚洲的合作伙伴面向全球开展了联合发布。这一方案以AWS应用环境为基础,将HyperBDR平台的高效、灵活和成本效益优势与无代理功能相结合,为全球企业带来实现了更便捷、经济的数据保护。 一、全球联合发布 9月2日,万博智云CEO Michael Wong在线上平台发布AWS无代理跨云容灾解决方案的阐述视频,介绍了