diff --git a/city_metrix/layers/tree_cover.py b/city_metrix/layers/tree_cover.py index e5e89c4..1fa3fa0 100644 --- a/city_metrix/layers/tree_cover.py +++ b/city_metrix/layers/tree_cover.py @@ -13,7 +13,7 @@ class TreeCover(Layer): NO_DATA_VALUE = 255 - def __init__(self, min_tree_cover=None, **kwargs): + def __init__(self, min_tree_cover=None, max_tree_cover=None, **kwargs): super().__init__(**kwargs) self.min_tree_cover = min_tree_cover @@ -27,6 +27,8 @@ def get_data(self, bbox): if self.min_tree_cover is not None: data = data.where(data >= self.min_tree_cover) + if self.max_tree_cover is not None: + data = data.where(data <= self.max_tree_cover) return data