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.自动化安装与卸载 &#…

5922. 统计出现过一次的公共字符串

5922. 统计出现过一次的公共字符串 给你两个字符串数组 words1 和 words2 &#xff0c;请你返回在两个字符串数组中 都恰好出现一次 的字符串的数目。 示例 1&#xff1a;输入&#xff1a;words1 ["leetcode","is","amazing","as",&…

Python+Appium寻找蓝牙/wifi匹配

前言&#xff1a; 此篇是介绍怎么去寻找蓝牙&#xff0c;进行匹配。主要2个问题点&#xff1a; 1.在不同环境下&#xff0c;搜索到的蓝牙数量有变 2.在不同环境下&#xff0c;搜索到的蓝牙排序会变 简单思路&#xff1a; 将搜索出来的蓝牙名字添加到一个list去&#xff0c;然后…

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;在“新数据之星”会议上介绍我…

字符串匹配 sunday算法

#include"iostream" #include"string.h" using namespace std;//BF算法 int strfind(char *s1,char *s2,int pos){int len1 strlen(s1);int len2 strlen(s2);int i pos - 1,j 0;while(j < len2){if(s1[i j] s2[j]){j;}else{i;j 0;}}if(j len2){…

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

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

Adobe After Effects CS6 操作记录

安装 After Effects CS6 在Mac OS 10.12.5 上无法直接安装, 需要浏览到安装的执行文件后才能进行 https://helpx.adobe.com/creative-cloud/kb/install-creative-suite-mac-os-sierra.html , 但是即使安装成功, 也不能正常启动, 会报"You can’t use this version of the …

数据库逻辑删除的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…

好用的模块

import requests# 1、发get请求urlhttp://api.xxx.xx/api/user/sxx_infodata{stu_name:xxx}reqrequests.get(url,paramsdata) #发get请求print(req.json()) #字典print(req.text) #string,json串# 返回的都是什么# 返回的类型是什么# 中文的好使吗# 2、发请求posturlhttp://api…

5940. 从数组中移除最大值和最小值

5940. 从数组中移除最大值和最小值 给你一个下标从 0 开始的数组 nums &#xff0c;数组由若干 互不相同 的整数组成。 nums 中有一个值最小的元素和一个值最大的元素。分别称为 最小值 和 最大值 。你的目标是从数组中移除这两个元素。 一次 删除 操作定义为从数组的 前面 …

BZOJ4127Abs——树链剖分+线段树

题目描述 给定一棵树,设计数据结构支持以下操作 1 u v d  表示将路径 (u,v) 加d 2 u v 表示询问路径 (u,v) 上点权绝对值的和 输入 第一行两个整数n和m&#xff0c;表示结点个数和操作数接下来一行n个整数a_i,表示点i的权值接下来n-1行,每行两个整数u,v表示存在一条(u,v)的…

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

数据挖掘流程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;酥流油 烤鸡翅有蜂蜜味、香辣味、孜然味……最爱店家独创的秘制鸡翅。鸡翅的外皮被…

786. 第 K 个最小的素数分数

786. 第 K 个最小的素数分数 给你一个按递增顺序排序的数组 arr 和一个整数 k 。数组 arr 由 1 和若干 素数 组成&#xff0c;且其中所有整数互不相同。 对于每对满足 0 < i < j < arr.length 的 i 和 j &#xff0c;可以得到分数 arr[i] / arr[j] 。 那么第 k 个…

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

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

域嵌套太深_pyspark如何修改嵌套结构域

域嵌套太深In our adventures trying to build a data lake, we are using dynamically generated spark cluster to ingest some data from MongoDB, our production database, to BigQuery. In order to do that, we use PySpark data frames and since mongo doesn’t have …

redis小结

Redis 切换到redis的目录 启动&#xff1a;./redis-server 关闭&#xff1a;killall redis-server Redis的数据类型&#xff1a; String字符 list链表 set集合&#xff08;无序&#xff09; Sort Set排序&#xff08;有序&#xff09; hash数据类型 string类型的数据操作 re…

WIN10下ADB工具包安装的教程和总结 --201809

ADB&#xff08;Android Debug Bridge&#xff09;是Android SDK中的一个工具, 使用ADB可以直接操作管理Android模拟器或者真实的Andriod设备。 ADB主要功能有: 在Android设备上运行Shell(命令行)管理模拟器或设备的端口映射在计算机和设备之间上传/下载文件将电脑上的本地APK软…

1816. 截断句子

1816. 截断句子 句子 是一个单词列表&#xff0c;列表中的单词之间用单个空格隔开&#xff0c;且不存在前导或尾随空格。每个单词仅由大小写英文字母组成&#xff08;不含标点符号&#xff09;。 例如&#xff0c;“Hello World”、“HELLO” 和 “hello world hello world”…

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…