From 1711c6a69e30c6ea6e28b1263b78be928a6aa30f Mon Sep 17 00:00:00 2001 From: phaesler Date: Tue, 24 Mar 2020 12:20:43 +1100 Subject: [PATCH] Fix bug in geographic CRS requests. Issue #225 --- datacube_ows/data.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/datacube_ows/data.py b/datacube_ows/data.py index 44cfd4216..63e3417cb 100644 --- a/datacube_ows/data.py +++ b/datacube_ows/data.py @@ -321,19 +321,18 @@ def get_map(args): if not data or (params.style.masks and not pq_data): body = _write_empty(params.geobox) else: - body = _write_png(data, pq_data, params.style, extent_mask) + body = _write_png(data, pq_data, params.style, extent_mask, params.geobox) - cfg = get_config() return body, 200, cfg.response_headers({"Content-Type": "image/png"}) @log_call @opencensus_trace_call(tracer=tracer) -def _write_png(data, pq_data, style, extent_mask): +def _write_png(data, pq_data, style, extent_mask, geobox): img_data = style.transform_data(data, pq_data, extent_mask) - width = len(img_data.coords["x"]) - height = len(img_data.coords["y"]) + width = geobox.width + height = geobox.height # width, height = img_data.pixel_counts()