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.pswp.cn/news/389625.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/389625.shtml
英文地址,請注明出處:http://en.pswp.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…