Difference between revisions of "geo"

From Microformats Wiki
Jump to navigation Jump to search
(→‎Implementations: GPX: Thank you; adjust wording. Will test shortly)
(→‎Examples in the wild: sub-dividing page)
Line 122: Line 122:
== Examples in the wild ==
== Examples in the wild ==
This section is '''informative'''.
The following sites have published geos, outside their normal context of hCards, and thus are a great place to start for anyone looking for examples "in the wild" to try parsing, indexing, organizing etc., in addition to those in many [[hcard-examples-in-wild|hCard examples in the wild]]. If you find geos outside of hCards anywhere else, feel free to add them to the '''top''' of this list. Once the list grows too big, we'll make a separate wiki page.
This section is '''informative'''. The number of geo examples in the wild has expanded far beyond the capacity of being kept inline in this specification. They have been moved to a [[geo-examples-in-wild|separate page]].
Pages with live Geo can use this button (see [[buttons#Geo]] for any recent additions): http://rbach.priv.at/2006/buttons/geo.png
    Please add new items to the TOP of this list
* Christian Hess uses Geo to indicate where pictures in his photo gallery where taken, such as [http://www.hess-cr.com/secciones/galeria/playahermosa.shtml here] and [http://www.hess-cr.com/secciones/galeria/playascr.shtml here].
* [http://www.txioka.net/ekitaldiak.php Txioka] has support for geo and hcalendar microformats, parses twitter messages with [[twitternanoformats]] and converts to geo and hcalendar.
* [http://www.navitraveler.com/places/629/ NaviTraveler], e. g. [http://www.navitraveler.com/places/629/Lincoln_Memorial.html Lincoln Memorial].
** Response in under 12 hours, to advocacy request - [[User:AndyMabbett|Andy Mabbett]]
*[http://caving.atspace.com/ Caving in the Settle Area] uses Geo to mark up the U.K. NGR for cave locations.
*[http://gc.kls2.com/ Great Circle Mapper] ("GCM"; e.g. [http://tinyurl.com/yugscj sample GCM trip], [http://gc.kls2.com/airport/BHX BHX on GCM])
* [http://www.creation.uk.com Creation design & marketing] has Geo microformat on the [http://www.creation.uk.com/contact/ contact information].
* Wikipedia now has a template, [http://en.wikipedia.org/wiki/Template:Hcard-geo hcard-geo], for in-line hCards with coordinates, using Geo, such as that on [http://en.wikipedia.org/wiki/Engine_Arm Engine Arm]
*[http://www.logon.ie/contact-us/ LogOn.ie] have added geotags (and hcard) to their contact page.
*[http://www.davidosbornephotography.co.uk/gallery2/main.php www.davidosbornephotography.co.uk] has implemented Geo on all location photography pages; eg. [http://www.davidosbornephotography.co.uk/gallery2/main.php?g2_itemId=1747 Callanish Stones]
*[http://en.wikipedia.org/wiki/Category:Templates_generating_Geo Wikipedia-EN templates_generating_Geo]
*Wikipedia-IT now has Geo on all  [http://it.wikipedia.org/wiki/Speciale:PuntanoQui/Template:Coord pages using the ''coord'' template], e.g. [http://it.wikipedia.org/wiki/Messina Messina]. [[User:AndyMabbett|Andy Mabbett]] 07:05, 26 May 2007 (PDT)
*'Area' pages on Wholemap, summarizing the photos, videos, etc... for a specific area, now have Geo codes - [http://wholemap.com/map/area.php?area=NiagaraFalls Niagara Falls, for example] May 10, 2007
*The Italian Wikipedia, for example [http://it.wikipedia.org/wiki/Genova Genova (Genoa)]
*I've just added geo support to all of [http://socialight.com Socialight]'s Sticky Notes - here's an example - http://socialight.com/note/2007/4/14/11Aqk_a-great-way-to-spend-a-few-hours
*The [http://www.bayofislands.net/ Bay of Islands] site has geo on its main page, and all photo pages. Example: [http://www.bayofislands.net/photos/8/ photo of Edgewater Apartments]
*I've added geo to [http://commons.wikimedia.org/wiki/Special:Whatlinkshere/Template:Location_dec_US all images tagged in Wikimedia Commons] using decimal values. Example: [http://commons.wikimedia.org/wiki/Image:Montreal_City_Hall_Jan_2006.jpg Montreal City Hall, Jan 2006]  [[User:AndyMabbett|Andy Mabbett]] 08:54, 12 Apr 2007 (PDT)
**Now on pages tagged in D-M-S also.
*Spotstor.com - e.g. [http://spotstor.com] uses Geo for all coordinates displayed on the site.
*Panoramio - e.g. [http://www.panoramio.com/photo/564690]
* Wikipedia-NL now has Geo on all its map-links pages, e.g. [http://www.nsesoftware.nl/wiki/maps.asp?params=52_28_47_N_1_53_51_W_type:city_region:GB&src=Birmingham_%28Engeland%29 maps for Wikipedia-NL article on Birmingham]
**Called from '''87,724''' article pages as of 2006-04-09; reportedly the sixth most popular website in the Netherlands [http://www.multiscope.nl/organisatie/nieuws/sberichten/nederlandse-wikipedia-groeit-als-kool.html].
* I recently added Geo to Wikipedia-DE's map link pages  e.g. [http://tools.wikimedia.de/~magnus/geo/geohack.php?language=de&params=52_28_47_N_1_53_51_W_type:city_region:GB maps for Wikipedia-DE article on Birmingham]. [[User:AndyMabbett|Andy Mabbett]] 14:27, 9 Apr 2007 (PDT)
* I've just added "geo" to OpenStreetMap documentation pages - see [http://wiki.openstreetmap.org/index.php/Birmingham Birmingham page on OpenStreetMap] for example. [[User:AndyMabbett|Andy Mabbett]] 02:39, 6 Apr 2007 (PDT)
* I've [http://en.wikipedia.org/w/index.php?title=Template%3AGeoTemplate&diff=119003866&oldid=118216477 just added] Geo to Wikipedia's [http://en.wikipedia.org/wiki/Template:GeoTemplate GeoTemplate] which is called by '''many thousands''' of other Wikipedia pages. Example: the coordinates (top right) in [http://en.wikipedia.org/wiki/Great_Barr] link to [http://tools.wikimedia.de/~magnus/geo/geohack.php?params=52.54833_N_1.93212_W_region:GB_source:enwiki-osgb36(SP047945)]; the latter now has a Geo microformat. [[User:AndyMabbett|Andy Mabbett]] 03:38, 30 Mar 2007 (PDT)
** [http://tools.wikimedia.de/~kolossos/wp-world/imageworld-art.php Map showing global distribution of geo-tagged Wikipedia articles].
* [http://www.jillesvangurp.com/places jillesvangurp.com] provides an xsl stylesheet to transform Google Earth place-marks (kmz files) into html with nested lists of geo formatted places. Several examples are provided.
*[http://www.geograph.org.uk Geograph British Isles] has experimental support for geos on '''350,000+''' photo pages, for example http://www.geograph.org.uk/photo/1234
*[http://www.poi66.com/ POI66] has '''over 58,500''' waypoints geo-formatted, many describing [[geo-waypoint-examples|trails]] e.g [http://www.poi66.com/maps/show_album.php?album=santiago Mijn pelgrimstocht naar Santiago]
* [http://3amproductions.net 3AM Productions] has published coordinates of cities both in and outside the context of hCards under [http://3amproductions.net/jason.php Jason's] and [http://3amproductions.net/gilbert.php Gil's] pages.
* [http://www.w3.org/People/Connolly/events/ Dan Connoly's Index of Events] has a few geos
** Notes that two of the geos are considered invalid because they use commas instead of semicolons
*Wikitravel now has the facility to add co-ordinates for the subject of the article, and publishes them as a 'geo' microformat - e.g. [http://wikitravel.org/en/Birmingham_%28England%29 Wikitravel - Birmingham]; see [http://wikitravel.org/shared/Tech:Add_SpecialMap_using_Mapstraction_link_for_geo-tagged_pages_and_for_single_listings The announcement].
* [http://flickr.com/ Flickr] now [http://blog.flickr.com/flickrblog/2006/08/great_shot_wher.html supports the geo microformat] on all [http://flickr.com/map/ geotagged photos].  Within 11 days of launch there are now over '''3,000,000+''' photos (as of 2006-09-07) marked up with the "geo" microformat.
* [http://ocono.com/ ocono.com] has marked each of it's "Upcoming Events" items with lat/long values.
* [http://harry.hchen1.com/mylife.htm Harry Chen has marked up his geo location]
* [http://www.multimap.com Multimap.com] uses the geo microformat to mark up latitude and longitude values on map pages.
* [http://rasterweb.net/raster/ Pete Prodoehl] geotags posts on his blog.
* [http://07.pagesd.info/ 07.pagesd.info] uses the geo microformat to mark up latitude and longitude values for each commune of the Ardèche département in France.
* [http://www.openguides.org/ OpenGuides] has support for the geo microformat in svn, and for now you can see it in action on the [http://cotswolds.openguides.org/ Cotswolds OpenGuide]
    Please add new items to the TOP of this list
===Examples with some problems===
Entries may be moved here if there's a problem with the way Geo is used on the page concerned. If the page is yours, and you want to improve it, see the [[hcard-faq|hCard & Geo FAQ]], or raise any queries on [[hcard-issues|hCard & Geo Issues]] or [[mailing-lists#microformats-discuss|the mailing list]], where people will be happy to help you.
== Implementations ==
== Implementations ==

Revision as of 14:09, 20 August 2007


  • geo.png

geo (pronounced "gee-oh") is a simple format for marking up WGS84 geographic coordinates (latitude; longitude), suitable for embedding in (X)HTML, Atom, RSS, and arbitrary XML. geo is a 1:1 representation of the "geo" property in the vCard standard (RFC2426) in XHTML, one of several open microformat standards.

Draft Specification

Tantek Çelik (Technorati, Inc.)


Per the public domain release on my user page, this specification is released into the public domain.

Public Domain Contribution Requirement. Since the author(s) released this work into the public domain, in order to maintain this work's public domain status, all contributors to this page agree to release their contributions to this page to the public domain as well. Contributors may indicate their agreement by adding the public domain release template to their user page per the Voluntary Public Domain Declarations instructions. Unreleased contributions may be reverted/removed.


This specification is subject to a royalty free patent policy, e.g. per the W3C Patent Policy, and IETF RFC3667 & RFC3668.

Inspiration and Acknowledgments

Thanks to everyone who participated in the Geo Microformat BOF at O'Reilly's Where 2.0 conference, and in particular to Nat Torkington and Vee McMillen of O'Reilly for arranging and hosting the BOF. Thanks to Chris Hibbbert for providing the real world geo-caching example.

Introduction and Background

The vCard standard (RFC2426), has been broadly and interoperably implemented (e.g. Apple's Address Book application). The hCard microformat has similarly received significant adoption, from numerous sites publishing the format, to hCard to vCard proxies, to clientside javascript parsers.

At the Where 2.0 conference in June 2005, there was widespread recognition that the community needed a way to simply and easily publish visible, extractable, geographic location information on the Web, given how often bloggers, and numerous other sites publish such information. The geo microformat BOF discussed this very topic, and concluded with a consensus decision to just try using geo from vCard/hCard.

This specification introduces the geo microformat, which is a 1:1 representation of the aforementioned geo property from the vCard standard, by simply reusing the geo property and sub-properties as-is from the hCard microformat.

Publishers can both embed geo addresses directly in their web pages and feeds, as well as markup existing latitude/longitude coordinates in the context of the rest of the information in their web pages and feeds.

If the publisher knows and is publishing the name of the location in addition to its geo lat/long, then the publisher MUST use hCard instead of just geo to publish the name and geo lat/long of the location.

If the publisher knows and is publishing the address of the location, OR if the address of the location was what was actually entered by a human, and the publisher simply turned that into lat/long using some sort of a service, then the publisher SHOULD use adr to publish the actual human entered address information since that communicates far more semantic information than a simple geo lat/long coordinate.

Semantic XHTML Design Principles

Note: the Semantic XHTML Design Principles were written primarily within the context of developing hCard and hCalendar, thus it may be easier to understand these principles in the context of the hCard design methodology (i.e. read that first). Tantek

XHTML is built on XML, and thus XHTML based formats can be used not only for convenient display presentation, but also for general purpose data exchange. In many ways, XHTML based formats exemplify the best of both HTML and XML worlds. However, when building XHTML based formats, it helps to have a guiding set of principles.

  1. Reuse the schema (names, objects, properties, values, types, hierarchies, constraints) as much as possible from pre-existing, established, well-supported standards by reference. Avoid restating constraints expressed in the source standard. Informative mentions are ok.
    1. For types with multiple components, use nested elements with class names equivalent to the names of the components.
    2. Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
  2. Use the most accurately precise semantic XHTML building block for each object etc.
  3. Otherwise use a generic structural element (e.g. <span> or <div>), or the appropriate contextual element (e.g. an <li> inside a <ul> or <ol>).
  4. Use class names based on names from the original schema, unless the semantic XHTML building block precisely represents that part of the original schema. If names in the source schema are case-insensitive, then use an all lowercase equivalent. Components names implicit in prose (rather than explicit in the defined schema) should also use lowercase equivalents for ease of use. Spaces in component names become dash '-' characters.
  5. Finally, if the format of the data according to the original schema is too long and/or not human-friendly, use <abbr> instead of a generic structural element, and place the literal data into the 'title' attribute (where abbr expansions go), and the more brief and human readable equivalent into the element itself. Further informative explanation of this use of <abbr>: Human vs. ISO8601 dates problem solved


Singular Properties

Note that all the properties in geo are singular properties, and thus the first descendant element with that class should take effect, any others being ignored.

Human vs. Machine readable

If an <abbr> element is used for a property, then the title attribute of the <abbr> element is the value of the property, instead of the contents of the element, which instead provide a human presentable version of the value.

Value excerpting

Sometimes only part of an element which is the equivalent for a property should be used for the value of the property. For this purpose, the special class name value is used to excerpt out the subset of the element that is the value of the property. See hCard for details on this.

Root Class Name

The root class name for an geo location is geo.

Property List

This is the list of properties in geo, taken from hCard:

  • latitude
  • longitude

XMDP Profile

See hCard Profile for the XMDP profile of hCard which contains the above complete list of properties, with references to their RFC 2426 definitions.

Parsing Details

See hCard parsing, with the only difference being that "geo" is the root class name, rather than "vcard".


This section is informative.

Example from RFC2426

Section 3.4.2 of RFC2426 has a simple geo example:


this vCard fragment as a geo, as first documented on the hCard examples page:

<div class="geo">GEO: 
 <span class="latitude">37.386013</span>, 
 <span class="longitude">-122.082932</span>

this geo could be displayed as:

GEO: 37.386013, -122.082932

Note that this is a live geo microformat, which will be found on this page by parsers.

Real world geo example

Here is a sample of published lat/long info (from geocaching: Noble Steed):

N 37° 24.491 W 122° 08.313

With geo markup:

<div class="geo">
 <abbr class="latitude" title="37.408183">N 37° 24.491</abbr> 
 <abbr class="longitude" title="-122.13855">W 122° 08.313</abbr>

This geo might be displayed as:

N 37° 24.491 W 122° 08.313

Again, this is a live example.

Note that since the real world example used a more human readable presentation of the geo coordinates, we use the abbr design pattern to keep that more human readable presentation, and in addition provide the respective absolute numerical values for the geo.

Examples in the wild

This section is informative. The number of geo examples in the wild has expanded far beyond the capacity of being kept inline in this specification. They have been moved to a separate page.


This section is informative.

The following implementations have been developed which either generate or parse geos outside the context of hCards. If you have an geo implementation, feel free to add it to the top of this list. Once the list grows too big, we'll make a separate wiki page.

  • I've added Geo mark-up to the output of Wikipedia's GeoTemplate which is called by many thousands of other Wikipedia pages. Example: the coordinates (top right) in [1] link to [2]; the latter now has Geo mark-up in the "Mark-up" section. Andy Mabbett 03:10, 13 Jul 2007 (PDT)
  • GIS-Wiki's "hjl_getCoor" now outputs Geo markup, from a Google Maps API.
  • AddressFix takes any valid address in the listed countries (as at 2003-07) or map point (using GoogleMaps API) and outputs geo markup.
    • Countries: Andorra, Australia, Austria, Belgium, Canada, France, Germany, Gibraltar, Italy, Japan (but only in Japanese), Liechtenstein, Luxembourg, Monaco, Netherlands, New Zealand, San Marino, Spain, Sweden, Switzerland, United States of America and the Vatican City.
    • For countries other than the UK, the British Isles and China it provides geocoding for country names and city names (e.g. "Nairobi, Kenya").
    • For UK, the British Isles and China, Google returns an error.
  • GreaseRoute is a GreaseMonkey user script (also available as a simple Firefox Extension) which will add icons for displaying the MapQuest map of a Geo. Written by Andrew Turner
  • podster.de finds geo markups in podcast RSS Feeds and maps soundseeing episodes on a map (German only)
  • Calvin Yu has written a web service that will allow you plot and describe places on a Yahoo Map easily using hReview and Geo.
  • Philip Tellis has written a javascript to add maps to geo markup on pages
  • pnh_mf is a plugin for Textpattern that supports embedding geos and other microformats in templates and blog posts. Written by Chris Casciano.
  • Philip Tellis has written some javascript to convert the geo microformat to a google map using Geo.
  • Brian Suda has written some geo extracting code to convert geo microformats to KML for use with Google Maps and Google Earth. There is also a bookmarklet to extract the data and pass it to google maps automatically. He is working on a GeoRSS version for Yahoo! Maps as well.
    • GPX export is done, but needs some tweaking and testing. Just change &type=(kml|georss|gpx). Not quite ready for primetime yet. Feel free to test and send feedback.
  • Fil explains how to use the geo microformat with the javascript library jQuery [3].
  • GeoPress is a WordPress (http://wordpress.org) plugin that supports embedding adrs, geo, maps (dynamically switchable between Google-Yahoo-Microsoft Maps), and GeoRSS (http://georss.org) feeds. Written by Andrew Turner


Normative References

Informative References

Work in progress

This specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added.

Related Work

  • luna (proposal for geo-style microformat for co-ordinates on The Moon)
  • mars (proposal for geo-style microformat for co-ordinates on the planet Mars)
  • geo-extension-nonWGS84 - extends Geo to include the above, and for representing coordinates on other planets, moons etc.
  • thoughts on addind time and reference system to the geo microformat, that could also be used for places on other celestial bodies

Similar Work

See Also

Related Pages