From b588f8503918a68a0bd1289132f93d4c55d13bfd Mon Sep 17 00:00:00 2001 From: Robbi Bishop-Taylor Date: Thu, 26 Mar 2026 16:41:28 +1100 Subject: [PATCH] Bug fixing DEA Intertidal tidal graphs --- .../intertidal_c3/style_intertidal_cfg.py | 1 + .../intertidal_c3/utils_intertidal.py | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/style_intertidal_cfg.py b/dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/style_intertidal_cfg.py index a1f12187d..cb5d2adbd 100644 --- a/dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/style_intertidal_cfg.py +++ b/dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/style_intertidal_cfg.py @@ -20,6 +20,7 @@ "abstract": "Intertidal elevation in metres above Mean Sea Level", "custom_includes": { "tide_graph_path": "ows_refactored.sea_ocean_coast.intertidal_c3.utils_intertidal.tide_graph_path", # add custom metadata field + "featureinfo_coords": "ows_refactored.sea_ocean_coast.intertidal_c3.utils_intertidal.featureinfo_coords", # add custom metadata field }, "index_function": { "function": "datacube_ows.band_utils.single_band", diff --git a/dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/utils_intertidal.py b/dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/utils_intertidal.py index 402657fd7..5e0f1b47a 100644 --- a/dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/utils_intertidal.py +++ b/dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/utils_intertidal.py @@ -94,3 +94,16 @@ def tide_graph_path(data, ds): # Combine into a string return f"{base_dir}/{product}/{version}/{region_split}/{year}--P1Y/{product}_{region}_{year}--P1Y_final_tide_graph.png" + + +def featureinfo_coords(data, ds): + """ + Temporary function to test what x and y coordinates are returned on `data` + """ + # Get point from GetFeatureInfo data. On DEA Maps, we + # can assume that `data` coordinates are always in "EPSG:3857" + epsg3857_y, epsg3857_x = data.y.item(), data.x.item() + point_albers = point(y=epsg3857_y, x=epsg3857_x, crs="EPSG:3857").to_crs("EPSG:3577").geom + epsg3577_y, epsg3577_x = point_albers.y, point_albers.x + + return f"EPSG:3857 Y: {epsg3857_y}, EPSG:3857 X: {epsg3857_x}, EPSG:3577 Y: {epsg3577_y}, EPSG:3577 X: {epsg3577_x}"