GeoNames web services

I always forget about the GeoNames web services. They’re awesome, a set of very simple REST like services for geodata. They also distribute a database. I don’t really understand the business, but they’ve been around some six years and seem to do their thing right. I used them for my WikiHere hack a few years ago and am about to use their elevation service for another quick hack.

They publish things right. Data is available in XML or JSON or JSONP formats and they set the CORS header so you can do cross-site javascript with no drama. I was originally going to use Google’s elevation service but they have no cross-site solution, not to mention my use would be unlicensed. So screw em.

Geonames asks for you to register and pass a user name on requests, they have a credit limit on requests. It’s 30,000 credits / day for free, most requests are a single credit, goes from 0.1 to 4 credits / request.

Their primary value add seems to be a broad database of place names, postal codes, etc. International. I don’t know how it compares to competing offerings or indeed if there even are any competitors. They also have time zones, wikipedia, some OSM data searches, etc. I’m using the elevation service, they have three to choose from: GTOPO30, SRTM3, and Aster. Too bad there’s no NED 1/9 for the US, but that’s a lot of data.

$ curl -D - 'http://api.geonames.org/astergdemJSON?lat=37.7383&lng=-122.4531&username=nelson'

HTTP/1.1 200 OK
Date: Tue, 24 Jul 2012 22:37:18 GMT
Server: Apache/2.2.17 (Linux/SUSE)
Cache-Control: no-cache
Access-Control-Allow-Origin: *
Transfer-Encoding: chunked
Content-Type: application/json;charset=UTF-8

{"astergdem":257,"lng":-122.4531,"lat":37.7383}

It’s a shame they refuse to allow caching.