SYNOPSIS

 use Data::Dumper;
 use HTML::Microformats::DocumentContext;
 use HTML::Microformats::Format::geo;

 my $context = HTML::Microformats::DocumentContext->new($dom, $uri);
 my @geos    = HTML::Microformats::Format::geo->extract_all(
                   $dom->documentElement, $context);
 foreach my $geo (@geos)
 {
   printf("%s;%s\n", $geo->get_latitude, $geo->get_longitude);
 }

DESCRIPTION

HTML::Microformats::Format::geo inherits from HTML::Microformats::Format. See the base class definition for a description of property getter/setter methods, constructors, etc.

Additional Method

  • \*(C`to_kml\*(C' This method exports the geo object as \s-1KML\s0. It requires RDF::KML::Exporter to work, and will throw an error at run-time if it's not available.

MICROFORMAT

HTML::Microformats::Format::geo supports geo as described at <http://microformats.org/wiki/geo>, with the following additions:

  • 'altitude' property You may provide an altitude as either a number (taken to be metres above sea level) or an embedded hMeasure. e.g.: <span class="geo"> lat: <span class="latitude">12.34</span>, long: <span class="longitude">56.78</span>, alt: <span class="altitude">90</span> metres. </span>

    <span class="geo"> lat: <span class="latitude">12.34</span>, long: <span class="longitude">56.78</span>, alt: <span class="altitude hmeasure"> <span class="num">90</span> <span class="unit">m</span> </span>. </span>

  • 'body' and 'reference-frame' The geo microformat is normally only defined for \s-1WGS84\s0 co-ordinates on Earth. Using 'body' and 'reference-frame' properties (each of which take string values), you may give co-ordinates on other planets, asteroids, moons, etc; or on Earth but using a non-WGS84 system.

RDF OUTPUT

Data is returned using the W3C's vCard vocabulary (<http://www.w3.org/2006/vcard/ns#>) and the W3C's \s-1WGS84\s0 vocabulary (<http://www.w3.org/2003/01/geo/wgs84_pos#>).

For non-WGS84 co-ordinates, \s-1UNGEO\s0 (<http://buzzword.org.uk/rdf/ungeo#>) is used instead.

BUGS

Please report any bugs to <http://rt.cpan.org/>.

RELATED TO HTML::Microformats::Format::geo…

HTML::Microformats::Format, HTML::Microformats, HTML::Microformats::Format::hCard.

AUTHOR

Toby Inkster <[email protected]>.

COPYRIGHT AND LICENCE

Copyright 2008-2012 Toby Inkster

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

DISCLAIMER OF WARRANTIES

\s-1THIS\s0 \s-1PACKAGE\s0 \s-1IS\s0 \s-1PROVIDED\s0 \*(L"\s-1AS\s0 \s-1IS\s0\*(R" \s-1AND\s0 \s-1WITHOUT\s0 \s-1ANY\s0 \s-1EXPRESS\s0 \s-1OR\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0, \s-1INCLUDING\s0, \s-1WITHOUT\s0 \s-1LIMITATION\s0, \s-1THE\s0 \s-1IMPLIED\s0 \s-1WARRANTIES\s0 \s-1OF\s0 \s-1MERCHANTIBILITY\s0 \s-1AND\s0 \s-1FITNESS\s0 \s-1FOR\s0 A \s-1PARTICULAR\s0 \s-1PURPOSE\s0.