From 027de18b69a09431323ecb99a47c850176e52cc2 Mon Sep 17 00:00:00 2001 From: Niko Aarnio Date: Wed, 23 Oct 2024 16:41:09 +0300 Subject: [PATCH] cli: revert running distance_to_anomaly_gdal automatically for windows users in CLI --- eis_toolkit/cli.py | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/eis_toolkit/cli.py b/eis_toolkit/cli.py index 0f754e63..3e3f0c21 100644 --- a/eis_toolkit/cli.py +++ b/eis_toolkit/cli.py @@ -1275,9 +1275,9 @@ def distance_to_anomaly_cli( Uses only the first band of the raster. """ - from sys import platform + # from sys import platform - from eis_toolkit.raster_processing.distance_to_anomaly import distance_to_anomaly, distance_to_anomaly_gdal + from eis_toolkit.raster_processing.distance_to_anomaly import distance_to_anomaly typer.echo("Progress: 10%") @@ -1288,23 +1288,23 @@ def distance_to_anomaly_cli( with rasterio.open(input_raster) as raster: typer.echo("Progress: 25%") - # Use optimized version if Windows - if platform == "win32": - out_image, out_meta = distance_to_anomaly_gdal( - anomaly_raster_profile=raster.profile, - anomaly_raster_data=raster.read(1), - threshold_criteria_value=threshold_criteria_value, - threshold_criteria=get_enum_values(threshold_criteria), - max_distance=max_distance, - ) - else: - out_image, out_meta = distance_to_anomaly( - anomaly_raster_profile=raster.profile, - anomaly_raster_data=raster.read(1), - threshold_criteria_value=threshold_criteria_value, - threshold_criteria=get_enum_values(threshold_criteria), - max_distance=max_distance, - ) + # # Use optimized version if Windows + # if platform == "win32": + # out_image, out_meta = distance_to_anomaly_gdal( + # anomaly_raster_profile=raster.profile, + # anomaly_raster_data=raster.read(1), + # threshold_criteria_value=threshold_criteria_value, + # threshold_criteria=get_enum_values(threshold_criteria), + # max_distance=max_distance, + # ) + # else: + out_image, out_meta = distance_to_anomaly( + anomaly_raster_profile=raster.profile, + anomaly_raster_data=raster.read(1), + threshold_criteria_value=threshold_criteria_value, + threshold_criteria=get_enum_values(threshold_criteria), + max_distance=max_distance, + ) typer.echo("Progress: 75%")