subscribe

Geo standards on the web

Location-aware web applications are rising, and I'm personally very interested in this space. Besides the obvious cool-factor, I think there are a lot of uses for location-aware information. This post is a short overview of geo-related standards and api's.

The heart of it all lies in 2 numbers, latitude and longitude.

How to get these numbers?

However you publish the GPS coordinates, the information will at one point in time come from a user. However, asking a user to enter these numbers is not the best end-user experience.

Use a map

A very common way is simply ask a user to pinpoint their location on a map. The most common two providers for these are:

Google maps is the most popular (no numbers!), but if you are looking for more flexibility, yahoo maps might be the best choice. Yahoo maps has an Actionscript API which enables you to add a lot of customizations. Justin Everett-Church has some cool examples of what's possible. Yahoo also provides a REST api, allowing you to just fetch the tiles and do all the stitching yourself.

Address to GPS translation.

This is called Geocoding. Yahoo has a very easy to use REST API to do this translation. Google also provides an API, which is also able to spit out kml as well.

Browser plugins!

W3c currently has a draft for a geo location api, which is also part of the HTML5 movement.

The user interface is nice too. You are asked by the site if you are ok with supplying your coordinates, which then get sent back to the client.

The best implementation I've seen from this is the Geode extension. I can highly recommend to install the add-on and give the demo's a shot. This extension will only work if your computer has WiFi. It makes use of Sky Hook, which has mapped locations of wifi routers across the world. It mainly seems to have done the urban areas in north america and europe.

Geode in action

I actually moved a month or two ago from 43.651904 -79.428498 to 43.645466 -79.448729. For the first month our router was still mapped to the old address, but it updated recently to reflect my new address. Creepy, but cool!

Gears also has a javascript API, which might be a bit more common. My personal experience has been that I've only been able to get information to up to 4 decimals, which placed me in a different part of town.

Firefox 3.1 will also come with the api built in HOWEVER, it serves as an empty shell for extension implementors. You'll still need to install an extension to actually provide the coordinates, which could work through WiFi mapping, Cell-tower triangulation (the method the iPhone uses) or manual input. An extension that does this through manual input of an address is 'Geolocation'.

From devices

There are a couple devices on the market that track geo information. I wrote a small overview earlier today, and the most impressive seems to be the Amod AGL3080. Its conceptually very simple and when you plug it into your machine, it will show up as an external harddrive with a CSV.

Next to that more camera-phones appear on the market that have support for embedding GPS information within the EXIF data of JPEG's. Most notably recent blackberries and the iPhone. Its reasonably easy to extract this information if it is available. PHP has an extension to read it out, but you'll need to do some conversion from the stored coordinates, as they are specified as the (now less common) degrees, minutes, seconds format.

Publishing

Clearly the easiest way to publish location information is through maps, but the concept of adding this meta-data to the documents you produce (be that html, api's, rss ..) can be much more interesting. This will allow people to re-use the data and present it somewhere else.

Geo RSS

Adding geo information to RSS is an easy one. RSS and Atom is already very widely used. Originally used for feeding blogposts, it has gotten much wider usage such as aggregating pictures, video, etc.

georss.org has some simple examples on how to do this. Flickr is already pretty big on GEO information, it confuses me why they haven't yet integrated the standard.

HTML meta tags

This will allow you add GPS information to a specific site or page There's two ways to define this:

<meta name="geo.position" content="62.300626;-84.023437" />
<meta name="ICBM" content="62.300626, -84.023437" />

There's no harm in including both. It's not very clear to me which one is used more, but the former seems to have more popularity in recent implementations.

Geo microformat

There is also a microformat spec for geo information. Personally, I'm not a big fan of microformats, but would like to be proven wrong in its usefulness.

Microblogging

A standard way to include GPS information for microblogging (and with microblogging, 99% reads twitter.), using a very easy format. This allows cool applications such as Twittervision and Twinkle. The latter had an interesting review on the ever offensive Something Awful.

KML

KML is also on its way to become a standard for the geo-web. KML covers much complexer drawing and is already supported by a number of apps, most prominently Google Earth and Nasa Worldwind. People who have google earth installed can be directed straight to a location on the map by serving a .kml file.

Conclusion

Well, I think the geo-aware web has a big and bright future. Having appropriate standards in place to consume and publish this information is very important. Even though a minimal amount of users will immediately benefit from for example geo information in your html head section. Allowing other developers or applications to access this information today will help pave the future for a fully geo-enabled web. I say all this realizing this blog does not provide this information, but hey.. nobody is perfect :). I can proudly say however I have some geo-aware applications in the works.

I'm very interested in your ideas of examples of interesting use of GPS information! If I missed an important or relevant API or you have a cool example, make sure to leave a comment.

/me goes off to find a restaurant near me and wonders where my friends would hang out on a cold saturday night in december.

Web mentions

Comments

  • keith

    keith

    you missed a major location-based API: Fire Eagle
  • travis

    travis

    very interesting post... and ive never thought about yahoo maps much... i suppose the de facto map engine has always been google in my mind... but the features you mentioned are very interesting... and could provide for a much better user experience if used properly! thanx for info!
  • Evert

    Evert

    Good one! Thanks!

    I've glimpsed over it before, but I should probably dive a bit deeper into it. It seems pretty interesting.
  • Felix

    Felix

    On apache level there's also mod_geoip, which for instance can map an ip to country. http://www.maxmind.com/app/mod_geoip
  • MichielH

    MichielH

    When talking about geo standards you surely can't leave out the standards specified by the Open Geospatial Consortium. Among these is GML (http://www.opengeospatial.org/standards/gml), which is actually referenced to by GeoRSS and basically defines all geographic primitives in a XML schema. Furthermore, as this post seems to cover more than just standards, there are some other niceties to consider ;-).
    First, for storing geographical data and querying it PostGIS (http://postgis.refractions.net) is the way to go. It is fast, has a lot of features and is under active development. Second, if you want a standardized interface towards your geo data, MapServer (http://mapserver.gis.umn.edu) is easy to setup, easy to use and can act as a Web Map Service, Web Feature Service and/or Web Coverage Service server (all services are OGC standards).For viewing, there are some free (and open) mapping viewers which can interface with WMS, WFS and sometimes WCS. These are OpenLayers (http://openlayers.org) for javascript and FlamingoMC (http://www.flamingo-mc.org) for Flash. Finally there are tons of geo data freely available on the web which you can combine with your own gathered data. OpenStreetMap (http://openstreetmap.org) creates a full database of street data and the United States National Atlas also provides a free wide (albeit a bit outdated) set of databases at http://www-atlas.usgs.gov/maplayers.html. There's really a lot of cool (and very useful) stuff out there, and tons of possibilities for new mapping applications :-).

  • Evert

    Evert

    Those are some great thinkgs to check out MichielH! Definitely going to check all these out. thanks so much