数据源 earth文件_使用pydeck和Earth引擎可视化地理空间数据

本文介绍了如何结合pydeck库和Google Earth Engine,通过earth文件来实现地理空间数据的可视化,帮助读者理解并掌握这种强大的数据展示方法。
摘要由CSDN通过智能技术生成

数据源 earth文件

Editor’s note: Today’s post is by Ib Green, CTO, and Kyle Barron, Software 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 Barron explain Google and Unfolded’s new open source framework, earthengine-layers, which enables Google Earth Engine to be used in combination with deck.gl to build a new generation of visualization applications.

编者按: 今天的帖子由 CTO Ib Green 和软件工程师Kyle Barron共同组成, Unfolded 是一家“开放式核心”公司,该公司在开放源代码deck.gl/vis.gl技术堆栈上构建产品和服务,并且也是这些框架的主要贡献者。 Green和Barron解释了Google和 Unfolded 的新开源框架 Earthengine-layers ,该 框架 使Google Earth Engine与eck.gl结合使用可以构建新一代的可视化应用程序。

When Unfolded got the opportunity to collaborate with Google on a deck.gl / Earth Engine integration, we did not hesitate. Deck.gl is a GPU-powered geospatial visualization framework for large-scale geospatial data, and it had long been clear to us that making the spectacular data available through the Earth Engine API accessible in deck.gl visualizations would be very powerful, and would open up new important new use cases.

当Unfolded获得机会在deck.gl/Earth Engine集成中与Google合作时,我们毫不犹豫。 Deck.gl是用于大型地理空间数据的GPU驱动的地理空间可视化框架,我们很早就知道,通过eck.gl中可访问的Earth Engine API提供壮观的数据将非常强大,并且会打开新的重要的新用例。

While the visualization that comes with the Earth Engine Code Editor is already very versatile, it is most optimized for high-performance visualization of raster vector tiles generated by the Earth Engine cloud on top of flat maps. The deck.gl integration adds a number of new capabilities:

虽然Earth Engine代码编辑器随附的可视化功能已经非常通用,但它已针对在平面地图上由Earth Engine云生成的栅格矢量图块的高性能可视化进行了最优化。 deck.gl集成增加了许多新功能:

  • Toolbox: deck.gl is a toolbox that lets you build complete visualization applications.

    工具箱: deck.gl是一个工具箱,可让您构建完整的可视化应用程序。

  • Vector data support: Earth Engine data rendered as true vector geometries.

    向量数据支持:呈现为真实向量几何的Earth Engine数据。

  • Layer combinations: deck.gl allows visual layers showing different data sources to be freely combined. This brings the ability to render raster data as an image-based backdrop, and then overlay it with vector data rendered as true vector geometries.

    图层组合: deck.gl允许自由组合显示不同数据源的可视图层。 这样就可以将栅格数据渲染为基于图像的背景,然后将其与渲染为真实矢量几何图形的矢量数据叠加。

  • Beyond 2D tiles: The deck.gl APIs also provide rich interactivity, enhanced animations, and even the ability to interpret Earth Engine data as terrain elevations and display them in full 3D.

    超越2D贴: deck.gl API还提供了丰富的交互性,增强的动画效果,甚至还可以将Earth Engine数据解释为地形高程并以完整3D形式显示。

Image for post
Earth Engine raster tiles interpreted as elevation data by the deck.gl TerrainLayer and displayed in perspective view.
deck.gl TerrainLayer Earth Engine栅格图块解释为高程数据, 并以透视图显示。

同时支持Python和JavaScript API (Support for both Python and JavaScript APIs)

While web visualizations are typically programmed in JavaScript, Earth Engine has a big Python-focused community of data scientists. The fact that both the Earth Engine and the deck.gl APIs now have JavaScript and Python bindings allowed us to support both communities with a single integration effort.

虽然通常使用JavaScript对网络可视化进行编程,但Earth Engine拥有一个以Python为中心的大型数据科学家社区。 现在,Earth Engine和deck.gl API都具有JavaScript和Python绑定这一事实使我们能够通过一次集成工作来支持这两个社区。

在JavaScript中使用EarthEngineLayer (Using the EarthEngineLayer in JavaScript)

The new EarthEngineLayer is a normal JavaScript deck.gl layer that can be imported into and used in any deck.gl application, instantiated with an Earth Engine JavaScript object, and of course, used in combination with any other existing deck.gl layers.

新的EarthEngineLayer是一个普通JavaScript deck.gl层,可以将其导入到任何eck.gl应用程序中并在其中使用,可以使用Earth Engine JavaScript对象实例化,当然也可以与任何其他现有的deck.gl层结合使用。

import React from 'react';
import DeckGL from '@deck.gl/react';
import {EarthEngineLayer} from '@unfolded.gl/earthengine-layers';
import ee from '@google/earthengine';export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {eeObject: null};
} async _onLoginSuccess(user, loginProvider) {
const token = 'Google OAuth2 access token'
await EarthEngineLayer.initializeEEApi(
{clientId: EE_CLIENT_ID, token});
this.setState({eeObject: ee.Image('CGIAR/SRTM90_V4')});
} render() {
const {viewport} = this.props;
const {eeObject} = this.state;
const visParams = {
min: 0,
max: 4000,
palette: ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']
};
const layers = [new EarthEngineLayer({eeObject, visParams})];
return (
<DeckGL controller {...viewport} layers={layers}/>
);
}
}

Note: this example uses deck.gl’s React bindings, but it can also be written in pure JavaScript.

注意:这个例子使用了deck.gl的React绑定,但是它也可以用纯JavaScript编写。

在Python中使用EarthEngineLayer (Using the EarthEngineLayer in Python)

Deck.gl provides Python bindings through pydeck. The new pydeck_earthengine_layers add-on module is available on both pip and conda.

Deck.gl通过pydeck提供Python绑定。 新的pydeck_earthengine_layers附加模块可在pip和conda上使用。

All the application needs to do is to pass its ‘ee’ API object to the EarthEngineLayer together with a few visualization parameters, and then pass that Earth Engine layer instance to pydeck’s Deck class.

所有程序需要做的是它的通过'ee' API对象到EarthEngineLayer与一些可视化的参数一起,然后传递地球引擎层实例pydeck的甲板类。

from pydeck_earthengine_layers import EarthEngineLayer
import pydeck as pdk
import eeee.Initialize()image = ee.Image('CGIAR/SRTM90_V4')
vis_params = {
"min": 0,
"max": 4000,
'palette': ['006633', 'E5FFCC', '662A00', 'D8D8D8', 'F5F5F5']
}
ee_layer = EarthEngineLayer(image, vis_params)
view_state = pdk.ViewState(latitude=37.7749295, longitude=-122.4194155, zoom=10, bearing=0, pitch=45)
r = pdk.Deck(
layers=[ee_layer],
initial_view_state=view_state
)r.show()

Under the hood, the EarthEngineLayer converts Earth Engine Python API objects into Earth Engine JavaScript API objects that can be manipulated by deck.gl and are then used to retrieve Earth Engine data for display. The standard pydeck API can be used to control and interact with the EarthEngineLayer.

在引擎盖下, EarthEngineLayer将Earth Engine Python API对象转换为Earth引擎JavaScript API对象,这些对象可以由deck.gl操纵,然后用于检索Earth Engine数据以进行显示。 标准pydeck API可用于控制EarthEngineLayer并与EarthEngineLayer交互。

卫星数据的力量 (The power of satellite data)

The combination of Google Earth Engine and deck.gl enables effortless visualization of huge geospatial datasets. The selection of datasets in Earth Engine is very rich, and the processing features of the Earth Engine API also allow for custom data to be synthesized from the existing catalogs, so the potential for exploration is huge.

Google Earth Engine和deck.gl的结合使您可以轻松地可视化巨大的地理空间数据集。 Earth Engine中数据集的选择非常丰富,并且Earth Engine API的处理功能还允许从现有目录中合成自定义数据,因此勘探潜力巨大。

This section shows just a few examples that were built to demonstrate the capabilities of using deck.gl and Earth Engine together.

本部分仅显示了一些示例,这些示例旨在演示结合使用deck.gl和Earth Engine的功能。

Image for post
SRTM 30-meter resolution elevation data over North America, visualized with a hypsometric tint. Lower elevations are deeper greens; brown and white shades correspond to higher elevations.
SRTM在北美的30米分辨率高程数据,通过水压色调可视化。 较低的海拔是较深的果岭。 棕色和白色阴影对应于更高的海拔。

Traditionally, Earth Engine visualizations are raster-based. Deck.gl provides the ability to mix raster and vector-based graphics. The improved clarity of vector-based graphics combined with rich styling (including 3D extrusions and elevations) and also interactivity (informational tooltips when hovering) can open up new visualization applications.

传统上,Earth Engine可视化是基于栅格的。 Deck.gl提供了混合栅格和基于矢量的图形的功能。 基于矢量的图形的改进的清晰度与丰富的样式(包括3D拉伸和高程)以及交互性(悬停时的信息工具提示)相结合,可以开拓新的可视化应用程序。

Image for post
The NOAA’s NOAA的《 Atlantic Hurricane Catalog大西洋飓风目录》 visualized as vector graphics using a deck.gl GeoJsonLayer. 使用deck.gl GeoJsonLayer可视化为矢量图形。
Image for post
The World Resources Institute’s 世界资源研究所的 Global Power Plant Database全球电厂数据库 , visualized as a scatterplot layer with a data-driven radius corresponding to the energy output of each power plant. ,可视化为散点图层,其数据驱动半径与每个电厂的能量输出相对应。

与vis.gl社区互动 (Engage with the vis.gl community)

We look forward to seeing what the community builds with the new earthengine-layers framework, bringing planetary-scale satellite-based data to bear on new geospatial problems and applications. If you want to share examples of your work, feel free to engage with us on GitHub; we may be able to host a link to your showcase.

我们期待看到社区使用新的Earthengine-layers框架构建的功能,并将基于行星规模的基于卫星的数据用于新的地理空间问题和应用。 如果您想分享您的工作实例,请随时在GitHub上与我们联系; 我们也许可以托管一个到您的展示柜的链接。

Links

链接

翻译自: https://medium.com/google-earth/visualizing-geospatial-data-with-pydeck-and-earth-engine-8f77ce1fc8bb

数据源 earth文件

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值