基于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

相关文章

使用Python和Pyecharts创建交互式地图

《使用Python和Pyecharts创建交互式地图》在数据可视化领域,创建交互式地图是一种强大的方式,可以使受众能够以引人入胜且信息丰富的方式探索地理数据,下面我们看看如何使用Python和Pyec... 目录简介Pyecharts 简介创建上海地图代码说明运行结果总结简介在数据可视化领域,创建交互式地

使用Python实现矢量路径的压缩、解压与可视化

《使用Python实现矢量路径的压缩、解压与可视化》在图形设计和Web开发中,矢量路径数据的高效存储与传输至关重要,本文将通过一个Python示例,展示如何将复杂的矢量路径命令序列压缩为JSON格式,... 目录引言核心功能概述1. 路径命令解析2. 路径数据压缩3. 路径数据解压4. 可视化代码实现详解1

Python 交互式可视化的利器Bokeh的使用

《Python交互式可视化的利器Bokeh的使用》Bokeh是一个专注于Web端交互式数据可视化的Python库,本文主要介绍了Python交互式可视化的利器Bokeh的使用,具有一定的参考价值,感... 目录1. Bokeh 简介1.1 为什么选择 Bokeh1.2 安装与环境配置2. Bokeh 基础2

Java Response返回值的最佳处理方案

《JavaResponse返回值的最佳处理方案》在开发Web应用程序时,我们经常需要通过HTTP请求从服务器获取响应数据,这些数据可以是JSON、XML、甚至是文件,本篇文章将详细解析Java中处理... 目录摘要概述核心问题:关键技术点:源码解析示例 1:使用HttpURLConnection获取Resp

Java实现优雅日期处理的方案详解

《Java实现优雅日期处理的方案详解》在我们的日常工作中,需要经常处理各种格式,各种类似的的日期或者时间,下面我们就来看看如何使用java处理这样的日期问题吧,感兴趣的小伙伴可以跟随小编一起学习一下... 目录前言一、日期的坑1.1 日期格式化陷阱1.2 时区转换二、优雅方案的进阶之路2.1 线程安全重构2

Java图片压缩三种高效压缩方案详细解析

《Java图片压缩三种高效压缩方案详细解析》图片压缩通常涉及减少图片的尺寸缩放、调整图片的质量(针对JPEG、PNG等)、使用特定的算法来减少图片的数据量等,:本文主要介绍Java图片压缩三种高效... 目录一、基于OpenCV的智能尺寸压缩技术亮点:适用场景:二、JPEG质量参数压缩关键技术:压缩效果对比

基于Python打造一个可视化FTP服务器

《基于Python打造一个可视化FTP服务器》在日常办公和团队协作中,文件共享是一个不可或缺的需求,所以本文将使用Python+Tkinter+pyftpdlib开发一款可视化FTP服务器,有需要的小... 目录1. 概述2. 功能介绍3. 如何使用4. 代码解析5. 运行效果6.相关源码7. 总结与展望1

SpringBoot首笔交易慢问题排查与优化方案

《SpringBoot首笔交易慢问题排查与优化方案》在我们的微服务项目中,遇到这样的问题:应用启动后,第一笔交易响应耗时高达4、5秒,而后续请求均能在毫秒级完成,这不仅触发监控告警,也极大影响了用户体... 目录问题背景排查步骤1. 日志分析2. 性能工具定位优化方案:提前预热各种资源1. Flowable

Java进行文件格式校验的方案详解

《Java进行文件格式校验的方案详解》这篇文章主要为大家详细介绍了Java中进行文件格式校验的相关方案,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录一、背景异常现象原因排查用户的无心之过二、解决方案Magandroidic Number判断主流检测库对比Tika的使用区分zip

Python Dash框架在数据可视化仪表板中的应用与实践记录

《PythonDash框架在数据可视化仪表板中的应用与实践记录》Python的PlotlyDash库提供了一种简便且强大的方式来构建和展示互动式数据仪表板,本篇文章将深入探讨如何使用Dash设计一... 目录python Dash框架在数据可视化仪表板中的应用与实践1. 什么是Plotly Dash?1.1