Skip to content
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

Merged
merged 13 commits into from
Sep 6, 2024
Merged

Create impervious_surface.py #66

merged 13 commits into from
Sep 6, 2024

Conversation

tedw0ng
Copy link
Member

@tedw0ng tedw0ng commented Aug 25, 2024

Adding layer for impervious surface from GEE Tsinghua dataset.

@tedw0ng tedw0ng requested a review from weiqi-tori August 25, 2024 21:40
Copy link
Member

@weiqi-tori weiqi-tori left a 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
Copy link
Member

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'

Copy link
Member Author

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.)

@@ -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()
Copy link
Member

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

@weiqi-tori
Copy link
Member

The structure of test_layers.py has been updated recently, the test function needs to be updated accordingly to pass the test. You could rebase on the main branch first, then make the adjustment.
FAILED tests/test_layers.py::test_impervious_surface - NameError: name 'BBOX_BRAZIL_LAURO_DE_FREITAS_1' is not defined

@weiqi-tori weiqi-tori requested a review from chrowe September 6, 2024 02:47
@chrowe chrowe merged commit 5157ebc into main Sep 6, 2024
1 check passed
@chrowe chrowe deleted the add_impervious_surface_layer branch September 6, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants