From f6baf79c7e920d441a47f788239d35ef1a91d5e5 Mon Sep 17 00:00:00 2001 From: kshtiijrajsharma Date: Tue, 14 Nov 2023 14:51:29 +0545 Subject: [PATCH] Disable country threshold for now --- src/app.py | 18 +++++++++--------- src/validation/models.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/app.py b/src/app.py index 12a96b84..5023f0fb 100644 --- a/src/app.py +++ b/src/app.py @@ -465,15 +465,15 @@ def get_grid_id(geom, cur): countries = backend_match[0] country_export = True logging.debug(f"Using Country Export Mode with id : {countries[0]}") - else: - if int(geom_area) > int(index_threshold): - # this will be applied only when polygon gets bigger we will be slicing index size to search - country_query = get_country_id_query(geometry_dump) - cur.execute(country_query) - result_country = cur.fetchall() - countries = [int(f[0]) for f in result_country] - logging.debug(f"Intersected Countries : {countries}") - cur.close() + # else: + # if int(geom_area) > int(index_threshold): + # # this will be applied only when polygon gets bigger we will be slicing index size to search + # country_query = get_country_id_query(geometry_dump) + # cur.execute(country_query) + # result_country = cur.fetchall() + # countries = [int(f[0]) for f in result_country] + # logging.debug(f"Intersected Countries : {countries}") + # cur.close() return ( g_id, geometry_dump, diff --git a/src/validation/models.py b/src/validation/models.py index 01269c66..d4705e8c 100644 --- a/src/validation/models.py +++ b/src/validation/models.py @@ -213,7 +213,7 @@ def check_geometry_area(cls, value, values): RAWDATA_CURRENT_POLYGON_AREA = int(EXPORT_MAX_AREA_SQKM) if area_km2 > RAWDATA_CURRENT_POLYGON_AREA: raise ValueError( - f"""Polygon Area {int(area_km2)} Sq.KM is higher than Threshold : {RAWDATA_CURRENT_POLYGON_AREA} Sq.KM for {output_type}""" + f"""Polygon Area {int(area_km2)} Sq.KM is higher than Threshold : {RAWDATA_CURRENT_POLYGON_AREA} Sq.KM""" ) return value