From 53f7a8a72c7349ac20952ae068d9f1f29c9cdcbc Mon Sep 17 00:00:00 2001
From: Paul Haesler <linkjuggler@gmail.com>
Date: Tue, 29 Nov 2022 11:08:48 +1100
Subject: [PATCH 1/5] Add EPSG:4283 (GDA-94, geographic) to published CRSs (for
 ASTER).

---
 dev/services/wms/ows_refactored/ows_root_cfg.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dev/services/wms/ows_refactored/ows_root_cfg.py b/dev/services/wms/ows_refactored/ows_root_cfg.py
index 631bb3903..b2ae32d4b 100644
--- a/dev/services/wms/ows_refactored/ows_root_cfg.py
+++ b/dev/services/wms/ows_refactored/ows_root_cfg.py
@@ -16,11 +16,16 @@
                 "vertical_coord": "y",
             },
             "EPSG:4326": {"geographic": True, "vertical_coord_first": True},  # WGS-84
-            "EPSG:3577": {  # GDA-94, internal representation
+            "EPSG:3577": {  # GDA-94 Albers - native CRS for most DEA products
                 "geographic": False,
                 "horizontal_coord": "x",
                 "vertical_coord": "y",
             },
+            "EPSG:4238": {  # GDA-94 (geographic) - native CRS for ASTER
+                "geographic": True,
+                "horizontal_coord": "longitude",
+                "vertical_coord": "latitude",
+            },
             "EPSG:3111": {  # VicGrid94 for delwp.vic.gov.au
                 "geographic": False,
                 "horizontal_coord": "x",

From 0ba979113315a87386fca071bd3717d07f9cce20 Mon Sep 17 00:00:00 2001
From: Paul Haesler <linkjuggler@gmail.com>
Date: Tue, 29 Nov 2022 11:16:48 +1100
Subject: [PATCH 2/5] Fix ASTER native CRS and resolution.

---
 .../others/aster/ows_aster_cfg.py             | 68 +++++++++----------
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/dev/services/wms/ows_refactored/others/aster/ows_aster_cfg.py b/dev/services/wms/ows_refactored/others/aster/ows_aster_cfg.py
index 6c1d52a1c..61abccdb0 100644
--- a/dev/services/wms/ows_refactored/others/aster/ows_aster_cfg.py
+++ b/dev/services/wms/ows_refactored/others/aster/ows_aster_cfg.py
@@ -59,8 +59,8 @@
             "product_name": "aster_false_colour",
             "bands": bands_aster,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -81,8 +81,8 @@
             "product_name": "aster_regolith_ratios",
             "bands": bands_aster,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -102,8 +102,8 @@
             "product_name": "aster_aloh_group_composition",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -123,8 +123,8 @@
             "product_name": "aster_aloh_group_content",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -144,8 +144,8 @@
             "product_name": "aster_feoh_group_content",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -165,8 +165,8 @@
             "product_name": "aster_ferric_oxide_composition",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -186,8 +186,8 @@
             "product_name": "aster_ferric_oxide_content",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -207,8 +207,8 @@
             "product_name": "aster_ferrous_iron_content_in_mgoh",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -228,8 +228,8 @@
             "product_name": "aster_ferrous_iron_index",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -249,8 +249,8 @@
             "product_name": "aster_green_vegetation",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -270,8 +270,8 @@
             "product_name": "aster_gypsum_index",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -291,8 +291,8 @@
             "product_name": "aster_kaolin_group_index",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -312,8 +312,8 @@
             "product_name": "aster_mgoh_group_composition",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -333,8 +333,8 @@
             "product_name": "aster_mgoh_group_content",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -354,8 +354,8 @@
             "product_name": "aster_opaque_index",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -375,8 +375,8 @@
             "product_name": "aster_silica_index",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],
@@ -396,8 +396,8 @@
             "product_name": "aster_quartz_index",
             "bands": bands_aster_single_band,
             "resource_limits": reslim_standard,
-            "native_crs": "EPSG:3577",
-            "native_resolution": [15.0, 15.0],
+            "native_crs": "EPSG:4326",
+            "native_resolution": [0.00027777778, -0.00027777778],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],

From 48713ad44573311319b617a0f2c1e667d8ea7913 Mon Sep 17 00:00:00 2001
From: Paul Haesler <linkjuggler@gmail.com>
Date: Tue, 29 Nov 2022 11:28:51 +1100
Subject: [PATCH 3/5] Fix y resolutions in Sentinel-2 layers.

---
 .../baseline_satellite_data/sentinel2/ows_ard_c3_cfg.py     | 6 +++---
 .../baseline_satellite_data/sentinel2/ows_ard_cfg.py        | 6 +++---
 .../baseline_satellite_data/sentinel2/ows_nrt_cfg.py        | 6 +++---
 .../sentinel2/ows_nrt_provisional_cfg.py                    | 6 +++---
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_ard_c3_cfg.py b/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_ard_c3_cfg.py
index 1e02d1b58..d5945d0df 100644
--- a/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_ard_c3_cfg.py
+++ b/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_ard_c3_cfg.py
@@ -25,7 +25,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
@@ -69,7 +69,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
@@ -114,7 +114,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
diff --git a/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_ard_cfg.py b/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_ard_cfg.py
index c246e3c60..83706a905 100644
--- a/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_ard_cfg.py
+++ b/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_ard_cfg.py
@@ -25,7 +25,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
@@ -69,7 +69,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
@@ -122,7 +122,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
diff --git a/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_nrt_cfg.py b/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_nrt_cfg.py
index 9dee7d54e..dec8901cc 100644
--- a/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_nrt_cfg.py
+++ b/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_nrt_cfg.py
@@ -28,7 +28,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
@@ -75,7 +75,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
@@ -120,7 +120,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
diff --git a/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_nrt_provisional_cfg.py b/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_nrt_provisional_cfg.py
index 49164f9be..7b9db00c7 100644
--- a/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_nrt_provisional_cfg.py
+++ b/dev/services/wms/ows_refactored/baseline_satellite_data/sentinel2/ows_nrt_provisional_cfg.py
@@ -28,7 +28,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
@@ -74,7 +74,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],
@@ -120,7 +120,7 @@
     "resource_limits": reslim_for_sentinel2,
     "dynamic": True,
     "native_crs": "EPSG:3577",
-    "native_resolution": [10.0, 10.0],
+    "native_resolution": [10.0, -10.0],
     "image_processing": {
         "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
         "always_fetch_bands": [],

From 586bf7fb55ee3e43aa0038921c228df471ceb98a Mon Sep 17 00:00:00 2001
From: Paul Haesler <linkjuggler@gmail.com>
Date: Tue, 29 Nov 2022 11:29:39 +1100
Subject: [PATCH 4/5] Fix y resolution of HAP demo

---
 dev/services/wms/ows_refactored/others/dev_only/ows_hap_cfg.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev/services/wms/ows_refactored/others/dev_only/ows_hap_cfg.py b/dev/services/wms/ows_refactored/others/dev_only/ows_hap_cfg.py
index f471fda57..3f54c3465 100644
--- a/dev/services/wms/ows_refactored/others/dev_only/ows_hap_cfg.py
+++ b/dev/services/wms/ows_refactored/others/dev_only/ows_hap_cfg.py
@@ -30,7 +30,7 @@
             "bands": bands_hap,
             "resource_limits": reslim_wms_max_datasets_only,
             "native_crs": "EPSG:3577",
-            "native_resolution": [1.0, 1.0],
+            "native_resolution": [1.0, -1.0],
             "image_processing": {
                 "extent_mask_func": "datacube_ows.ogc_utils.mask_by_val",
                 "always_fetch_bands": [],

From ecaf9a1f5ed34aae3dcb5ab8870d5e5b9d059f58 Mon Sep 17 00:00:00 2001
From: Paul Haesler <linkjuggler@gmail.com>
Date: Tue, 29 Nov 2022 11:33:36 +1100
Subject: [PATCH 5/5] And one more bad resolution.

---
 .../ows_refactored/hazards/burntarea/ows_provisional_ba_cfg.py  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dev/services/wms/ows_refactored/hazards/burntarea/ows_provisional_ba_cfg.py b/dev/services/wms/ows_refactored/hazards/burntarea/ows_provisional_ba_cfg.py
index 52cab458b..53450a2e6 100644
--- a/dev/services/wms/ows_refactored/hazards/burntarea/ows_provisional_ba_cfg.py
+++ b/dev/services/wms/ows_refactored/hazards/burntarea/ows_provisional_ba_cfg.py
@@ -269,7 +269,7 @@
             "resource_limits": reslim_for_sentinel2,
             "dynamic": True,
             "native_crs": "EPSG:3577",
-            "native_resolution": [10.0, 10.0],
+            "native_resolution": [10.0, -10.0],
             "flags": [
                 {
                     "band": "land",