用于在Jupyter开发环境中处理地球引擎的工具
项目描述
earthengine-jupyter
注意:这是一个实验性项目,不是一个官方支持的Google项目。欢迎使用,但我们不能保证稳定性。
设置
try:
import ee_jupyter
print('ee_jupyter was already installed.')
except ModuleNotFoundError:
print('ee_jupyter was not found. Installing now...')
import os
result = os.system('pip -q install earthengine-jupyter')
Make sure that the earthengine-jupyter package is installed...
如何使用
这个库包含一个可以用来显示交互式地图的Map
类。
import ee
from ee_jupyter.core import authenticate_if_needed
from ee_jupyter.ipyleaflet import Map
authenticate_if_needed()
✓ Authentication credentials were found.
# Intialize the Earth Engine client library.
ee.Initialize()
map1 = Map(center=(37.5924, -122.09), zoom=8)
map1
Map(center=[37.5924, -122.09], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom_in_title', 'zo…
定义一个地球引擎图像图层,并将其添加到交互式地图中。
img1 = ee.Image("LANDSAT/LC09/C02/T1_L2/LC09_044034_20220127")
visualization = {
'bands': ['SR_B4', 'SR_B3', 'SR_B2'],
'min': 0.2 / 0.0000275,
'max': 0.4 / 0.0000275,
}
map1.addLayer(eeObject=img1, visParams=visualization, name='Landsat scene')
我们还可以创建一个检查器对象,并将其与之前创建的地图关联起来。
from ee_jupyter.ipyleaflet import Inspector
inspector1 = Inspector(map_object=map1)
inspector1
Inspector(layout=Layout(border_bottom='solid', border_left='solid', border_right='solid', border_top='solid', …
通常,当您创建检查器对象时,您希望将其显示在地图附近。
from ipywidgets import HBox
display(HBox([map1, inspector1]))
HBox(children=(Map(center=[37.5924, -122.09], controls=(ZoomControl(options=['position', 'zoom_in_text', 'zoom…
提示:标题
请注意,当在GitHub Pages上查看时,您可以独立操作Jupyter小部件,但这些小部件之间不相互交互。要体验跨小部件交互性,请在Jupyter环境中打开此笔记本。
显示地图图像
如果您想显示一个静态(非交互式)图像,也可以这样做。将embed=True
参数设置为True将允许图像在笔记本中保存。
from IPython.display import Image
visualization['dimensions'] = 400 # maximum dimension for the image
url = img1.getThumbUrl(visualization)
Image(url=url, format='png', embed=True)
项目详情
下载文件
下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分布
earthengine-jupyter-0.0.7.tar.gz (12.9 kB 查看哈希值)
构建分布
关闭
earthengine-jupyter-0.0.7.tar.gz的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | b0de4b7ef9574b56ef8229aa19ab062e5267a44c49bcfcf51145f81e991bfb21 |
|
MD5 | ac5d472462456fc445db9e483a915b45 |
|
BLAKE2b-256 | b173ed09241b420fb0e274d31e07a17474772dcab5051187eedaca330e788732 |
关闭
earthengine_jupyter-0.0.7-py3-none-any.whl的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | a942441016d3c9703c3d6a52b590ccee4f182bc3cfed015ec2c0161d62739883 |
|
MD5 | 0fb90f932071b3509554567e02843111 |
|
BLAKE2b-256 | 9dbbf75269b57393974f189115319f9a9bfde0f3efdf455305a836fde14e53c3 |