Have you ever just wanted to point your app at a service and get immediate gratification for the location of a string of text? How about for an entire website? The good news is there is more than one way to get there.

Let’s take a look at a couple of ways to accomplish this goal.

Read Write Where?

Geodict is an open source project that allows you to extract locations from text using a database of just around 2 million locations. In fact, you can apply this to RWH with the following results below for the RWW “about” page.

There is a bit of repetition but the effect should be clear if the text isn’t a reference to inhabitants. Sorry Richard… New Zealand just didn’t make it past the filtering. 😉

Barring the concerns about exacting clarity (which you could easily extend with your own regex), the benefit here is that you get a local database copy to work with on your own terms. If you don’t want to rely on the third party API services that are out there today in the cloud that might be appealing. Or, perhaps you want to create your own API for the cloud.

The Youngest One In cURL

Another way to approach this goal is by using Yahoo! Placemaker. If you have an appid already you can simply open a terminal and use curl to try this example for my hometown of Beaufort, NC.

The output you’ll get back should be similar to the gist below.

If we take the centroid values for Lat and Lon these can be pasted into Google Maps to verify how accurate this was visually.

What are you using to get location information from text input today? Let us know in the comments below!