-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create impervious_surface.py #66
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test function to check if the new layer works well
def get_data(self, bbox): | ||
# load impervious_surface | ||
dataset = ee.Image("Tsinghua/FROM-GLC/GAIA/v10").gt(0) # change_year_index is zero if permeable as of 2018 | ||
imperv_surf = ee.ImageCollection(dataset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataset
needs to be forced to ImageCollection to apply the filterBounds()
and other functions.
AttributeError: 'Image' object has no attribute 'filterBounds'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forced dataset to be imagecollection, and added test for impervious surface. (Not 100% sure I did that right.)
tests/test_layers.py
Outdated
@@ -77,6 +78,9 @@ def test_high_land_surface_temperature(): | |||
data = HighLandSurfaceTemperature().get_data(BBOX_BRAZIL_LAURO_DE_FREITAS_1) | |||
assert data.any() | |||
|
|||
def test_impervious_surface(): | |||
data = ImperviousSurface().get_data(BBOX_BRAZIL_LAURO_DE_FREITAS_1) | |||
assert data.any() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent error cause test failed
The structure of |
Adding layer for impervious surface from GEE Tsinghua dataset.