Created
August 15, 2020 16:16
-
-
Save KMarkert/39f1af2eafc9e5574909ad9432b1106d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
using PyCall; | |
# import the ee Python module into Julia | |
# and initialize the EE API | |
ee = pyimport("ee"); | |
ee.Initialize(); | |
# load in ee.Image and sample a point | |
dem = ee.Image("USGS/SRTMGL1_003"); | |
xy = ee.Geometry.Point([86.9250, 27.9881]...); | |
# notice the ellipsis after the coordinate list | |
# this is splatting, allowing for users pass | |
# unknown number of arguments as an array from an iterable | |
elev = dem.sample(xy, 30).first().get("elevation").getInfo(); | |
println("Mount Everest elevation (m): ", elev); | |
# result should be: 'Mount Everest elevation (m): 8729' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment