views:

807

answers:

2

For an ajax app I'm doing, I was using the google local search api to help enter in address info. For example, if the user needs to fill out employment information, typing in the business name would provide a list of matching businesses, then clicking one would fill out all of the address fields. However, we can't use it because of the restrictions on google's api. We have a closed https app which just makes it out of the question.

Because of the https requirement, we have to use the server as a proxy which means a pretty lenient usage restriction. That makes Bing a good choice. The REST api seems like a great way to go, and it works well enough, but with one problem. The center point location needs to be specified as a latitude and longitude. Users will be supplying the information in a zipcode or city/state format. This clearly means geocoding. What is the best route to take? Is there a good way to get around geocoding that I'm missing? Looking at the Bing APIs, it appears that geocoding is offered as a SOAP web service that costs money. If I'm doing that should I just use google maps for geocoding - there's an enterprise version of maps with https? Any other suggestions?

I am using Java on the server and obviously javascript on the front end. It's a javascript heavy app, so a javascript solution would be welcome as well.

+1  A: 

So if I'm reading your question right, you need a way to go from zip code/city/state to longitude and latitude?

If that's the case, there are a number of free and paid databases out there that have this information. The free ones are generally not 100% up to date, but the paid ones are pretty reasonably priced and would include periodic updates with the latest and greatest data.

Eric Petroelje
so you're suggesting I do the geocoding on the server because it's limited enough?
Russell Leggett
@Russell - A couple ways you could do it. You could do the geocoding on your server with a database (as I suggested in my answer) or you could create a service on your server that you call via HTTPS which would then call out to Bing/Google via plain old HTTP. This would keep the pages as HTTPS, but just use normal HTTP under the hood - if that's acceptable from a security perspective on your end anyways.
Eric Petroelje
That is actually how we interface with Bing now, but it doesn't do geocoding. We could do the geocoding with google, but it has request limits that our server would surpass.
Russell Leggett
+1  A: 

Yahoo has geocoding with rate limit of 5000 per day on a REST service.

http://developer.yahoo.com/maps/rest/V1/geocode.html

Have you looked into Yahoo! Maps with YQL?

Nosredna