From 3dc613b2468484b02ae21b028d213ee1c72aa803 Mon Sep 17 00:00:00 2001 From: Noa Mills Date: Tue, 30 Jan 2024 07:54:40 -0800 Subject: [PATCH] fixed crs bug when user does not specify target_crs or resolution --- src/api_core/data_request_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/api_core/data_request_handler.py b/src/api_core/data_request_handler.py index 31cec36..60b7700 100644 --- a/src/api_core/data_request_handler.py +++ b/src/api_core/data_request_handler.py @@ -132,6 +132,11 @@ def _getRasterLayer( match_data_array=target_data, resampling=Resampling[ri_method] ) + # If raster reprojection is not needed, then reproject subset_geom + # to match the crs of the data + else: + request.subset_geom = request.subset_geom.reproject( + data.rio.crs) # Clip to the non-modified requested geometry data = data.rio.clip([request.subset_geom.json], all_touched = True)