File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -370,15 +370,19 @@ async def item_search(ctx: Context) -> ItemSearchResult:
370370 f"Params formulation time: { params_formulation_time - query_formulation_time } seconds"
371371 )
372372
373- polygon = await get_polygon_from_geodini (results .location )
374- if polygon :
375- logger .info (f"Found polygon for { results .location } " )
376- params ["intersects" ] = polygon
373+ if results .location :
374+ polygon = await get_polygon_from_geodini (results .location )
375+ if polygon :
376+ logger .info (f"Found polygon for { results .location } " )
377+ params ["intersects" ] = polygon
378+ else :
379+ explanation += f"\n \n No polygon found for { results .location } . "
380+ return ItemSearchResult (
381+ items = None , search_params = params , aoi = None , explanation = explanation
382+ )
377383 else :
378- explanation += f"\n \n No polygon found for { results .location } . "
379- return ItemSearchResult (
380- items = None , search_params = params , aoi = None , explanation = explanation
381- )
384+ polygon = None
385+ explanation += "\n \n No specific location provided in the query."
382386 geocoding_time = time .time ()
383387 logger .info (f"Geocoding time: { geocoding_time - params_formulation_time } seconds" )
384388
You can’t perform that action at this time.
0 commit comments