This commit is contained in:
Eljakim Herrewijnen 2023-12-27 17:36:36 +01:00
parent 84108aa3ae
commit 498a33c335
2 changed files with 102012 additions and 2 deletions

102002
scrape/out.json Normal file

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,10 @@
import geopy import geopy
# from funda_scraper import FundaScraper # from funda_scraper import FundaScraper
from funda_scraper.scrape import FundaScraper from funda_scraper.scrape import FundaScraper
import datetime, os, pickle, json, tqdm import datetime, os, pickle, json, tqdm, numpy
import osrm import osrm
OSRM_HOST = 'http://www.herreweb.nl:5998' OSRM_HOST = 'https://osrm.herreweb.nl'
NOMINATIM_HOST = 'geocode.herreweb.nl' NOMINATIM_HOST = 'geocode.herreweb.nl'
osrm_c = osrm.Client(host=OSRM_HOST) osrm_c = osrm.Client(host=OSRM_HOST)
@ -65,10 +65,18 @@ def generate_json(houses):
out_dict['name'] = f"{address}_{count}" # Fix for duplicate names in dictionary. out_dict['name'] = f"{address}_{count}" # Fix for duplicate names in dictionary.
out_dict['position'] = destination_location out_dict['position'] = destination_location
for key in houses.keys(): for key in houses.keys():
out_dict[key] = houses.__getattr__(key).get(i) out_dict[key] = houses.__getattr__(key).get(i)
get_distances(out_dict, destination_location) get_distances(out_dict, destination_location)
# Convert numpy data to dumpable python data
for key in out_dict:
if type(out_dict[key]) == numpy.int64:
out_dict[key] = int(out_dict[key])
out.append(out_dict) out.append(out_dict)