From b5e316d1df1f3f747fc5d067e3a0cfba891823f5 Mon Sep 17 00:00:00 2001 From: Kadir Date: Fri, 5 Apr 2024 11:38:09 +0100 Subject: [PATCH] making sure the routing is only applied to listings which are not done already --- crawler/5_routing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawler/5_routing.py b/crawler/5_routing.py index 439cb0f..1f827ae 100644 --- a/crawler/5_routing.py +++ b/crawler/5_routing.py @@ -9,7 +9,7 @@ BROCK_STREET_LAT_LONG = 51.52570434674584, -0.13956495005056113 filtered_listings = [] for listing in listings: miles = geodesic(BROCK_STREET_LAT_LONG, (listing.latitude, listing.longitude)).miles - if miles <= 7: + if miles <= 7 and not listing.path_routing_json().exists(): filtered_listings.append(listing) print(f"Filtered listings from {len(listings)} to {len(filtered_listings)}")