• Welcome to KonaKart Community Forum. Please login or sign up.
 

How to search products based on relative distance from the customer?

Started by nitros, February 07, 2008, 06:44:24 pm

Previous topic - Next topic

nitros

My need is to find products which has an address (contacts) associated with it.  Any customer who searches for products first provides us with their address and we want to customize Konakart to pull the products within 10 miles from the customer.....

Steps to do that:
1.  All product's address has geocode already mapped using Google Maps API
2. Take the customer's address and get the geocode using Google Maps API.
3. Call Google Maps API for each product to find the distance between two geocodes (customer and product)

The above approach does not look like an optimized solution.  Can anyone suggest a better way of doing it?  BTW we are using Konakart to implement it.

ming

Hi Nitros,

To reduce the number of Google Maps API calls can't you group products in some way by their location - eg: by using their manufacturer's location?

Ming

nitros

Exactly, that is what I initially planned but to keep things simple, I stated that I will search for products.

So the actual implementation, is to first search for manufacturers/retailers within the defined range and then filter their products based on the search term.

I am just looking for various ways of implementation if anybody has done such a thing in Konakart.....

Here is one nice article in Google Maps API blog:

http://code.google.com/support/bin/answer.py?answer=87134&topic=11364&fromblog=true