Difference between revisions of "geo"
m (→Examples in the wild: expose page name for improved accesibility)
|Line 123:||Line 123:|
== Examples in the wild ==
== Examples in the wild ==
This section is '''informative'''. The number of
This section is '''informative'''. The number of 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|]].
== Implementations ==
== Implementations ==
Revision as of 11:56, 3 September 2007
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.
- 1 geo
- 1.1 Draft Specification
- 1.2 Introduction and Background
- 1.3 Semantic XHTML Design Principles
- 1.4 Format
- 1.5 Examples
- 1.6 Examples in the wild
- 1.7 Implementations
- 1.8 References
- 1.9 Work in progress
- 1.10 Related Work
- 1.11 Similar Work
- 1.12 See Also
- 1.13 Related Pages
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.
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
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.
- 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.
- For types with multiple components, use nested elements with class names equivalent to the names of the components.
- Plural components are made singular, and thus multiple nested elements are used to represent multiple text values that are comma-delimited.
- Use the most accurately precise semantic XHTML building block for each object etc.
- Otherwise use a generic structural element (e.g.
<div>), or the appropriate contextual element (e.g. an
- 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.
- 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
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
<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.
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
This is the list of properties in geo, taken from hCard:
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> </div>
this geo could be displayed as:
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> </div>
This geo might be displayed as:
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, Geo examples in the wild.
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  link to ; 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.
- pnh_mf is a plugin for Textpattern that supports embedding geos and other microformats in templates and blog posts. Written by Chris Casciano.
- 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.
- 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
- vCard RFC2426 (HTML reformatted version of RFC2426)
- XHTML 1.0 SE
- TIGER Map Service
- Wikipedia article on GeoTagging
Work in progress
This specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added.
- 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
- Geo cheatsheet
- Geo examples
- geo formats - previous/other attempts at geo related formats
- Geo brainstorming - brainstorms and other explorations relating to Geo (and Geo in hCard).
- see also hCard brainstorming
- Geo advocacy - encourage others to use Geo.
- Geo examples in the wild
- Geo forms part of hCard 1.0, so please use:
- location-formats - research which led to the development of Geo.
- proposed extensions
- Geo profile - draft