Skip to content

Commit

Permalink
cli: revert running distance_to_anomaly_gdal automatically for window…
Browse files Browse the repository at this point in the history
…s users in CLI
  • Loading branch information
nmaarnio committed Oct 23, 2024
1 parent 8e2c2a4 commit 027de18
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions eis_toolkit/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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%")

Expand All @@ -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%")

Expand Down

0 comments on commit 027de18

Please sign in to comment.