Skip to content

Commit

Permalink
Merge pull request #44 from wri/feature/alos_dsm
Browse files Browse the repository at this point in the history
add ALOS DSM layer
  • Loading branch information
chrowe authored Jun 3, 2024
2 parents 09f91dc + 3be7c7d commit 5217fc0
Show file tree
Hide file tree
Showing 4 changed files with 754 additions and 58 deletions.
1 change: 1 addition & 0 deletions city_metrix/layers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@
from .average_net_building_height import AverageNetBuildingHeight
from .open_buildings import OpenBuildings
from .tree_canopy_hight import TreeCanopyHeight
from .alos_dsm import AlosDSM
21 changes: 21 additions & 0 deletions city_metrix/layers/alos_dsm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import ee
import xee
import xarray as xr

from .layer import Layer, get_image_collection


class AlosDSM(Layer):
def __init__(self, **kwargs):
super().__init__(**kwargs)

def get_data(self, bbox):
dataset = ee.ImageCollection("JAXA/ALOS/AW3D30/V3_2")
alos_dsm = ee.ImageCollection(dataset
.filterBounds(ee.Geometry.BBox(*bbox))
.select('DSM')
.mean()
)
data = get_image_collection(alos_dsm, bbox, 30, "ALOS DSM").DSM

return data
Loading

0 comments on commit 5217fc0

Please sign in to comment.