Mobile app version of vmapp.org
Login or Join
Phylliss660

: Recommend a web service that handles location within a specific radius? We have a client that wants a store locator on their website. I've been asked to find a webservice that will allow us

@Phylliss660

Posted in: #WebServices

We have a client that wants a store locator on their website. I've been asked to find a webservice that will allow us to send a zipcode as a request and have it return locations within x radius. We found this, but it's maintained by a single person, and doesn't look like it gets updated or supported very well. We're looking for something commercial, ideally that updates their zipcode database at least once per quarter, and that has a well-documented API with PHP accessibility. I won't say price isn't an object, but right now we just want some ideas, and my google-fu has failed me.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Phylliss660

1 Comments

Sorted by latest first Latest Oldest Best

 

@Reiling115

We wanted a similar service in Australia, but we gave up and rolled our own.

Doing basic geospatial searching is fairly easy. We're fortunate that our national postal service provides a list of every single postcode in the country. Google Maps API was able to return the lat/long of each and every postcode in the country.

From there, against each store we kept its exact lat/long, and then using back-end magic we located every single store within x km radius, and then just plotted those on a Google Map, and populated a store list underneath the map.

You can fetch the lat/long of any address via maps.google.com/maps/geo?q=ADDRESS&output=csv&oe=utf8&sensor=false&gl=AU&key=APIKEY. The only hard bit is working with lat/longs as distance on earth is not constant with lat/longs. For example, 1km in latitude is approx 1/111 and 1km in longitude is approximately 1/71. But as you move north and south, east and west this fraction changes - but it was close enough for our work (Australia is as large as America and we had plots all over the country, so in some parts it was actually wildly inaccurate, but nobody has complained)

If you do decide to roll your own, the people over at Geographic Stack Exchange may be of great assistance. I wish they had existed when we did our own.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme