Skip to content

Retrieving values from DEM data #134

Closed Answered by jdbcode
harrisonjkaplan asked this question in Q&A
Discussion options

You must be logged in to vote

There are two things going wrong here:

  1. Your region is outside of the dataset. Your rectangle is in the Pacific ocean, off the coast of Oregon.

  1. You are accepting the default crs and scale, which are 'EPSG:4326' and 1 degree, respectively. And, with the small rectangle you've defined, it only interests a single 1-degree pixel. So, you only get 1 value returned, which can't be plotted with .plot().

The solution in your case is to move the rectangle to a region that has data and to provide the crs and scale parameters based on the dataset. For example:

dem = ee.Image('USGS/3DEP/10m').select('elevation')
dem_ic = ee.ImageCollection(dem)
rect = ee.Geometry.Rectangle(-124.0302, 42.8196, -12…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jdbcode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants