Forum Discussion
Finding closest Clinic from a given postcode
- 2 years ago
distances are in km.
Define "closest". As the crow flies, or on a road network? Which distances are we talking about? Can you use approximations based on the general location, or do you need to use the Great Circle calculation?
Hi thanks for your reply.
Looking at distance, we can use crow flies and would like to use the Great circle calculation.
- lbendlin2 years agoSuper User
Sounds good. Please provide sample data that fully covers your issue.
- zuber852 years agoFrequent Visitor
I cannot upload a spreadsheet with my data however here is a small example:
This would be a list of ALL postcodes (currently 160,000 rows):
AB25 1HN AB25 2YT AB51 5DD EH39 4HH EH4 7HF EH46 7HZ EH54 7BA EH6 8JL FK2 0TS FK7 9NL G2 6UA G73 3HS G73 5DJ IV18 0AA IV36 1DT IV36 1EQ KY12 8QB ML11 9WQ PA15 2TL PH10 6JQ Then this would be my clinics table, which will grow and I will need to add more:
Clinic Post Code Name EH3 9AF EDINBURGH G1 1DQ GLASGOW AB12 3LF ABERDEEN DD2 5JT DUNDEE So, when a postcode is entered, it will look to see which clinic is closest from the clinic list and display the name of the clinic and how far it is,
for example if the post code was EH4 7HF then the response would show
CLINIC NAME: Edinburgh
Distance: 4.4 miles- lbendlin2 years agoSuper User
distances are in km.