news 2026/9/1 17:12:55

基于GeoToolKit实现连井剖面对比显示及交互

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
基于GeoToolKit实现连井剖面对比显示及交互

最近基于GeoToolkit实现单井或多井的柱状图的显示和交互,特别是多井的连通对比分析,很多功能GeoToolkit原来是没有的。因此需要拓展了GeoToolKit的许多功能。本文主要基于GeoToolKit/INT组件,针对多井的测井曲线、岩性剖面、含油气性和射孔井段等进行对比分析展示。因此本次主要基于WellLogWidget实现多井的测井曲线、解释结论和岩性剖面的显示,以及连通性对比,同时支持用户拖动鼠标实现整口井井道的移动,连通性删减等交互操作。具体如下。其中的前后端内容详见之前文章。

1.多井连通性对比效果演示

2.核心代码

主要采用VUE+JS+GeotoolKit.JS,充分利用VUE的组件化设计思想,实现多井多通道剖面显示和连通性交互操作等。
MultiWellDrag.vue

<template> <div> <canvas ref="plot" style="display:block;margin:0 auto;height:900px;position:relative;" /> </div> </template> <script> import {createScene, setupDragInteraction, setupZoneConnectionInteraction, createConnectionContext} from './MultiWellDrag.js'; let plot = null; let disposeDrag = null; let disposeZoneConn = null; export default { name:'wellMultiDrag', destroyed () { if (disposeDrag) { disposeDrag(); disposeDrag = null; } if (disposeZoneConn) { disposeZoneConn(); disposeZoneConn = null; } plot.dispose(); }, mounted () { const canvas = this.$refs.plot; // 用容器实际宽度设置 canvas 像素宽,保证三口井铺满屏幕;高度固定 900 // 1.绘制单井曲线道和油气属性道 const containerWidth = canvas.parentElement.clientWidth || window.innerWidth; console.log('containerWidth', containerWidth); canvas.width = containerWidth; canvas.height = 900; const scene = createScene(canvas); plot = scene.plot; // 创建连接上下文,在拖拽交互与连接交互之间共享连接关系 const connectionContext = createConnectionContext(); // 2.启用井道拖拽交互:按住鼠标左键拖动单井 header,整体移动 WellLogWidget; // 拖动时连接 zone 跟随移动,连接关系不变 disposeDrag = setupDragInteraction(plot, canvas, scene.widgets, connectionContext); // 3.启用 zone 连接交互:点击一口井的 zone 再点击另一口井的 zone 自动连通 disposeZoneConn = setupZoneConnectionInteraction( plot, canvas, scene.wellConfigs, scene.widgets, scene.wellWidth, scene.gap, scene.headerHeight, canvas.height, scene.zoneWellColors, connectionContext ); } }; </script>

MultiWellDrag.js

function createScene (canvas) { // 创建根 Group 容纳多个 WellLogWidget const root = new Group(); root.setAutoModelLimitsMode(true); const { widgets, wellWidth, gap, wellConfigs, headerHeight, zoneWellColors } = createWidgets(canvas.width, canvas.height); widgets.forEach(w => root.addChild(w)); // // 在井间空白区域绘制连通性多边形 // addCorrelationZones(root, wellConfigs, widgets, wellWidth, gap, headerHeight, canvas.height, zoneWellColors); const plot = new Plot({ 'canvasElement': canvas, 'root': root }); // 将每个 WellLogWidget 的内置工具(含 track splitter)注册到 Plot 的工具容器, // 使各井道的分隔线可拖拽调整宽度 try { const plotTool = plot.getTool(); widgets.forEach(w => { plotTool.add(w.getTool()); }); } catch (e) { console.warn('注册 widget 工具失败:', e); } return { plot, widgets, wellWidth, gap, wellConfigs, headerHeight, zoneWellColors }; } /** * 创建连接上下文:在拖拽交互与连接交互之间共享连接关系数据。 * setupZoneConnectionInteraction 负责注册连接和更新函数, * setupDragInteraction 在拖动井道时调用更新函数让连接 zone 跟随移动。 */ function createConnectionContext () { return { connections: [], updateConnectionsForWidget: null, updateAllConnections: null, isDragging: false, // 拖拽进行中标记,bounds 监控时跳过避免重复更新 addConnection (conn) { this.connections.push(conn); }, getConnectionsForWidget (widgetIndex) { return this.connections.filter(function (c) { return c.s1.widgetIndex === widgetIndex || c.s2.widgetIndex === widgetIndex; }); } }; } ......后续代码需要请联系。
版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/9/1 17:12:33

小米秋招测试开发笔试复盘:考点拆解与备考路线指南

2024年8月底&#xff0c;我坐在电脑前&#xff0c;点开小米集团秋招测试开发岗第一批笔试的链接。屏幕上的倒计时提示我&#xff1a;90分钟&#xff0c;2道编程题、1道测试设计题&#xff0c;外加10道计算机基础选择题。说实话&#xff0c;投简历之前我就对测试开发这个岗位做过…

作者头像 李华
网站建设 2026/9/1 17:08:43

计算机视觉第一原理:神经网络基础学习路线与PyTorch实战

这次我们来看一门课&#xff0c;而不是一个“一键部署的工具”。哥伦比亚大学的公开课“计算机视觉第一原理”&#xff08;First Principles of Computer Vision&#xff09;第十二讲&#xff0c;主题是神经网络。这一讲在整门课里的位置很关键&#xff1a;前几讲还在讲成像、特…

作者头像 李华
网站建设 2026/9/1 17:01:58

一加3全能刷机工具箱v2.6:从驱动到救砖的完整刷机指南

简介&#xff1a;一加3全能刷机工具箱v2.6是一款专为一加3用户打造的刷机整合资源&#xff0c;面向希望解锁Bootloader、安装第三方Recovery或刷入类原生ROM的进阶玩家&#xff0c;能有效降低手动收集驱动、镜像与命令脚本的门槛。压缩包共33个文件&#xff0c;体积约70.94MB&a…

作者头像 李华