Skip to content

Commit

Permalink
further testing processing error
Browse files Browse the repository at this point in the history
  • Loading branch information
kcartier-wri committed Dec 19, 2024
1 parent 193d854 commit 86cda0c
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions city_metrix/layers/nasa_dem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import ee
import xee
import xarray as xr

from .layer import Layer, get_image_collection

Expand All @@ -16,12 +14,20 @@ def __init__(self, spatial_resolution=30, **kwargs):
self.spatial_resolution = spatial_resolution

def get_data(self, bbox):
dataset = ee.Image("NASA/NASADEM_HGT/001")
nasa_dem = ee.ImageCollection(ee.ImageCollection(dataset)
.filterBounds(ee.Geometry.BBox(*bbox))
.select('elevation')
.mean()
)
data = get_image_collection(nasa_dem, bbox, self.spatial_resolution, "NASA DEM").elevation

return data
nasa_dem = ee.Image("NASA/NASADEM_HGT/001")

nasa_dem_elev = (ee.ImageCollection(nasa_dem)
.filterBounds(ee.Geometry.BBox(*bbox))
.select('elevation')
.mean()
)

nasa_dem_elev_ic = ee.ImageCollection(nasa_dem_elev)
data = get_image_collection(
nasa_dem_elev_ic,
bbox,
self.spatial_resolution,
"NASA DEM"
).elevation

return data

0 comments on commit 86cda0c

Please sign in to comment.