From 3f251e4c684c1f4420df4b15bffb20d061671ca7 Mon Sep 17 00:00:00 2001 From: Dana Lambert Date: Wed, 1 Dec 2021 10:06:30 +1300 Subject: [PATCH] Add additional region infomation to output documents --- .../right_tree/api/resource_generation_utils.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/backend/right_tree/api/resource_generation_utils.py b/backend/right_tree/api/resource_generation_utils.py index 3cc877d..a82d44d 100644 --- a/backend/right_tree/api/resource_generation_utils.py +++ b/backend/right_tree/api/resource_generation_utils.py @@ -83,6 +83,18 @@ def get_site_filters(request): return filter_rows +def get_additional_region_info(request): + """ If the location coordinates fall within the CHCH or Auckland regions then return a description of where to find more information. + """ + coordinates = request.query_params.get('coordinates') + if coordinates is not None: + if is_in_christchurch(coordinates): + return [["Your location falls within the ecosystem type covered by the Christchurch Council ecosystem maps - further information can be obtained from Ōtautahi/Christchurch ecosystems map link to: https://ccc.govt.nz/environment/land/ecosystem-map", " "], [' ', ' ']] + elif is_in_auckland(coordinates): + return [["Your location falls within the ecosystem type covered by the Auckland Council Tiaki Tāmaki Makaurau Conservation map - further information can be obtained from tiaki Tāmaki Makaurau conservation Auckland - link to https://www.tiakitamakimakaurau.nz/conservation-map/", " "], [' ', ' ']] + + return [] + def get_filter_values(request): """ Retrives all selected values/filters from the request. """ @@ -99,6 +111,8 @@ def get_filter_values(request): # Add the project site filters filter_rows += get_site_filters(request) filter_rows.append([' ', ' ']) + + filter_rows += get_additional_region_info(request) return filter_rows