Post about W3C Geo and GeoURL

This commit is contained in:
~lucidiot 2023-09-10 17:49:08 +02:00
parent afd2e461b8
commit 1330f7fc01
1 changed files with 38 additions and 0 deletions

View File

@ -9,6 +9,7 @@
xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns:icbm="http://postneo.com/icbm"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
@ -1354,6 +1355,43 @@
<icbm:latitude>33.6772827</icbm:latitude>
<icbm:longitude>-106.4753787</icbm:longitude>
</item>
<item>
<title>Adding geographical coordinates peacefully</title>
<pubDate>Sun, 10 Sep 2023 17:44:24 +0200</pubDate>
<guid isPermaLink="false">geo</guid>
<category domain="https://envs.net/~lucidiot/rsrsss/">Tip</category>
<category domain="https://envs.net/~lucidiot/rsrsss/">Geospatial</category>
<link>https://www.w3.org/2003/01/geo/</link>
<description><![CDATA[
<p>In <a href="https://envs.net/~lucidiot/rsrsss/feed.xml#icbm">the previous post on geospatial stuff in RSS</a>, I showed how to define an <a href="https://en.wikipedia.org/wiki/ICBM_address" target="_blank">ICBM address</a>, to which heads of states may send a nuke if they did not appreciate your post. At around the same time as the <code>icbm</code> namespace got created in a blog post for RSS 2.0, the Semantic Web Interest Group of the W3C devised a <a href="https://www.w3.org/2003/01/geo/" target="_blank">Basic Geo Vocabulary</a> that allows for something very similar to ICBM addresses, but that does not require missiles and is integrated into RDF. It also adds the ability to specify an optional altitude, in meters.</p>
<p>This is meant to be used in RDF, so you would probably normally use this in a <abbr title="RDF Site Summary">RSS</abbr> 1.0 feed, but as with many other RDF namespaces, nothing really stops you from integrating that into RSS 2.0 or Atom, and many people have done so already.</p>
<pre>
&lt;rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"&gt;
&lt;channel&gt;
&lt;!-- ... --&gt;
&lt;geo:lat&gt;30.0301&lt;/geo:latitude&gt;
&lt;geo:long&gt;32.5776&lt;/geo:longitude&gt;
&lt;item&gt;
&lt;!-- ... --&gt;
&lt;geo:lat&gt;31.5077090&lt;/geo:latitude&gt;
&lt;geo:long&gt;-82.3115156&lt;/geo:longitude&gt;
&lt;!-- It's Moon time. --&gt;
&lt;geo:alt&gt;384400000&lt;/geo:alt&gt;
&lt;/item&gt;
&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<hr />
<p>Two years later, in April 2005, GeoURL.org, a service that used to allow finding websites by their associated geographical location, <a href="https://web.archive.org/web/20070323023116/http://geourl.org:80/news/2005/04/26/rssplus.html" target="_blank">introduced the <code>geourl</code> namespace</a>, adding another duplicate namespace on top of <code>icbm</code> and <code>geo</code>. I mention it here too because the W3C validator supports all three namespaces!</p>
<p>You can use it with <code>xmlns:geourl="http://geourl.org/rss/module/"</code> and the <code>&lt;geourl:latitude&gt;</code> and <code>&lt;geourl:longitude&gt;</code> elements. I would however advise against using it as it increases the complexity for feed parser and feed reader developers; prefer the RDF <code>geo</code> namespace instead, which is more widely known.</p>
<p>And as a last piece of advice, do not mix the <code>icbm</code>, <code>geo</code> and <code>geourl</code> namespaces within the same channel or item, even if you intend to represent multiple coordinates at the same time! There are more complex but more flexible alternatives, which we will see in later posts, that allow to go beyond a single point.</p>
]]></description>
<geo:lat>40.8953768</geo:lat>
<geo:long>-73.1427788</geo:long>
<geo:alt>49</geo:alt>
</item>
</channel>
<access:restriction relationship="allow" />
</rss>