How to make Distance from Zip Code search work?

I'm ready to go live, I have all my data int here and I pre-populated all the location data & am testing final stuff.  I do have latitude/longitude data, all is good.

I can search by city/country but the distance search based on Zip Code isn't working at all, as if it's not being calculated.  I have the Profiles Map module enabled but I'm not sure if I need something else enabled to support the distance searching?  I thought maybe the "Google Search" module but there is no description & the module names are so vague... I don't want to enable something unless it's absolutely necessary, to avoid potential problems.

Quote · 3 Feb 2010

You will need to add zipcode database to your database so the site has something to calculate.  It's not included with Dolphin.  There is an alternative method for zipsearches that doesn't require an sql database: http://www.boonex.com/unity/extensions/entry/ZIP_Codes_Search

Quote · 3 Feb 2010

Well, when I asked about it before, I was told I could choose either the Google maps module (included) and my maps API key OR a zip code database.  It seems that's not the case?  In my old system, I had code that would do distance searching based on latitude/longitude.

Since the zip codes simply cross-reference zip to a lat/long, I'm presuming the lat/long functionality is built into Dolphin.  If so, couldn't it just use the bx_map_profiles table since that contains member ID + lat/long info?  In other words, is there a way to do distance searching, based on that table, without even the need for zip code matching?

I mean, I can dig around for a free zip code database but a lot of these mods are re-packaged content that can be found free elsewhere, I just want to save myself the time of converting the data to match the Dolphin table... it's kind of cumbersome, especially with large 100+MB data sets.

Quote · 3 Feb 2010

Haven't seen anything based on the maps API key, not native anyways.  You likely need to create the code for that yourself unless I'm wrong..anyone else know?

Quote · 3 Feb 2010

When we first purchased our SmartPro Pack license (now Prime), we received a copy of the ZipCode database (It's a SQL import file over 100mb). I recently (weeks ago) requested an update to the database, but have yet to receive a response from Boonex about it.


I know these databases go out of date regularly, and I know that google and some of the other mapping companies have some tricky use clauses for non-public sites, or member-only sites, so I'd really like to get an update myself. I also know that google restricts the number of queries that can be made to their database per API key/per day.

Quote · 3 Feb 2010

I think the best solution is to not depend on a static database.  I'll code this myself.

I think the solution is to use the World Map module included with D7 as a component.  I'm still not 100% certain if people registering or updating their profiles triggers an update to the table that stores their geolocation but, presuming it does work like that dynamically, then a search will go like this:

Match zip to all account IDs that have a zip code defined.  Look up the latitude/longitude of their data in the lat/long table for world maps, call the radius search function built in, then return only the member IDs that are within the radius.

The only time this wouldn't work is for people who didn't enter any location or zip info, or only used the world map module to define their location.  Or, if the world map module doesn't work as dynamically as I'm presuming.  In that case, a zip database will be a good backup but not have to be the primary method, so not being updated often wouldn't be a big deal.  It might also help to have a daily or weekly cron that finds and corrects any malformed location info people have in their profiles and ensure the map data table is regularly up-to-date, using Google Maps API.

Quote · 3 Feb 2010

Did you figure out that code for the Zip Code?

Csampson
Quote · 17 Feb 2010

I've been struggling with the zip radius search also.  If you guys came up with a fix please share it, as I'm sure many of us would appreciate it! :)

Thanks!!

Quote · 23 Jun 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.