Skip to content

Commit

Permalink
Changed name of post-processing function.
Browse files Browse the repository at this point in the history
  • Loading branch information
kcartier-wri committed Aug 26, 2024
1 parent 6c623f7 commit 8ae631e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions city_metrix/layers/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def get_data(self, bbox: Tuple[float]) -> Union[xr.DataArray, gpd.GeoDataFrame]:
...

@abstractmethod
def post_processing_adjustment(self, data, **kwargs) -> Union[xr.DataArray, gpd.GeoDataFrame]:
def prepare_for_map_rendering(self, data, **kwargs) -> Union[xr.DataArray, gpd.GeoDataFrame]:
"""
Applies the standard post-processing adjustment used for rendering of the layer
:param are specific to the layer
Expand Down Expand Up @@ -83,15 +83,15 @@ def write(self, bbox, output_path, tile_degrees=None, **kwargs):
file_names = []
for tile in tiles["geometry"]:
data = self.aggregate.get_data(tile.bounds)
data = self.post_processing_adjustment(data, **kwargs)
data = self.prepare_for_map_rendering(data, **kwargs)

file_name = f"{output_path}/{uuid4()}.tif"
file_names.append(file_name)

write_layer(file_name, data)
else:
data = self.aggregate.get_data(bbox)
data = self.post_processing_adjustment(data, **kwargs)
data = self.prepare_for_map_rendering(data, **kwargs)
write_layer(output_path, data)


Expand Down
2 changes: 1 addition & 1 deletion city_metrix/layers/ndvi_sentinel2_gee.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def calculate_ndvi(image):

return xdata

def post_processing_adjustment(self, data, ndvi_threshold=0.4, convert_to_percentage=True, **kwargs):
def prepare_for_map_rendering(self, data, ndvi_threshold=0.4, convert_to_percentage=True, **kwargs):
"""
Applies the standard post-processing adjustment used for rendering of NDVI including masking
to a threshold and conversion to percentage values.
Expand Down

0 comments on commit 8ae631e

Please sign in to comment.