Last active
November 19, 2020 15:50
-
-
Save jdbcode/15b9b4b618c6664cda10e784c8bf5045 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from pydeck_earthengine_layers import EarthEngineTerrainLayer\n", | |
"import pydeck as pdk\n", | |
"import ee\n", | |
"ee.Initialize()" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 26, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"landsat_img = ee.Image('LANDSAT/LC08/C01/T1_RT_TOA/LC08_068233_20190730')\n", | |
"\n", | |
"elevation = (ee.Image(\"OSU/GIMP/DEM\").resample('bicubic'))\n", | |
"\n", | |
"vis_params = {'bands': ['B4','B3','B2'], 'min': 0, 'max': 0.6, 'gamma': 1.2}" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 27, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"ee_layer = EarthEngineTerrainLayer(\n", | |
" landsat_img,\n", | |
" elevation,\n", | |
" vis_params,\n", | |
" id='EETerrainLayer'\n", | |
")\n", | |
"\n", | |
"view_state = pdk.ViewState(\n", | |
" latitude=68.648,\n", | |
" longitude=-28.662,\n", | |
" zoom=10.5, \n", | |
" bearing=-66.16,\n", | |
" pitch=60)\n", | |
"\n", | |
"r = pdk.Deck(\n", | |
" layers=[ee_layer], \n", | |
" initial_view_state=view_state\n", | |
")\n", | |
"r.show()" | |
] | |
} | |
], | |
"metadata": { | |
"kernelspec": { | |
"display_name": "Python 3", | |
"language": "python", | |
"name": "python3" | |
}, | |
"language_info": { | |
"codemirror_mode": { | |
"name": "ipython", | |
"version": 3 | |
}, | |
"file_extension": ".py", | |
"mimetype": "text/x-python", | |
"name": "python", | |
"nbconvert_exporter": "python", | |
"pygments_lexer": "ipython3", | |
"version": "3.9.0" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment