Geo (microformat)

A Geo microformat, detected on the Wikipedia page for Great Barr, by Firefox's Operator extension. Users may add alternative mapping sources to those shown, which are included by default.

Geo is a microformat used for marking up geographical coordinates (latitude and longitude) in HTML (or XHTML). Coordinates are expected in angular units of degrees and geodetic datum WGS84. Although termed a "draft" specification, the format is a de facto standard, stable and in widespread use; not least as a sub-set of the published hCalendar and hCard microformat specifications, neither of which is still a draft.

Use of Geo allows parsing tools (for example other websites, or Firefox's Operator extension) to extract the locations, and display them using some other website or web mapping tool, or to load them into a GPS device, index or aggregate them, or convert them into an alternative format.

Usage

The Geo microformat is applied using three HTML classes. For example, the marked-up text:

<div>Belvide: 52.686; -2.193</div>

becomes:

<div class="geo">
  Belvide:
  <span class="latitude">52.686</span>,
  <span class="longitude">-2.193</span>
</div>

by adding the class-attribute values "geo", "latitude" and "longitude".

This will display

Belvide: 52.686, -2.193

and a geo microformat for that location, Belvide Reservoir, which will be detected, on this page, by microformat parsing tools.

hCard

Each Geo microformat may be wrapped in an hCard microformat, allowing for the inclusion of personal, organisational or venue names, postal addresses, telephone contacts, URLs, pictures, etc.

When

Extensions

There are three proposals, none mutually-exclusive, to extend the geo microformat:

Users

Organisations and websites using Geo include:

Multiple organisations [which?] publishing hCard include a geo as part of that.

h-geo

h-geo is the successor to the legacy hGeo format and implements the second-generation Microformats2 vocabulary, and is recommended for use in newer projects to take advantage of additional properties and rendering capabilities in modern browsers. h-geo This is applied using three HTML property classes. For example:


<div class="h-card">
  <span class="p-name">Belvide</span>
  <div class="p-location h-geo">
    <span class="p-latitude">52.686</span>
    <span class="p-longitude">-2.193</span>
  </div>
</div>


<div class="h-geo">Belvide: <span class="p-latitude">52.686</span>; <span class="p-longitude">-2.193</span>; <span class="p-altitude">120</span></div>

by adding the class-attribute values "h-geo", "p-latitude", "p-longitude", and "p-altitude".

Usage in Contacts

h-card, the successor to hCard, also implements the Microformats2 vocabulary for describing entities and their properties. As a result, coordinates should be embedded within h-cards using the h-geo format.

See also

Notes

  1. ↑ Must and should are used per the IETF document RFC 2119

References

  1. 1 2 "Geo Spec". microformats community. Retrieved 17 August 2010.
  2. ↑ "Extending HTML5 — Microformats". HTML5 Doctor. Retrieved 19 August 2010.
  3. 1 2 "hCalendar 1.0 Spec". Microformats community. Retrieved 17 August 2010.
  4. 1 2 "hCard 1.0 Spec". Microformats Community. Retrieved 17 August 2010.
  5. ↑ "Microformats in Google Maps". Retrieved 30 April 2016.