Skip to content

Commit 9937001

Browse files
committed
feat: add experimental convert_data_type process
1 parent 9706528 commit 9937001

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

openeo/rest/datacube.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,6 +3095,27 @@ def unflatten_dimension(self, dimension: str, target_dimensions: List[str], labe
30953095
),
30963096
)
30973097

3098+
@openeo_process
3099+
def convert_data_type(
3100+
self,
3101+
data_type: str,
3102+
) -> DataCube:
3103+
"""
3104+
Converts the datacube data to another data type.
3105+
3106+
:param data_type: The desired data type.
3107+
3108+
:return: A data cube with the same dimensions but converted to the new data type.
3109+
"""
3110+
return self.process(
3111+
process_id="convert_data_type",
3112+
arguments=dict_no_none(
3113+
data=THIS,
3114+
data_type=data_type
3115+
),
3116+
)
3117+
3118+
30983119

30993120
def _get_geometry_argument(
31003121
argument: Union[

0 commit comments

Comments
 (0)