geo (working name, pronounced "gee-oh") is a simple format for marking up geographic latitude longitude information, 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.
This specification is (C) 2005-2022 by the authors. However, the authors intend to submit (or already have submitted, see details in the spec) this specification to a standards body with a liberal copyright/licensing policy such as the GMPG, IETF, and/or W3C. Anyone wishing to contribute should read their copyright principles, policies and licenses (e.g. the GMPG Principles) and agree to them, including licensing of all contributions under all required licenses (e.g. CC-by 1.0 and later), before contributing.
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.
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 addresses in the context of the rest of the information in their web pages and feeds.
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.
Similarly, if an
<img> element is used for one or more properties, it must be treated as follows:
- For the "PHOTO" property and any other property that takes a URL as its value, the
src="..."attribute provides the property value.
- For other properties, the
alt' attribute is the value of the property.
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".
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.
Here is a sample geo:
<div class="geo"> <span class="latitude">37.779441</span>, <span class="longitude">-122.393229</span> </div>
This geo might be displayed as:
See hCard example geo for more examples.
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 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 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.
Work in progress
This specification is a work in progress. As additional aspects are discussed, understood, and written, they will be added.
- If you have any questions about hCard, check the hCard FAQ first, and if you don't find answers, add your questions! (Odds are that any geo question will apply to hCard as well).
- Please add any issues with the specification to the separate hCard issues document. Ditto.