Hi.
I just thought I would post the final solution that I came up with for this problem.
Its pretty lengthy so I'll try my best to describe it.
Firstly, I created a view called vw_distance which was just all the pois joined to all the locations. This view had 3 columns: poiID, locationID and distance (distance being the distance between the location and the poi)
The next bit is where the...
User Profile
Collapse
-
I guess what I am asking is what is the best way to go to to get this done.
I have tried several methods, each one with it's own pitfalls. I didnt include them because I wanted people to look at this problem from a fresh slate, however I will detail two methods I have used:
...Code:declare @locationid int = 1 select p.id, dbo.fnc_calc_distance(p.lat, p.lng, l.lat, l.lng) as distance, c.houseID as
Leave a comment:
-
EDIT: I have missed a column from each of the tables. Both tables need a column adding called region of type int. For the purposes of this, the values in this column of every row should be 1Leave a comment:
-
Get the id of the next closest location
Hi.
I have an application in which the user can select a location and view it's distance from several Points Of Interests (POIs).
When I retrieve these distances, I would also like to retrieve the ID's of the locations that are the next closest and the next furthest away from each POI. eg. If we have 10 locations, each of them a mile further away from a certain POI the I would like to return: The name of the POI, The...
No activity results to display
Show More
Leave a comment: