IT Community - Software Programming, Web Development and Technical Support

Zip code,Proximity

This is a discussion on Zip code,Proximity within the Database Support forums, part of the Web Development category; Can u somebody explain how to find the proximity of the zip code ...using zip code database...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 10-11-2007, 08:06 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Zip code Proximity Search SQL Server 2005

Can u somebody explain how to find the proximity of the zip code ...using zip code database
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)

Last edited by kingmaker : 10-28-2007 at 10:26 PM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-11-2007, 08:10 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Re: Zip code Proximity SQL Server 2005

I want to Locates ZIP Codes that are within close proximity of a specified ZIP Code. specify the radius distance in miles, to find a list of ZIP Codes that fall within that radius is displayed
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)

Last edited by kingmaker : 10-26-2007 at 03:37 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 10-11-2007, 08:18 AM
Anandavinayagam Anandavinayagam is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 131
Anandavinayagam is on a distinguished road
Default Zip code,Proximity SQL Server

The below SP supports and find the list of Zipcode within radius


CREATE PROC GetZipCodesWithinRadius

@ZipCode char(5) ,
@GivenMileRadius int
AS
SET NOCOUNT ON

DECLARE @lat1 float,
@long1 float

SELECT @lat1= latitude,
@long1 = longitude
FROM ZipSource
WHERE zipcode = @ZipCode

SELECT ZipCode ,DistanceInMiles
FROM
(
SELECT ZipCode,3958.75 * ( Atan(Sqrt(1 - power(((Sin(@Lat1/57.2958) * Sin(latitude/57.2958)) +
(Cos(@Lat1/57.2958) * Cos(latitude/57.2958) * Cos((longitude/57.2958) - (@Long1/57.2958)))), 2)) /
((Sin(@Lat1/57.2958) * Sin(latitude/57.2958)) + (Cos(@Lat1/57.2958) * Cos(latitude/57.2958) *
Cos((longitude/57.2958) - (@Long1/57.2958)))))) DistanceInMiles
FROM ZipSource
) a
WHERE a.DistanceInMiles <= @GivenMileRadius
--AND ZipCode <> @ZipCode
ORDER BY DistanceInMiles

GO

EXEC GetFindZipCodesWithinRadius '11566',20
GO


Do u have zip code ?did u purchase the ZipCode DB....
__________________
The MOSS
Master of Solution Service

Last edited by Anandavinayagam : 10-11-2007 at 08:22 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 10-11-2007, 08:23 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Red face Zip code Proximity SQL Server 2005

No....I got from surfing in google as dmp file that is approx 54mb(43,000 records)


forgot the URL..........
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)

Last edited by kingmaker : 10-26-2007 at 03:37 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Register dll or ocx using through code in C# oxygen C# Programming 4 08-06-2008 12:58 AM
I want the explanation for the below example code.. oxygen PHP Programming 1 07-26-2007 03:39 AM
optimizing the code vijayanand PHP Programming 0 07-17-2007 12:25 AM
JAVA code from PHP ramkumaraol PHP Programming 2 07-16-2007 11:54 PM
Perl Code from PHP sivaramakrishnan PHP Programming 1 07-16-2007 11:15 AM


All times are GMT -7. The time now is 06:17 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0