Skip to content

Commit d8227d4

Browse files
authored
Merge pull request #1416 from GeoscienceAustralia/deaintertidal_graphs_bugfixing
Add debug fields to DEA Intertidal to investigate x and y coordinates
2 parents 97db1f4 + b588f85 commit d8227d4

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/style_intertidal_cfg.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"abstract": "Intertidal elevation in metres above Mean Sea Level",
2121
"custom_includes": {
2222
"tide_graph_path": "ows_refactored.sea_ocean_coast.intertidal_c3.utils_intertidal.tide_graph_path", # add custom metadata field
23+
"featureinfo_coords": "ows_refactored.sea_ocean_coast.intertidal_c3.utils_intertidal.featureinfo_coords", # add custom metadata field
2324
},
2425
"index_function": {
2526
"function": "datacube_ows.band_utils.single_band",

dev/services/wms/ows_refactored/sea_ocean_coast/intertidal_c3/utils_intertidal.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,3 +94,16 @@ def tide_graph_path(data, ds):
9494

9595
# Combine into a string
9696
return f"{base_dir}/{product}/{version}/{region_split}/{year}--P1Y/{product}_{region}_{year}--P1Y_final_tide_graph.png"
97+
98+
99+
def featureinfo_coords(data, ds):
100+
"""
101+
Temporary function to test what x and y coordinates are returned on `data`
102+
"""
103+
# Get point from GetFeatureInfo data. On DEA Maps, we
104+
# can assume that `data` coordinates are always in "EPSG:3857"
105+
epsg3857_y, epsg3857_x = data.y.item(), data.x.item()
106+
point_albers = point(y=epsg3857_y, x=epsg3857_x, crs="EPSG:3857").to_crs("EPSG:3577").geom
107+
epsg3577_y, epsg3577_x = point_albers.y, point_albers.x
108+
109+
return f"EPSG:3857 Y: {epsg3857_y}, EPSG:3857 X: {epsg3857_x}, EPSG:3577 Y: {epsg3577_y}, EPSG:3577 X: {epsg3577_x}"

0 commit comments

Comments
 (0)