5 Replies Latest reply on Jul 20, 2017 3:06 PM by user29439

# Creative question: Proximity map based on geocoding

So, I have a need to show a number of contact records who's location is within a certain distance from a venue in our DB (Separate Tables).  I have geocoded Long and Lat data for the contact records, as well as for the venue records. While it would be great to have a map to visually show the number of contacts in a certain radius, I would love to have a generated list of contacts that meet the criteria based on distance.

I have looked at some of the Dunning CF's but haven't found (nor have been able to think it completely through). Any thoughts would be welcome on this project.

Jesse

• ###### 1. Re: Creative question: Proximity map based on geocoding

What I've done in the past is figure out how far the Lat/Long is for the distance and use that distance to draw a box around the point.  Then I do a search for everything within the box.  Within the box and tangent to its sides is a circle that is everything within the distance from the point.  I then evaluate all points within the box for their distance to the center and keep the values that are within the distance desired.  The box works to narrow down the found set to evaluate for how close it is to the center in lieu of calculating the distance to every point in the database.  Once you have the distance in Decimal Degrees, it is easy to do finds within those distances to make the box.

• ###### 3. Re: Creative question: Proximity map based on geocoding

1 of 1 people found this helpful
• ###### 4. Re: Creative question: Proximity map based on geocoding

Now that i am coming back around to this problem (a year later...sheesh), I was wondering why the scripting isn't find records that are clearly close to the searched location. I used a bar in NYC and wanted to find contacts around that bar. I got people in colorado in my found set.

Is there something in the script that i copied over that is not constraining the set to be small enough? or is it the - in the coordinates that are being passed up (my gps pull put them in with the - for longitude)

Thanks!

Jesse

• ###### 5. Re: Creative question: Proximity map based on geocoding

Holy cow. jbante, this is brilliant. I have added this into my solution, tweaked some of the layout components, and now can generate a list of contractors that are in the geographical area (which is really important, as sorting by state can leave out people who can work across state lines), and get some real power behind the solution. BOOM.

Thanks so much!!!!

Jesse