[uf-discuss] Best Practice for wrapping hCard information with geo, for display on Google Earth?

Costello, Roger L. costello at mitre.org
Thu Nov 30 04:16:59 PST 2006


Hi Folks,

I am when using Brian Suda's xhtml2kml.xsl tool to create a KML file
from an hCard.  Then I display the KML on Google Earth.

What is the best practice for wrapping hCard data with geo, which will
result in the most informative rendering on Google Earth?  Let me
explain what I mean.

Consider this hCard:

<span class="vcard">
      <span class="fn org">Waldorf-Astoria</span>
      <span class="adr">
            <span class="street-address">301 Park Ave.</span><br />
            <span class="locality">New York</span>, 
            <abbr class="region" title="New York">NY</abbr>
            <span class="postal-code">10022</span>
      </span>
</span>

The lat/lon coordinates of the Waldorf-Astoria are:

     Latitude: 40.756561  /  Longitude: -73.974056

Here are some possible ways to wrap the hCard data with geo:

1. Wrap the name (Waldorf-Astoria)

<span class="vcard">
      <abbr class="geo" title="40.756561; -73.974056">
            <span class="fn org">Waldorf-Astoria</span>
      </abbr>
      <span class="adr">
            <span class="street-address">301 Park Ave.</span><br />
            <span class="locality">New York</span>, 
            <abbr class="region" title="New York">NY</abbr>
            <span class="postal-code">10022</span>
      </span>
</span>

Running Brian's tool will yield KML that when displayed on Google Earth
shows the label "Waldorf-Astoria" at that lat/lon.  But that's all the
information that will be displayed.

2. Wrap the street address (301 Park Ave.)

<span class="vcard">
      <span class="fn org">Waldorf-Astoria</span>
      <span class="adr">
            <abbr class="geo" title="40.756561; -73.974056">
                  <span class="street-address">301 Park Ave.</span><br
/>
             </abbr>
            <span class="locality">New York</span>, 
            <abbr class="region" title="New York">NY</abbr>
            <span class="postal-code">10022</span>
      </span>
</span>

Running Brian's tool will yield KML that when displayed on Google Earth
shows the label "301 Park Ave." at that lat/lon.  Again, that's all the
information that will be displayed.

Is it better the Google Earth label show the name of a place or its
address?

3. Wrap the entire collection of information

<span class="vcard">
      <abbr class="geo" title="40.756561; -73.974056">
            <span class="fn org">Waldorf-Astoria</span>
            <span class="adr">
                  <span class="street-address">301 Park Ave.</span><br
/>
                  <span class="locality">New York</span>, 
                  <abbr class="region" title="New York">NY</abbr>
                  <span class="postal-code">10022</span>
            </span>
      </abbr>
</span>

Running Brian's tool will yield KML that when displayed on Google Earth
shows the label containing all the information (name, street address,
city, etc).  Not pretty.

So, what is the best way to wrap (with geo) hCard data that will
produce KML, which when displayed on Google Earth, creates an
informative display?

/Roger



More information about the microformats-discuss mailing list