×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

retrieve certain range within a specific criteria

retrieve certain range within a specific criteria

retrieve certain range within a specific criteria

(OP)
If I have a database of users with their addresses.  How do I find people within a certain radius of a zip code or city?  Let's say I want to find all people within 15 miles radius of zip code 60659.  Can someone help?  Thanks a bunch

RE: retrieve certain range within a specific criteria

Easy way:  Subscribe to GIS provider.

Hard way:

You need to condense each zip code to a point and get the latitude and longitude for that point.  I would imagine that the US Postal Service uses the Post Office responsible for each zip code for this purpose.

For each address in your database, calculate the difference (in degrees)for latitude and longitude between the point value for that addresses zip code and the "center" of you search.

Convert the degrees to distance.

Apply Pathagorean therom to get radius.

If the radius is less than 15 miles you've got one.

This will get you people that live in a zip code with a center point less than 15 miles from the center point of the target.  Not exactly what you asked for, but reasonably close.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources