Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Proximity search
Message
From
13/04/2010 14:38:35
 
 
To
13/04/2010 00:09:12
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
VB 9.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01459851
Message ID:
01460029
Views:
50
Thanks to everyone who contributed in this amazing thread. I learned a lot of things and I am now building my class.

When I looked at George Mastros's page, I found a lot of interesting information in there. The ability to get those data from several countries and add them into SQL Server is great. But, in overall, as the initial request is based on an already existing table, where several records contain a list of addresses, we will simply have to add a latitude and longitude fields. Then, I will use the Google API to assign the latitude and longitude values for each of them.

Once the table is finalized, we can just use the following to retrieve the records:
declare @CenterLat float=47.7795
declare @CenterLon float=-65.7191
declare @SearchDistance float=25

select * from Test
 where(latitude between @CenterLat -  @SearchDistance/111.0  and  @CenterLat + @SearchDistance/111.0 ) and
 (longitude between @CenterLon - @SearchDistance/111.0 and  (@CenterLon + @SearchDistance/111.0) )
Now, this returns the result instantly. But, what is more interesting is that George Mastros's data, as in the example, which I changed for Canada, thus containing 1621 rows, returns also the results instantly.

Basically, with this approach, I am not even using UDF or anything else. This relies only on the latitude and the longitude fields in the table. So, from one specific location, we just decide on many km we would like to have and the related records would be returned.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform