diff --git a/city_metrix/layers/__init__.py b/city_metrix/layers/__init__.py index 4af37fb..ea7fa8a 100644 --- a/city_metrix/layers/__init__.py +++ b/city_metrix/layers/__init__.py @@ -17,3 +17,4 @@ from .tree_canopy_height import TreeCanopyHeight from .alos_dsm import AlosDSM from .overture_buildings import OvertureBuildings +from .nasa_dem import NasaDEM diff --git a/city_metrix/layers/nasa_dem.py b/city_metrix/layers/nasa_dem.py new file mode 100644 index 0000000..6ef78cd --- /dev/null +++ b/city_metrix/layers/nasa_dem.py @@ -0,0 +1,19 @@ +import ee +import xee +import xarray as xr +from city_metrix.layers.layer import Layer, get_image_collection + +class NasaDEM(Layer): + def __init__(self, **kwargs): + super().__init__(**kwargs) + + 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, 30, "NASA DEM").elevation + + return data