Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
How can I determine whether an address belongs to a certain area?
I have a small shop and we deliver to a couple cities around our location. I'd like to build an online tool that can take an address as input and determine whether or not it falls within our delivery boundaries. My boundaries are made up of streets. Is there some kind of way to use a map solution like Yahoo! maps, google maps, mapquest, etc. to mark my boundaries and determine if an address falls within it?
By the way, I won't always have access to postal codes.
I've got a web server running php and mysql if that helps.
2 Answers
- RatchetrLv 78 years agoFavorite Answer
Google has some API's that might help here. You can access these by building a URL, posting it and processing the response (Which will be either JSON or XML). That should be doable in PHP.
The Geocoding API lets you pass in an address and returns detailed information about that address.
See first link for the types of results you get back.
See second link for details about this API.
One thing this call will return is the Latitude and Longitude of the address. If you know the lat/lon of your business, you can at least calculate crow flies distance between you and your customer.
But it sounds like crow flies distance isn't enough for you. If you can break your delivery area into a small set of polygons, you could write some code to determine if the lat/lon is inside one of your polygons. There is some Trig involved in doing this, so if math isn't a strong point, this might get rather involved.
Another API is the Google Directions API. This gives you driving directions in JSON or XML format, given a starting and ending address. The starting address would be your business address. The ending address would be the customers. See third link for example output (driving directions from the White House to the Pentagon). See last link for details about the API.
The driving directions solution might work for you? From the returned data, you can compute the total driving time (with just simple addition, no Trig required). I assume that is what you are really trying to control here? You aren't willing to drive any more than X minutes for a delivery? As a side effect, you would also actually get driving directions, that might be useful to you or your driver.
Both of these APIs are very good at handling fuzzy input. So if you don't have a postal code, that's fine.
Be sure to read the Limits and Terms of Use if you do decide to use these APIs. Most small businesses would have no problem using them for free. WalMart wouldn't get away with it.
Source(s): http://maps.googleapis.com/maps/api/geocode/xml?ad... https://developers.google.com/maps/documentation/g... http://maps.googleapis.com/maps/api/directions/xml... https://developers.google.com/maps/documentation/d... - ErikaLv 44 years ago
do a sprint prognosis or touch a realtor. Is the proper thank you to do it, while you're heavily questioning approximately identifying to purchase a house having a actual factors agent is a might desire to. yet another source is likewise asking human beings has lived in the State/area for relatively a mutually as. they in lots of situations comprehend good and undesirable neighborhoods.