/    Sign up×
Community /Pin to ProfileBookmark

Search within a certain miles radius

Hi.

How can I run a search within a certain miles radius?
What techonolgy should I use?

Thanks!

to post a comment
Full-stack Developer

11 Comments(s)

Copy linkTweet thisAlerts:
@VladdyNov 16.2004 — GPS :rolleyes:
Copy linkTweet thisAlerts:
@NogDogNov 16.2004 — You probably need a database of zipcodes and their latitudes/longitudes, along with some fairly complex math (spherical trigonometry or such).
Copy linkTweet thisAlerts:
@weeeauthorNov 16.2004 — so I know you it is possible but how they got that database?

Is there any place I can download it?

Or maybe you guys got some other ideas how can I do it?
Copy linkTweet thisAlerts:
@NevermoreNov 16.2004 — You need to map the places and give each one a coordinate. Then your program needs to do the following:

1) Take the distance and coordinates as arguments

2) Set the given coordinates as the origin and recalculate all other coordinates based on this. (Simple addition/subtraction) Note that places will now get negative coordinates.

3) Fine the modulus of each place's vector by doing square root(x coord squared + y coord squared). This is the distance between it and the original place.

4) List all palces with modulus < distance.
Copy linkTweet thisAlerts:
@russellNov 16.2004 — 
  • 1. Have a look at [URL=http://www.webdeveloper.com/forum/showthread.php?threadid=38755&highlight=proximity]this thread[/URL]

  • 2. You can download the data free from the .[URL=http://www.census.gov/]Census Bureau[/URL]
  • Copy linkTweet thisAlerts:
    @weeeauthorNov 16.2004 — I couldnt figure out how can I download the data for free?
    Copy linkTweet thisAlerts:
    @weeeauthorNov 18.2004 — I still didn't figure it out...
    Copy linkTweet thisAlerts:
    @russellNov 18.2004 — ftp://ftp2.census.gov/census_2000/datasets/

    Cant remember which file exactly (i'm thinking that it's in the demographic profile directory), and there is some garbage you'll want to clean up, but it's here.
    Copy linkTweet thisAlerts:
    @weeeauthorNov 18.2004 — is how to get the database - isn't it?
    Copy linkTweet thisAlerts:
    @russellNov 18.2004 — Get the data from the Census Bureau's ftp site. I posted a link above. You will probably want to import it into a database. I don't know what database you intend to use, but importing the data will be pretty easy regardless.

    There are many sites that will sell you the data in various formats, but since you can get it for free...
    ×

    Success!

    Help @weee spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...