Skip to content

Commit

Permalink
add test for Smart Surface LULC
Browse files Browse the repository at this point in the history
  • Loading branch information
weiqi-tori committed Jun 3, 2024
1 parent 4329fb6 commit d053023
Show file tree
Hide file tree
Showing 4 changed files with 747 additions and 62 deletions.
2 changes: 1 addition & 1 deletion city_metrix/layers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .land_surface_temperature import LandSurfaceTemperature
from .tree_cover import TreeCover
from .high_land_surface_temperature import HighLandSurfaceTemperature
from .smart_cities_lulc import SmartCitiesLULC
from .smart_surface_lulc import SmartSurfaceLULC
from .open_street_map import OpenStreetMap, OpenStreetMapClass
from .urban_land_use import UrbanLandUse
from .natural_areas import NaturalAreas
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .building_classifier.building_classifier import BuildingClassifier


class SmartCitiesLULC(Layer):
class SmartSurfaceLULC(Layer):
def __init__(self, land_cover_class=None, **kwargs):
super().__init__(**kwargs)
self.land_cover_class = land_cover_class
Expand Down Expand Up @@ -125,6 +125,7 @@ def get_data(self, bbox):
# use chunk 512x512
aligned_datasets = [ds.chunk({'x': 512, 'y': 512}) for ds in aligned_datasets]
lulc = xr.concat(aligned_datasets, dim='Value').max(dim='Value')
lulc = lulc.compute()

return lulc

Expand Down
Loading

0 comments on commit d053023

Please sign in to comment.