Skip to content

Commit

Permalink
Read and use nodata from layer metadata. Open-EO/openeo-geotrellis-ex…
Browse files Browse the repository at this point in the history
  • Loading branch information
EmileSonneveld committed Jun 5, 2024
1 parent fb4eb83 commit d7cfb5d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions openeogeotrellis/layercatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ def highest_resolution(band_gsd, coordinate_index):
"opensearch_endpoint", get_backend_config().default_opensearch_endpoint
)
max_soft_errors_ratio = env.get(MAX_SOFT_ERRORS_RATIO, 0.0)
no_data_value = float(metadata.get("_vito", "data_source", "nodata", default=0))
if feature_flags.get("no_resample_on_read", False):
logger.info("Setting NoResampleOnRead to true")
datacubeParams.setNoResampleOnRead(True)
Expand Down Expand Up @@ -538,7 +539,8 @@ def sentinel_hub_pyramid():
sar_backscatter_arguments) if sar_backscatter_arguments else {},
sample_type,
cell_size,
max_soft_errors_ratio
max_soft_errors_ratio,
no_data_value,
)
else:
sentinel_hub_client_alias = env.get(SENTINEL_HUB_CLIENT_ALIAS, 'default')
Expand Down Expand Up @@ -567,7 +569,8 @@ def sentinel_hub_pyramid():
sar_backscatter_arguments) if sar_backscatter_arguments else {},
sample_type,
cell_size,
max_soft_errors_ratio
max_soft_errors_ratio,
no_data_value,
)

unflattened_metadata_properties = metadata_properties(flatten_eqs=False)
Expand Down

0 comments on commit d7cfb5d

Please sign in to comment.