gl3520 gl3510_带有gl gl本机的跨平台地理空间可视化

gl3520 gl3510

Editor’s note: Today’s post is by Ib Green, CTO, and Ilija Puaca, Founding Engineer, both at Unfolded, an “open core” company that builds products and services on the open source deck.gl / vis.gl technology stack, and is also a major contributor to these frameworks. Green and Puaca explain how Google and Unfolded have partnered to develop an open source C++ version of deck.gl. An initial version supporting a limited subset of deck.gl layers and features is now freely available on GitHub.

编者按: 今天的博客是 磅绿色 ,CTO和伊利亚·Puaca创始工程师,无论是在 未折叠 的,“开核”的公司,建立产品和服务的开源deck.gl / vis.gl技术堆栈,并也是这些框架的主要贡献者。 Green和Puaca解释了Google和Unfolded如何合作开发eck.gl的开源C ++版本。 支持deck.gl图层和功能的有限子集的初始版本现已在 GitHub上 免费提供

Image for post
deck.gl PolygonLayer showing Vancouver property prices, running natively on an iOS device.deck.gl PolygonLayer,显示温哥华的房价,在iOS设备上本地运行。

Deck.gl is a widely used large-scale geospatial data visualization framework that has its roots in JavaScript and WebGL. The choice of JavaScript has served the deck.gl community well: Visualization is front-end computing and thus the browser is often the natural vehicle to reach users.

Deck.gl是广泛使用的大规模地理空间数据可视化框架,其根源于JavaScript和WebGL。 JavaScript的选择已经很好地满足了eck.gl社区的需求:可视化是前端计算,因此浏览器通常是吸引用户的天然工具。

But there are cases where native implementation can provide better performance, user experience, and architectural fit, primarily in native mobile applications but also for certain high-performance computing use cases. It’s always been clear that a C++ version would enable new opportunities.

但是在某些情况下,本机实现可以提供更好的性能,用户体验和体系结构适应性,主要是在本机移动应用程序中,但在某些高性能计算用例中也是如此。 一直很清楚,C ++版本将带来新的机遇。

A few months ago, a collaboration with engineers working on Google Earth allowed us to fine-tune the architectural vision for deck.gl-native. The goal was to prototype new deck.gl-powered visualization experiences in Google Earth across web (using WebAssembly), iOS, and Android platforms. A native solution was required to enable a high-performance integration with Google Earth’s rendering engine on all platforms. With our designs solidified, and a concrete use case in hand, we were ready to start building deck.gl in C++.

几个月前,与从事Google Earth的工程师的合作使我们能够微调一下deck.gl-native的架构构想。 我们的目标是在网络( 使用WebAssembly ),iOS和Android平台的Google Earth中为基于eck.gl的新可视化体验提供原型。 需要使用本机解决方案才能在所有平台上实现与Google Earth渲染引擎的高性能集成。 巩固我们的设计并准备好具体用例之后,我们就可以开始用C ++构建deck.gl了。

既熟悉又高效的新API (A new API that’s both familiar and efficient)

The new deck.gl C++ API has been designed to correspond closely to the JavaScript API whenever that makes sense and performance is not sacrificed.

新的deck.gl C ++ API被设计为在不影响性能和性能的情况下与JavaScript API紧密对应。

As can be seen in the sample code, familiar classes such as Deck, ScatterplotLayer, MapView and ViewState work just as a JavaScript deck.gl user would expect. At the same time, layer accessor methods (getPosition and getFillColor) that enable data-driven styling are now based on C++ lambda functions for maximum flexibility and performance.

从示例代码中可以看出,熟悉的类(如DeckScatterplotLayerMapViewViewState可以像JavaScripteck.gl用户所期望的那样工作。 同时,启用数据驱动样式的图层访问器方法( getPositiongetFillColor )现在基于C ++ lambda函数,以实现最大的灵活性和性能。

auto layerProps = std::make_shared<ScatterplotLayer::Props>();
layerProps>getPosition = [](const Row &row) {
return row.getVector3<float>("position");
};
layerProps>getFillColor = [](const Row &row) {
return mathgl::Vector4<float>{255, 0, 0, 255};
};
layerProps>data = /* your dataset (arrow::Table) goes here */;
auto deckProps = std::make_shared<Deck::Props>();
deckProps->layers = {layerProps};
deckProps->initialViewState = std::make_shared<ViewState>();
deckProps->views = {std::make_shared<MapView>()};
auto deck = std::make_shared<Deck>(deckProps);
deck->run();

deck.gl-native C++ code that renders a ScatterplotLayer with data-driven styling.

deck.gl天然C ++ 呈现一个代码 ScatterplotLayer 与数据驱动样式。

Image for post
ScatterplotLayer of Manhattan population, running natively on an iOS device.曼哈顿人口的ScatterplotLayer,在iOS设备上本地运行。

deck.gl-native的软件架构 (Software architecture of deck.gl-native)

Implementing a sophisticated WebGL framework such as deck.gl from scratch in a new programming language (without the need to support backwards compatibility and all the specialized features deck.gl has accumulated on the JavaScript side) gave us the ability to take a fresh look at a number of foundational architectural choices.

使用新的编程语言从头开始实现一个复杂的WebGL框架,例如deck.gl(无需支持向后兼容性,并且deck.gl的所有专门功能都已累积在JavaScript方面)使我们能够重新审视许多基础架构选择。

For more information on deck.gl architecture, the deck.gl Technical Deep-Dive is a good read. While written for the JavaScript version of deck.gl, many concepts apply to the C++ port as well.

有关deck.gl体系结构的更多信息,请阅读deck.gl技术深度学习 。 虽然是为deck.glJavaScript版本编写的,但许多概念也适用于C ++端口。

阿帕奇箭 (Apache Arrow)

All in-memory table processing is based on the Apache Arrow C++ API, which provided significant performance advantages because tables are stored in a GPU-friendly columnar binary data layout.

所有内存中表处理均基于Apache Arrow C ++ API,该表具有显着的性能优势,因为表存储在GPU友好的列式二进制数据布局中。

Note that while Apache Arrow has a fairly sophisticated API, this will be almost invisible to deck.gl-native applications as long they use the loaders provided by deck.gl. CSV and JSON table loaders are provided as part of the deck.gl library in the initial version, and .arrow tables can be loaded with the Arrow API.

请注意,尽管Apache Arrow具有相当复杂的API,但只要使用deck.gl提供的加载程序,这对于eck.gl本机应用程序几乎是看不见的。 CSV和JSON表加载程序在初始版本中作为deck.gl库的一部分提供,并且.arrow表可以使用Arrow API加载。

Naturally, for advanced table processing use cases, applications are free to work directly with the Arrow API to build and process tables, and then pass resulting Arrow tables to deck.gl.

自然地,对于高级表处理用例,应用程序可以自由直接与Arrow API一起使用来构建和处理表,然后将生成的Arrow表传递给deck.gl。

To get started with Arrow, useful resources might be:

要开始使用Arrow,有用的资源可能是:

  • Arrow C++ API Docs

    Arrow C ++ API文件

  • Arrow Test Suite for examples of working code

    Arrow Test Suite提供了工作代码示例

图形后端:通过Dawn的本地WebGPU (Graphics backend: native WebGPU via Dawn)

Deck.gl-native is being built on top of WebGPU API using the Dawn framework.

Deck.gl-native正在使用Dawn框架在WebGPU API之上构建 。

Image for post
Deck.gl LineLayer showing flights out of London.Deck.gl LineLayer显示了飞往伦敦的航班。

The Dawn framework is a C++ implementation of the WebGPU API and is a compelling choice for deck.gl-native:

Dawn框架是WebGPU API的C ++实现,并且是deck.gl-native的理想选择:

  • The JavaScript version of deck.gl will inevitably move from WebGL to WebGPU, so having both C++ and JavaScript work against a common 3D API will significantly increase the ease of aligning the JavaScript and C++ code bases.

    ceck.glJavaScript版本将不可避免地从WebGL迁移到WebGPU,因此将C ++和JavaScript都与通用的3D API结合使用将显着提高对齐JavaScript和C ++代码库的便利性。
  • The Dawn project has the ambition to provide backends on basically all platforms/rendering APIs of interest, including Vulkan, Metal, D3D12, and OpenGL. This ideally means that deck.gl-native itself will only have to implement a single backend, namely Dawn.

    Dawn项目的目标是在所有感兴趣的平台/渲染API上提供后端,包括Vulkan,Metal,D3D12和OpenGL。 理想情况下,这意味着deck.gl-native本身仅需实现一个后端,即Dawn。

Note that Dawn is still a work in progress (with different levels of support for different platforms; the prototype is only being tested on iOS), and there is some risk with this technology choice. However, given the momentum behind WebGPU in browsers, we feel that the prospects are currently looking good.

请注意,Dawn仍在开发中(对不同平台的支持水平不同;仅在iOS上对原型进行了测试),选择此技术存在一定的风险。 但是,鉴于浏览器中WebGPU的发展势头,我们认为当前的前景很好。

未来发展方向 (Future directions)

超越移动设备:工作站和服务器 (Beyond mobile: workstations and servers)

While deck.gl runs well in a mobile web view, this cannot share the context with other rendering engines. A “native” C++ implementation of deck.gl is not only required to provide optimal user experience on mobile devices and through integrations with apps such as Google Earth for mobile; it also provides exciting integration opportunities with a number of advanced, high-performance (usually C++ based) software packages that are not available or performant in browsers. These could be math libraries, computer vision libraries, etc.

虽然deck.gl在移动Web视图中运行良好,但无法与其他渲染引擎共享上下文。 不仅需要“ deck.gl”的“本地” C ++实现,以在移动设备上以及与诸如Google Earth for mobile之类的应用程序集成来提供最佳用户体验,还需要 它还提供了许多高级,高性能(通常基于C ++)的软件包提供激动人心的集成机会,这些软件包在浏览器中不可用或性能不佳。 这些可能是数学库,计算机视觉库等。

Workstations and servers sometimes provide better GPU capabilities than browsers can expose through WebGL, and a C++ deck.gl implementation opens the option to use more advanced GPU acceleration when specialized hardware is available, such as nVidia’s CUDA technology. The ideal setup would be that vis.gl automatically takes maximum advantage of the best hardware that it is available at run-time (whether WebGL, WebGPU or CUDA).

工作站和服务器有时提供比浏览器通过WebGL可以提供的GPU功能更好的功能,并且C ++ deck.gl实现打开了在拥有专用硬件(例如nVidia的CUDA技术)时使用更高级的GPU加速的选项。 理想的设置是vis.gl自动利用运行时可用的最佳硬件(无论是WebGL,WebGPU还是CUDA)的最大优势。

deck.gl作为跨程序语言框架 (deck.gl as a cross-programming-language framework)

With the addition of a native C++ implementation, deck.gl is taking another big step away from being a JavaScript first framework, moving towards becoming a multi-language visualization architecture, complementing pydeck (Python deck.gl bindings) and the completely declarative deck.gl JSON API.

通过添加本机C ++实现,deck.gl从成为JavaScript第一框架迈出了一大步,朝着成为多语言可视化体系结构的方向发展,对pydeck (Python deck.gl绑定)和完全声明性的deck进行了补充。 gl JSON API。

For more information, see the deck.gl cross-platform architecture that describes approaches to keeping multi-language implementations of deck.gl compatible. It’s still a work-in-progress, but gives a sense of the higher level direction.

有关更多信息,请参阅deck.gl跨平台体系结构 ,该体系结构描述了使deck.gl的多语言实现保持兼容的方法。 它仍在进行中,但可以提供更高层次的指导。

附加装载机 (Additional loaders)

CSV and JSON table loaders are provided as part of the deck.gl library. To support additional table formats, additional “loaders” can be implemented that load various formats and “convert” the loaded tables to Arrow representation. Integrations with other C++ libraries, such as GDAL for geospatial and imaging formats, are also interesting.

CSV和JSON表加载程序作为deck.gl库的一部分提供。 为了支持其他表格格式,可以实施其他“加载程序”来加载各种格式并将加载的表“转换”为Arrow表示。 与其他C ++库的集成(例如用于地理空间和影像格式的GDAL)也很有趣。

致谢 (Acknowledgements)

Unfolded would like to thank Google for support and encouragement in getting the deck.gl-native development started.

Unfolded非常感谢Google在开始执行deck.gl本机开发方面的支持和鼓励。

Links

链接

  • deck.gl-native

    甲板本地人

  • deck.gl

    卡组

  • pydeck

    平台

翻译自: https://medium.com/google-earth/cross-platform-geospatial-visualization-with-deck-gl-native-56154b95b54b

gl3520 gl3510

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/389625.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

uiautomator +python 安卓UI自动化尝试

使用方法基本说明&#xff1a;https://www.cnblogs.com/mliangchen/p/5114149.html&#xff0c;https://blog.csdn.net/Eugene_3972/article/details/76629066 环境准备&#xff1a;https://www.cnblogs.com/keeptheminutes/p/7083816.html 简单实例 1.自动化安装与卸载 &#…

power bi中的切片器_在Power Bi中显示选定的切片器

power bi中的切片器Just recently, while presenting my session: “Magnificent 7 — Simple tricks to boost your Power BI Development” at the New Stars of Data conference, one of the questions I’ve received was:就在最近&#xff0c;在“新数据之星”会议上介绍我…

5939. 半径为 k 的子数组平均值

5939. 半径为 k 的子数组平均值 给你一个下标从 0 开始的数组 nums &#xff0c;数组中有 n 个整数&#xff0c;另给你一个整数 k 。 半径为 k 的子数组平均值 是指&#xff1a;nums 中一个以下标 i 为 中心 且 半径 为 k 的子数组中所有元素的平均值&#xff0c;即下标在 i …

数据库逻辑删除的sql语句_通过数据库的眼睛查询sql的逻辑流程

数据库逻辑删除的sql语句Structured Query Language (SQL) is famously known as the romance language of data. Even thinking of extracting the single correct answer from terabytes of relational data seems a little overwhelming. So understanding the logical flow…

数据挖掘流程_数据流挖掘

数据挖掘流程1-简介 (1- Introduction) The fact that the pace of technological change is at its peak, Silicon Valley is also introducing new challenges that need to be tackled via new and efficient ways. Continuous research is being carried out to improve th…

北门外的小吃街才是我的大学食堂

学校北门外的那些小吃摊&#xff0c;陪我度过了漫长的大学四年。 细数下来&#xff0c;我最怀念的是…… &#xff08;1&#xff09;烤鸡翅 吸引指数&#xff1a;★★★★★ 必杀技&#xff1a;酥流油 烤鸡翅有蜂蜜味、香辣味、孜然味……最爱店家独创的秘制鸡翅。鸡翅的外皮被…

[LeetCode]最长公共前缀(Longest Common Prefix)

题目描述 编写一个函数来查找字符串数组中的最长公共前缀。如果不存在公共前缀&#xff0c;返回空字符串 ""。 示例 1:输入: ["flower","flow","flight"]输出: "fl"示例 2:输入: ["dog","racecar",&quo…

spark的流失计算模型_使用spark对sparkify的流失预测

spark的流失计算模型Churn prediction, namely predicting clients who might want to turn down the service, is one of the most common business applications of machine learning. It is especially important for those companies providing streaming services. In thi…

区块链开发公司谈区块链与大数据的关系

在过去的两千多年的时间长河中&#xff0c;数字一直指引着我们去探索很多未知的科学世界。到目前为止&#xff0c;随着网络和信息技术的发展&#xff0c;一切与人类活动相关的活动&#xff0c;都直接或者间接的连入了互联网之中&#xff0c;一个全新的数字化的世界展现在我们的…

Jupyter Notebook的15个技巧和窍门,可简化您的编码体验

Jupyter Notebook is a browser bases REPL (read eval print loop) built on IPython and other open-source libraries, it allows us to run interactive python code on the browser.Jupyter Notebook是基于IPL和其他开源库构建的基于REPL(读取评估打印循环)的浏览器&#…

bi数据分析师_BI工程师和数据分析师的5个格式塔原则

bi数据分析师Image by Author图片作者 将美丽融入数据 (Putting the Beauty in Data) Have you ever been ravished by Vizzes on Tableau Public that look like only magic could be in play to display so much data in such a pleasing way?您是否曾经被Tableau Public上的…

BSOJ 2423 -- 【PA2014】Final Zarowki

Description 有n个房间和n盏灯&#xff0c;你需要在每个房间里放入一盏灯。每盏灯都有一定功率&#xff0c;每间房间都需要不少于一定功率的灯泡才可以完全照亮。 你可以去附近的商店换新灯泡&#xff0c;商店里所有正整数功率的灯泡都有售。但由于背包空间有限&#xff0c;你…

WPF绑定资源文件错误(error in binding resource string with a view in wpf)

报错&#xff1a;无法将“***Properties.Resources.***”StaticExtension 值解析为枚举、静态字段或静态属性 解决办法&#xff1a;尝试右键单击在Visual Studio解决方案资源管理器的资源文件&#xff0c;并选择属性选项&#xff0c;然后设置自定义工具属性 PublicResXFile cod…

因果推论第六章

因果推论 (Causal Inference) This is the sixth post on the series we work our way through “Causal Inference In Statistics” a nice Primer co-authored by Judea Pearl himself.这是本系列的第六篇文章&#xff0c;我们将通过Judea Pearl本人与他人合着的《引诱统计学…

如何优化网站加载时间

一、背景 我们要监测网站的加载情况&#xff0c;可以使用 window.performance 来简单的检测。 window.performance 是W3C性能小组引入的新的API&#xff0c;目前IE9以上的浏览器都支持。一个performance对象的完整结构如下图所示&#xff1a; memory字段代表JavaScript对内存的…

熊猫数据集_处理熊猫数据框中的列表值

熊猫数据集Have you ever dealt with a dataset that required you to work with list values? If so, you will understand how painful this can be. If you have not, you better prepare for it.您是否曾经处理过需要使用列表值的数据集&#xff1f; 如果是这样&#xff0…

旋转变换(一)旋转矩阵

1. 简介 计算机图形学中的应用非常广泛的变换是一种称为仿射变换的特殊变换&#xff0c;在仿射变换中的基本变换包括平移、旋转、缩放、剪切这几种。本文以及接下来的几篇文章重点介绍一下关于旋转的变换&#xff0c;包括二维旋转变换、三维旋转变换以及它的一些表达方式&#…

数据预处理 泰坦尼克号_了解泰坦尼克号数据集的数据预处理

数据预处理 泰坦尼克号什么是数据预处理&#xff1f; (What is Data Pre-Processing?) We know from my last blog that data preprocessing is a data mining technique that involves transforming raw data into an understandable format. Real-world data is often incom…

Pytorch中DNN入门思想及实现

DNN全连接层&#xff08;线性层&#xff09; 计算公式&#xff1a; y w * x b W和b是参与训练的参数 W的维度决定了隐含层输出的维度&#xff0c;一般称为隐单元个数&#xff08;hidden size&#xff09; b是偏差值&#xff08;本文没考虑&#xff09; 举例&#xff1a; 输…

IDEA去除mapper.xml文件中的sql语句的背景色

2019独角兽企业重金招聘Python工程师标准>>> IDEA版本 2017.3 mapper.xml文件中的sql语句&#xff0c;总是黄色一大片&#xff0c;看起来不舒服。 按如下设置进行设置即可 此时设置完还有点背景色 再进行一个设置 Ok,完美解决 转载于:https://my.oschina.net/u/3939…