Skip to content

Commit

Permalink
Disable country threshold for now
Browse files Browse the repository at this point in the history
  • Loading branch information
kshitijrajsharma committed Nov 14, 2023
1 parent 17802c8 commit f6baf79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/validation/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f6baf79

Please sign in to comment.