gpalmer711
IS-IT--Management
Hi All,
I wasn't sure whether this should have gone in the SQL group or this one so if you think i'm in the wrong place let me know.
I have a asp.net site that is basically a site for hosting the details of certain venues which people can search for. I'm currently implementing a feature that will allow people to search for venues that are within a certain distance of their location.
I essentially have to code working for this feature, I have the longitudes and latitudes of all the venues in the database and also the longitudes and latitudes of all the postcodes in the uk in another table. A user puts in their postcode and it will first pick out the lat and long of the postcode and then calculate the distance between the venue and the postcode (as the crow flys).
Now there may be as many as 3000 venues in the system within the next few months so what would be the best way of going through all of the records to calculate the distances?
The two thoughts I have had are to go through the records one at a time, calculate the distance and if it is within the required distance add it to a recordset to be desplayed once all the records are checked.
Or
Write a SQL query that checks the distance on the fly. I'm not even sure if this is possible.
If you have any thoughts I would appreciate it.
Greg Palmer
Freeware Utilities for Windows Administrators.
I wasn't sure whether this should have gone in the SQL group or this one so if you think i'm in the wrong place let me know.
I have a asp.net site that is basically a site for hosting the details of certain venues which people can search for. I'm currently implementing a feature that will allow people to search for venues that are within a certain distance of their location.
I essentially have to code working for this feature, I have the longitudes and latitudes of all the venues in the database and also the longitudes and latitudes of all the postcodes in the uk in another table. A user puts in their postcode and it will first pick out the lat and long of the postcode and then calculate the distance between the venue and the postcode (as the crow flys).
Now there may be as many as 3000 venues in the system within the next few months so what would be the best way of going through all of the records to calculate the distances?
The two thoughts I have had are to go through the records one at a time, calculate the distance and if it is within the required distance add it to a recordset to be desplayed once all the records are checked.
Or
Write a SQL query that checks the distance on the fly. I'm not even sure if this is possible.
If you have any thoughts I would appreciate it.
Greg Palmer
Freeware Utilities for Windows Administrators.