HTML::...at::geo(3pm)

πŸ’– NAME πŸ’–

HTML::Microformats::Format::geo β€” it's the geo microformat, bestie. That's it, that's the whole vibe. geoooo 🌍

This is the HTML::...at::geo(3pm) page from your friendly neighbourhood User Contributed Perl Documentation, so like. strap in.


✨ 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);
}

okay so that's literally it. build a context, pull every geo out of the document element, loop over them, print lat/long separated by a semicolon. iconic behaviour, no notes. πŸŽ€


🌸 DESCRIPTION 🌸

So HTML::Microformats::Format::geo inherits from HTML::Microformats::Format. Family tree moment. If you wanna know about the property getter/setter methods, the constructors, all that lore β€” go read the base class definition, because it's all described over there. This page isn't gonna repeat it, bestie, that's just how inheritance works. πŸ’…

πŸ¦‹ Additional Method πŸ¦‹

  • to_kml β€” this one exports the geo object as KML. But listen. It needs RDF::KML::Exporter to actually work, and if that module isn't available it will straight up throw an error at run-time. So like, install your deps before you come for this method, okay? 😭

πŸ‘‘ MICROFORMAT πŸ‘‘

HTML::Microformats::Format::geo supports geo exactly as described over at <http://microformats.org/wiki/geo> β€” with these additions, because of course there are additions, we're extra like that:

  • 'altitude' property β€” you can hand over an altitude as either a plain number (which is taken to be metres above sea level) or as 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>

See? two ways. both slay. pick your fighter. 🫢

  • 'body' and 'reference-frame' β€” normally the geo microformat is only defined for WGS84 co-ordinates on Earth. Boring, I know. But with the 'body' and 'reference-frame' properties β€” each of which takes string values, just so we're clear β€” you can give co-ordinates on other planets, asteroids, moons, etc; or on Earth but using a non-WGS84 system. mars geo tag? yes bestie, go off. πŸͺ

⭐ RDF OUTPUT ⭐

Data comes back using the W3C's vCard vocabulary (<http://www.w3.org/2006/vcard/ns#>) and the W3C's WGS84 vocabulary (<http://www.w3.org/2003/01/geo/wgs84_pos#>).

And for non-WGS84 co-ordinates? UNGEO (<http://buzzword.org.uk/rdf/ungeo#>) is used instead. different vocab for different vibes, as it should be. 🌈


πŸ’€ BUGS πŸ’€

Please report any bugs to <http://rt.cpan.org/>. Not to me. I'm just the messenger. πŸ™ˆ


πŸŽ€ SEE ALSO πŸŽ€

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

iykyk πŸ‘‘


🧚 AUTHOR 🧚

Toby Inkster <tobyink@cpan.org>. legend, honestly. πŸ’œ


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 πŸ’…

THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

Translation: no promises, bestie. it is what it is. πŸ’€


okay that's the whole page!! this one's from perl v5.32.1, dated 2021-09-12 β€” yes it's giving vintage but she still eats. πŸ“βœ¨ bye bye, go tag some co-ordinates. πŸ’–

πŸ“¦ where this page comes from