Skip to content

Commit

Permalink
add max_tree_cover to get_data()
Browse files Browse the repository at this point in the history
  • Loading branch information
tedw0ng committed Jun 7, 2024
1 parent db16303 commit d60d60b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion city_metrix/layers/tree_cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit d60d60b

Please sign in to comment.