How can I use Google's Geocoding to normalize addresses without violating the terms of service? - geocoding

I'm working on a API that will accept addresses in searches. We would like to use Google's geocoding service to normalize the addresses before submitting the search criteria to our search engine.
This caught my attention:
http://code.google.com/apis/maps/documentation/geocoding/index.html#Limits
"Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions."
Does this mean we can't use the Geocoding service for this purpose? Having used libraries that access Google's geocoding service before, I know it's technically possible to do this but it sounds like a violation of the terms of service.
Are there other options for what we're trying to do?
Edit:
It turns out our company does have a license with Google to use the addresses that come back, and they will eventually be displayed on a Google Map to the end user, satisfying the terms of our agreement.

Short answer: You can't. The terms of service seem pretty clear-cut that geocoding using their API is not in line with their terms, unless you display them on a Google Map.
If you need this for other purposes, you should consider licensing a Geocoding library and dataset(s) for your regions of interest. There are quite a few companies which sell these for commercial purposes.

Update on this really old post:
#Cerin pointed out something important on this answer.
USPS Web Tools API are only free if you're using them to ship
via USPS
So be legal.
You are correct: you can't use the Google Geocoder for address cleaning.
You can use this wrapper to access USPS's Web Tools.
Another inexpensive solution is Semaphore, but you'll have to write your own wrapper class to call the DLLs.

The USPS has a free service to validate addresses. It's in a fairly easy-to-use API that you can curl information to and receive a valid response back. The only rub is that they're a little slow when it comes to registering, and they require you to run several tests before they'll open it up. Regardless, once you've jumped through the hoops, it does a great job. It's been keeping addresses in my app clean for quite a while now without any hiccups.

Related

Naming a SOAP web service endpoint address

I am developing a SOAP interface and am having trouble deciding what to name the endpoint address.
Options:
- {soap,api,service,???}.foo.com.au
- www.foo.com.au/{soap,api,service,???}
What are the typical names that a SOAP service gets?
I would use www.foo.com.au/soap, mostly because it's an easy way to tell people that it's a SOAP service, and if you want to add a REST service later, you can use www.foo.com.au/rest
Keep in mind, in practice, all solutions are technically equivalent. The benefits of one naming system over another are only at the ease or understanding what the URLs are about (for humans), or maintainability, really. So, if you are searching for a standard we can tell, at best:
If you have a big company with lots of applications, go for the http://api.company.com/application/rest and/or http://api.company.com/application/soap approach
Reason: you can separate, right from the start (networkwise) the web service servers (http://api.srv.com/app) from the human web browsing servers (http://www.srv.com/app).
All applications have one big root "meeting" point (the root URL api.company.com), so if anyone wonders what is company-wide available, just check http://api.company.com and it can list all services available.
If your setup is not that big, it is probably not worth the trouble, so don't fear using the www.. But keep in mind it's best to use at least a different context, such as api/, so that anyone knows right off the bat a service URL is about a web service(!): http://www.company.com/application/api/rest / http://www.company.com/application/api/soap
Note: It's also common to use service, although api seems to be somewhat better descriptive (api.something.com leaves no doubt about what that page is about).
Some examples (as you can see, there is really no global standard):
Google's search API: http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=test
Twitter's search API: http://search.twitter.com/search.json?q=w00t
Facebook' Graph API: http://graph.facebook.com
Facebook' Dialog API: http://www.facebook.com/dialog (see, no standard even within facebook!)
Weather Gov SOAP forecast: http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl
Buy many seem to keep the good ol' company-wide APIs "meeting points":
http://developers.google.com
http://developers.facebook.com
http://dev.twitter.com

get info from london2012 like do google

I'm trying develop some app related to the Olympic Games.
Does anybody know how get info from the page www.london2012.com, like google does in results?
Does an API exist? Where can I find an API?
I'd suppose, maybe it could be done with a url like:
www.london2012.com?country=12
(This isn't real, just what I suppose an API might look like)
When I search "london olympics" for example, I see a "gadget" which shows some results, and I believe that these come from www.london2012.com. Does anyone know if that's true?
I'm not sure which programming language you are using, making it hard to provide an appropriate answer. I doubt www.london2012.com has produced an API just for access, so you will need to make queries (like you said in your post). For example, if you are using Python, you can use the urllib module to write your requests.
However, be warned. I just read over the www.london2012.com Terms of Service (http://www.london2012.com/terms-of-use/) , and you may not use this information for non-personal use.
It is possible though probably not allowed (see terms of service of the website).
You need your app to make a HTTP call to the page URL and parse the HTML response. Obviously the way to do it depends heavily on the language/technology you use, which you did not indicate in your question.
The Olympics use a system called ODF - Olympic Data Feed to distribute real time statistics from games to authorized parties, usually in XML format. These authorized parties consist of accredited world news organizations (so, yeah, google counts), Rights holding broadcasters (broadcasters that pay to have the rights to distrute Olympics content - NBC in US, BBC in UK, etc, etc) and international sports federations. They have dictionaries listed here - but you can't access it unless you are one of the authorized parties above. So perhaps going the python or some other web scraping route is best.

Looking for United States Address Validation Web Service

I'm looking for a United States Address Validation web service, as the title says. Also:
I don't need maps
I don't need Geo coding
I do need:
Validation that an address is real
Address parsing
Google's Maps / Bing Maps seemed good, but won't work for me because of these:
Prohibits use if not plotting points on a map image
Low request limits (100,000 / day) for premium account. I need more like 1,000,000 / day
Does Geocoding, which I don't need, which is resource intensive, which means it's slow
Any suggestions?
Maybe USPS?
https://www.usps.com/business/address-management-products.htm
use FedEx's API. They have an API to validate addresses.
Also:
https://webgis.usc.edu/Services/AddressValidation/Default.aspx
You can try Pitney Bowes “IdentifyAddress” Api available at - https://identify.pitneybowes.com/
The service analyses and compares the input addresses against the known address databases around the world to output a standardized detail. It corrects addresses, adds missing postal information and formats it using the format preferred by the applicable postal authority. I also uses additional address databases so it can provide enhanced detail, including address quality, type of address, transliteration (such as from Chinese Kanji to Latin characters) and whether an address is validated to the premise/house number, street, or city level of reference information.
You will find a lot of samples and sdk available on the site and i found it extremely easy to integrate.
You could, in theory, run desktop software and plug into any kind of API it provides, but then you become responsible for things like uptime, data updates, and associated overhead. You may also run into issues with the software threading model--is it multi-threaded or single-threaded software? You don't want to find that out in production.
There are a handful of web services out there that can verify US-based addresses, including the USPS official web service. The USPS one is very limited in the fields that it returns. For example, if you're looking for the "delivery point" which is used to make a full barcode, the USPS API doesn't return that information. I believe the USPS web service also limits the number of queries that you can perform, although I don't remember the exact limit.
A few things that you'll want to look for in a web service include the price (obviously) as well as geo-distribution of their servers. If a company has all of their servers in one location and that data center goes offline (which can and does happen), you're left out in the cold. If they have multiple physical locations, it can help to prevent unnecessary outages. Also, you'll want to make sure that the service call returns all necessary fields as per your requirements--like delivery point code, barcode, and DPV code (which tells you how deliverable an address is).
Lastly, you'll want to determine how you feel about interacting with the company. When you call them on the phone, are they responsive and concerned about your needs? Or are you talking to some front-line person that can't answer questions and is only able to gather information about your company size and revenue so they can evaluate how big of a fish you are and determine which salesman gets to call you back. Can you talk to the engineers that wrote the web service on the phone or via email?
There are a few choices out there and you'll have to choose the one that best fits your requirements and unique situation. Do a Google search to find a list of companies. In the interest of full disclosure, I'm the co-founder of SmartyStreets. We have an address verification web service API called LiveAddress. You're more than welcome to contact me directly with questions on my personal Twitter account or the company Twitter account.

Little known or useful Web Services we all should know about

Web services and web APIs have managed to increase the accessibility of the information stored and catalogued on the internet. They have also opened up a vast array of enterprise power functionality for smaller thin client applications.
By taping into these services developers can provide functionality that would have taken them months perhaps years to set up. They can combine them into single applications that make life generally easier for its users.
Whether displaying information about the music being played, finding items of interest in the locale of the user or just simply tweeting and blogging from the same application - the possibilities are growing everyday.
I want to know about the most interesting or useful services that are out there, especially ones that most of us may not have heard about yet. Do you maintain an API or service? or do you have a clever mash up that provides even more benefits than the originals?
YQL - Yahoo provide a tool that lets you query many different API's across the web, even for sites that don't provide an API as such.
From the site:
The Yahoo! Query Language is an
expressive SQL-like language that lets
you query, filter, and join data
across Web services.
...
With YQL, developers can access and
shape data across the Internet through
one simple language, eliminating the
need to learn how to call different
APIs.
The World Bank API is pretty cool. Google uses it in search results. My favourite implementations are the cartograms at worldmapper.
(source: worldmapper.org)
It's very niche, but I happen to think the OpenCongress API is amazing.
Less niche: Google Translate has an API which will guess the language of something. You'd be AMAZED how frequently this comes in handy (even though it's not as tweakable as you'd like and is not trained on small samples).
I was just about to have a stab at using the SoundCloud API
I know many people who already use for sharing their musical masterpieces and its a pretty good site. Hopefully the api will be as well!
I like the RESTful API for weather.com. It's free and very useful for the new age of location-aware apps: https://registration.weather.com/ursa/xmloap/step1
It does require registration, but they don't spam you or anything - it's just to provide you a key to use the API.
Ah yes - here's another one I've been meaning to check out but haven't tried yet
The BBC offer a bunch of apis/feeds that look very promising
http://ideas.welcomebackstage.com/data
They include apis for accessing schedule data for both TV and Radio listings along with all kinds of news searches. It even looks like they'll be offering some sort of geo-location service soon so it will be interesting to see what that has to offer
Another interesting one for liberal brits! ;)
The Guardian news paper have their own api
http://www.guardian.co.uk/open-platform
MuiscBrainz
Excellent service for music mashups.
Not so many knows that Last.FM initial database was scraped from this service.
The United States Postal Service offers a web service that does address standardization. Quite useful in reducing clutter and cleaning data before it gets put into your database.

How to convert an address to a latitude/longitude?

How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can "rent" this service from? This would be used in a commercial desktop application on a Windows PC with fulltime internet access.
Google has a geocoding API which seems to work pretty well for most of the locations that they have Google Maps data for.
http://googlemapsapi.blogspot.com/2006/06/geocoding-at-last.html
They provide online geocoding (via JavaScript):
http://code.google.com/apis/maps/documentation/services.html#Geocoding
Or backend geocoding (via an HTTP request):
http://code.google.com/apis/maps/documentation/services.html#Geocoding_Direct
The data is usually the same used by Google Maps itself. (note that there are some exceptions to this, such as the UK or Israel, where the data is from a different source and of slightly reduced quality)
Nothing much new to add, but I have had a lot of real-world experience in GIS and geocoding from a previous job. Here is what I remember:
If it is a "every once in a while" need in your application, I would definitely recommend the Google or Yahoo Geocoding APIs, but be careful to read their licensing terms.
I know that the Google Maps API in general is easy to license for even commercial web pages, but can't be used in a pay-to-access situation. In other words you can use it to advertise or provide a service that drives ad revenue, but you can't charge people to acess your site or even put it behind a password system.
Despite these restrictions, they are both excellent choices because they frequently update their street databases. Most of the free backend tools and libraries use Census and TIGER road data that is updated infrequently, so you are less likely to successfully geocode addresses in rapidly growing areas or new subdivisions.
Most of the services also restrict the number of geocoding queries you can make per day, so it's OK to look up addresses of, say, new customers who get added to your database, but if you run a batch job that feeds thousands of addresses from your database into the geocoder, you're going to get shutoff.
I don't think this one has been mentioned yet, but ESRI has ArcWeb web services that include geocoding, although they aren't very cheap. Last time I used them it cost around 1.5cents per lookup, but you had to prepay a certain amount to get started. Again the major advantage is that the road data they use is kept up to date in a timely manner and you can use the data in commercial situations that Google doesn't allow. The ArcWeb service will also serve up high-resolution satellite and aerial photos a la Google Maps, again priced per request.
If you want to roll your own or have access to much more accurate data, you can purchase subscriptions to GIS data from companies like TeleAtlas, but that ain't cheap. You can buy only a state or county worth of data if your needs are extremely local. There are several tiers of data - GIS features only, GIS plus detailed streets, all that plus geocode data, all of that plus traffic flow/direction/speed limits for routing. Of course, the price goes up as you go up the tiers.
Finally, the Wikipedia article on Geocoding has some good information on the algorithms and techniques. Even if you aren't doing it in your own code, it's useful to know what kind of errors and accuracy you can expect from various kinds of data sources.
Yahoo! Maps Web Services - Geocoding API accurately geocodes UK postcodes, unlike Google's API.
Unfortunately yahoo has deprecated this service, you could visit http://developer.yahoo.com/geo/placefinder/ for yahoo's service
Try this: http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false
more info here: http://code.google.com/apis/maps/documentation/geocoding/
When you convert an address or object to a lat/long it is called Geocoding.
There are a lot geocoding solutions around. The solution right for your project will depend on the acceptability of the licensing terms of each geocoding solution. Both Microsoft Virtual Earth and Google Maps offer solutions which are free to use under a very restrictive licenses...
https://developers.google.com/maps/documentation/javascript/tutorial
Having rolled my own solution for this before, I can whole heartedly recommend the Geo::Coder::US Perl module for this. Just download all the census data and use the included importer to create the Berkeley DB for your country and point the Perl script at it. Use the module's built in address parsing, and there you have it: An offline geocoding system!
Try with this code, i work like this with addresses:
It is link in which with GET method you will send request and get lat and lng. http://maps.google.com/maps/api/geocode/json?address=YOUR ADDRES&sensor=false
For exemple: http://maps.google.com/maps/api/geocode/json?address=W Main St, Bergenfield, NJ 07621&sensor=false
1. Create your GET method.
public static String GET(String url) throws Exception {//GET Method
String result = null;
InputStream inputStream = null;
try {
HttpClient httpclient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(url);
Log.v("ExecuteGET: ", httpGet.getRequestLine().toString());
HttpResponse httpResponse = httpclient.execute(httpGet);
inputStream = httpResponse.getEntity().getContent();
if (inputStream != null) {
result = convertInputStreamToString(inputStream);
Log.v("Result: ", "result\n" + result);
}
} catch (Exception e) {
e.printStackTrace();
}
return result;
}
2. Create method for send request
#SuppressWarnings("deprecation")
public static String getLatLng(String accessToken) throws Exception{
String query=StaticString.gLobalGoogleUrl+"json?address="+URLEncoder.encode(accessToken)+"&sensor=false";
Log.v("GETGoogleGeocoder", query+"");
return GET(query);
}
gLobalGoogleUrl="http://maps.google.com/maps/api/geocode/"
3. Call method getLatLng
String result=getLatLng("W Main St, Bergenfield, NJ 07621");
4. Parse JSONObject
Now result is JSONObject with information about address and lan,lng.
Parse JSONObject (result) with gson().
After that use lat,lng.
If you have question about code , ask.
You want a geocoding application. These are available either online or as an application backend.
Online applications:
Google has a geocoding API
Backend applications:
GeoStan
Maptsraction (http://www.mapstraction.com) lets you choose between any number of geocoding services. This could be helpful if you need to do large quantities, as I know Google has a limit to how many you can do a day.
Virtual Earth does it. There is also a web service at geocoder.us
You could also try the OpenStreetMap NameFinder (or the current Nominatim), which contains open source, wiki-like street data for (potentially) the entire world.
you can use bing maps soap services, where you can reference reverse geocode service to find lat/long from address
here is the link
http://msdn.microsoft.com/en-us/library/cc980922.aspx
Yahoo! Maps Web Services - Geocoding API
You can use Microsoft's MapPoint Web Services.
I created a blog entry on how to convert an address to a GeoCode (lat/long).
Thought I would add one more to the list. Texas A&M has a pretty decently priced service here: http://geoservices.tamu.edu/Services/Geocode/
A good option if you have a pretty large set of addresses to geocode and don't want to pat 10k to Google or Microsoft. We still ended up using the returned data in a Google Map.
you are asking about Geocoder.
Google provide an API for this.
so does another provider for this.
you can see the demo of implementation in My Current Location .net
The USC WebGIS Geocoder is free and offers several API's, or you can upload a database for online batch processing.
If you need a one off solution, you can try: https://addresstolatlong.com/
I've used it for a long time and it has worked pretty well for me.