[wp-hackers] Re: Place, Geotagging

Mike Schinkel mikeschinkel at gmail.com
Wed Nov 5 07:25:21 GMT 2008


Matt wrote:
>> There's also a Microformat for geotagging:

Cool, that could be a useful too.

FYI, a requirement in concept for Microformats is that a Microformat's data
must be visible in the rendered HTML with the rationale being they need to
be visible otherwise the data won't be maintained. (Search for the word
"visible" on http://microformats.org/wiki/faq) 

(As an aside this "visbility" requirement is an ideology that the leaders of
the Microformat community believe in strongly but for which I disagreement
with in many use-cases. As an aside, after first being very much enamored
with Microformats it was my disagreement with this an other principle of
"Microformat" that led me to invest my time elsewhere. Still, if you plan to
use a Microformat you really should follow the Microformat-way. Note here is
a specific FAQ about visibility and the GEO Microformat:
http://microformats.org/wiki/faq#Q._What_about_using_new_URI_schemes_instead
_of_class_names.2C_e.g._for_geo_information.3F)

AFAICT the Microformat way was envisioned as if people were hand-coding
HTML. In the use-case of infrastructure for a blog or CMS that simply isn't
a relevant use-case IMO. A plugin can easily make its data "visibile" in the
admin console by providing a persistent notice until the plugin's data is
configured. After that the plugin can continue to make the data viewable on
demand within the admin console. This nullifies the benefits of requiring
data to be visible IMO.

Given there is no benefit to forcing visibility the data could be rendered
as <META> tags and the benefit of doing so in WordPress would be that the
theme would not be affected and thus would not need to be modified. There
would however still be a benefit to also optionally incorporating GEO
Microformats in the theme for those crawlers and/or tools that recognize the
GEO microformat. 

BTW, the GEO Microformat doesn't solve any of the taxonomy problems
mentioned because the GEO Microformat only marks up Latitude & Longitude and
not any other data. Thus while GEO Microformat support would be a good idea
because it would be very easy to provide, it's certainly not a complete
solution.

I could actually write a plugin to do the things I've mentioned.  

Would there be interest in using this plugin by others if I did so?
Essentially the plugin I'm proposing would allow you to enter Latitude,
Longitude, Region, Place Name, and Wikipedia URL for the Place into an admin
page and then it would inject the following meta tags into the HTML HEAD
element:

<META NAME="geo.position" CONTENT="$latitude; $longitude"> 
<META NAME="geo.placename" CONTENT="$placename"> 
<META NAME="geo.region" CONTENT="$country_code-$subdivision_code">
<META NAME="wikipedia.place" CONTENT="$wikipedia_path">

e.g.

<META NAME="geo.position" CONTENT="40.756053; -73.986952"> 
<META NAME="geo.placename" CONTENT="New York City, NY USA"> 
<META NAME="geo.region" CONTENT="US-NY">
<META NAME="wikipedia.place" CONTENT="New_York_City">

It would provide the follow template tags for incorporating into a theme:

	the_geo_microformat()
		'<div class="geo">$placename:
			<span class="latitude">$latitude</span>; 
			<span class="longitude">$longitude</span>
		</div>'

	the_geo_position()	=> 
		array('latitude'=> $latitude,'longitude'=>$longitude) 

	the_geo_latitude() => 
		$latitude

	the_geo_longitude() => 
		$longitude

	the_geo_country_code() =>
		$country_code

	the_geo_region() =>
		$country_code-$subdivision_code

	the_geo_subregion()	 =>
		$subdivision_code

	the_geo_placename() =>
		$placename

	the_wikipedia_place_code() => 
		$wikipedia_path

e.g.

	the_geo_microformat()
		'<div class="geo">$placename:
			<span class="latitude">40.756053</span>; 
			<span class="longitude">-73.986952</span>
		</div>'

	the_geo_position()	=> 
		array('latitude'=> 40.756053,'longitude'=>-73.986952) 

	the_geo_latitude() => 
		40.756053

	the_geo_longitude() => 
		-73.986952

	the_geo_country_code() =>
		'US'

	the_geo_region() =>
		'US-NY'

	the_geo_subregion()	 =>
		'NY'

	the_geo_placename() =>
		New York City, NY USA

	the_wikipedia_place_code() => 
		'New_York_City'


Thoughts?

-Mike Schinkel 
http://mikeschinkel.com


-----Original Message-----



More information about the wp-hackers mailing list