Use figure tags

This commit is contained in:
~lucidiot 2024-02-27 08:49:32 +01:00
parent 5f749610c8
commit 836630e8b2
1 changed files with 20 additions and 5 deletions

View File

@ -1347,7 +1347,8 @@
<link>https://web.archive.org/web/20130307033513/http://postneo.com/icbm/</link>
<description><![CDATA[
<p>One of the most primitive ways you can specify geospatial information within an RSS feed is also one of the oldest, and it is supported by the W3C validator among others. The <code>icbm</code> XML namespace allows you to specify an <a href="https://en.wikipedia.org/wiki/ICBM_address" target="_blank">ICBM address</a> in either the <code>&lt;channel&gt;</code> or the <code>&lt;item&gt;</code> elements, allowing you to relate a location to either the entire RSS feed or a single specific item on that feed.</p>
<pre>
<figure>
<pre>
&lt;rss version="2.0" xmlns:icbm="http://postneo.com/icbm"&gt;
&lt;channel&gt;
&lt;!-- ... --&gt;
@ -1362,6 +1363,8 @@
&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<figcaption>Example of a point added to an RSS channel and item using the ICBM namespace</figcaption>
</figure>
<p>With this method, you can therefore specify a location where someone may send a nuke if they have been particularly angered by something you published on that feed. Or more commonly, you might want to set a location relevant to the feed, like the location of the <a href="https://xkcd.com/703/" target="_blank">tautology club</a> whose blog has a feed for, or the location of something mentioned within the feed.</p>
<p>There are other, more recent and more standard methods to refer to geographic coordinates in an RSS feed, and not just specific points. We will go over those some other time.</p>
]]></description>
@ -1379,7 +1382,8 @@
<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>
<figure>
<pre>
&lt;rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"&gt;
&lt;channel&gt;
&lt;!-- ... --&gt;
@ -1396,6 +1400,8 @@
&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<figcaption>Example of a point added to an RSS channel and item using the W3C Geo namespace</figcaption>
</figure>
<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>
@ -1423,7 +1429,8 @@
<p>Considering that the three namespaces we saw in the previous post appeared before GeoRSS, and that georss.org <a href="http://web.archive.org/web/20190602115923/http://www.georss.org/w3c.html" target="_blank">mentions the W3C Geo namespace</a>, it doesn't seem like they were starting well. However, the few remaining feeds that I know of that include geospatial information do use GeoRSS only, so I guess they won in the end. The fact that only geospatial experts would be using geospatial coordinates within RSS feeds, and that most GIS software only supports GeoRSS or name all of their RSS support GeoRSS, must have helped.</p>
<p>GeoRSS defines two so-called "serializations", called <em>Simple</em> and <em>GML</em>. In this post, we will only consider GeoRSS Simple; GML requires us to delve deeper into the mess that is geospatial information, so we'll see that at some other point in time. The goal is to have most feed producers, those that are not geospatial experts, use GeoRSS Simple, which is simple enough to be understandable by them, and have geospatial experts use GML, which they probably prefer. You can convert from GeoRSS Simple to GeoRSS GML, but not necessarily the other way around.</p>
<p>Here's an example of yet another way to represent a point in an RSS feed, but using GeoRSS Simple this time:</p>
<pre>
<figure>
<pre>
&lt;rss version="2.0" xmlns:georss="http://www.georss.org/georss"&gt;
&lt;channel&gt;
&lt;!-- ... --&gt;
@ -1435,6 +1442,8 @@
&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<figcaption>Example of a point added to an RSS channel and item using GeoRSS Simple</figcaption>
</figure>
<p>Where the other namespaces use two distinct tags to represent both coordinates of a point, GeoRSS uses only one tag, which is defined as a list of real numbers. While using one or two tags does not matter much whether you use one form or the other when using GPS coordinates, it does start to matter when you care a lot about altitude or work with other coordinate systems. GeoRSS Simple requires WGS84 (GPS) coordinates and represents elevation separately, so it won't ever matter in this serialization, but with GML, it will!</p>
<p>You may also note that in the first <code>point</code>, I used a space to separate both coordinates, whereas in the second one I used a comma. <a href="https://schemas.opengis.net/georss/1.0/schema-1.1/georss.xsd" target="_blank">The official <abbr title="XML Schema Definition">XSD</abbr></a> for GeoRSS Simple defines the point as holding a list of doubles (decimal numbers stored in 8 bytes) using the XSD <code>&lt;xs:list&gt;</code> element, which defines a list of items as being space-separated only. But <a href="https://docs.ogc.org/cs/17-002r1/17-002r1.html#20" target="_blank">section 7.3</a> of the OGC standard states that a comma is also acceptable, so anyone wishing to parse GeoRSS will have to take that into account.</p>
]]></description>
@ -1450,7 +1459,8 @@
<link>https://docs.ogc.org/cs/17-002r1/17-002r1.html#26</link>
<description><![CDATA[
<p><a href="https://envs.net/~lucidiot/rsrsss/feed.xml#georss-simple-1" target="_blank">In a previous post</a>, I introduced GeoRSS Simple, a subset of GeoRSS, and described a fourth way to point to a location in your RSS feeds. With the W3C Geo namespace, we could add altitude information as well, but with GeoRSS, we can go even further beyond that:</p>
<pre>
<figure>
<pre>
&lt;rss version="2.0" xmlns:georss="http://www.georss.org/georss"&gt;
&lt;channel&gt;
&lt;item&gt;
@ -1466,6 +1476,8 @@
&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<figcaption>A point added to an RSS item using GeoRSS Simple, with optional elements</figcaption>
</figure>
<p>Here's a description of all of those intriguing optional elements:</p>
<dl>
<dt><code>&lt;<dfn>georss:featureName</dfn>&gt;</code></dt>
@ -1512,7 +1524,8 @@
<dd>This is the geometric, and not the geospatial definition of a polygon. In <abbr title="Geographical Information Systems">GIS</abbr>, a polygon has multiple linear rings: one exterior ring, and zero or more interior rings that draw holes inside of the polygon. A linear ring is the more common definition of a polygon: a line that starts and ends at the same point. Here, we can only have the exterior ring of a polygon, so this is actually a linear ring. It is represented just like a line, as pairs of coordinates. There are at least three points per polygon, and the first and last must be equal.</dd>
</dl>
<p>Here are some examples of each of those tags:</p>
<pre>
<figure>
<pre>
&lt;!-- Part of Haaldersbroekerdwarsstraat, a long street name in the Netherlands --&gt;
&lt;georss:line&gt;52.4718867,4.8277792 52.4721926,4.8275892 52.4729501,4.8270419&lt;/georss:line&gt;
@ -1534,6 +1547,8 @@ because astronomers need coffee to go through the night --&gt;
-24.6273416,-70.4045081
&lt;/georss:polygon&gt;
</pre>
<figcaption>A line, a rectangle and a polygon represented with GeoRSS Simple</figcaption>
</figure>
<p>You can only specify one of these geometries at once, along with all the optional elements that I described in the previous post. Those new shapes enable some new interesting use cases for feeds:</p>
<ul>
<li>Blogging about a cross-country hike, with the GPS track of each day as a <code>&lt;georss:line&gt;</code>.</li>