Post about GeoRSS GML

This commit is contained in:
~lucidiot 2023-10-15 23:29:00 +02:00
parent 8921e100fa
commit 278c91cc03
1 changed files with 133 additions and 0 deletions

133
feed.xml
View File

@ -11,6 +11,7 @@
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
xmlns:georss="http://www.georss.org/georss"
xmlns:gml="http://www.opengis.net/gml"
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/"
@ -20,6 +21,7 @@
xsi:schemaLocation="
http://postneo.com/icbm xsd/icbm.xsd
http://www.georss.org/georss https://schemas.opengis.net/georss/1.0/schema-1.1/georss.xsd
http://www.opengis.net/gml https://schemas.opengis.net/georss/1.0/schema-1.1/gmlgeorss.xsd
"
>
<channel>
@ -1543,6 +1545,137 @@ because astronomers need coffee to go through the night --&gt;
<georss:relationshipTag>has-nothing-to-do-with</georss:relationshipTag>
</item>
<item>
<title>Become a geospatial nerd with GeoRSS GML</title>
<pubDate>Sun, 15 Oct 2023 17:40:14 +0200</pubDate>
<guid isPermaLink="false">georss-gml</guid>
<category domain="https://envs.net/~lucidiot/rsrsss/">Tip</category>
<category domain="https://envs.net/~lucidiot/rsrsss/">Geospatial/GeoRSS</category>
<link>https://docs.ogc.org/cs/17-002r1/17-002r1.html#31</link>
<description><![CDATA[
<p>In this fourth post explaining GeoRSS, I'll be talking about GeoRSS GML, the second "serialization" of the format. GeoRSS Simple is meant to be easily translated into GeoRSS GML so that your typical RSS feed developer can more easily understand GeoRSS, and geospatial experts can use a format they are more acquainted with: GML.</p>
<p><dfn><abbr title="Geography Markup Language">GML</abbr></dfn> is an enormous XML schema designed to express any geospatial data under the sun. Geometries, features, coordinate reference systems, units of measurement, time, sensor measurements, data re-fetched automatically over the network, assigning coordinates to images, etc.</p>
<p>The language is not meant to be used alone, as supporting all of it is equivalent to implementing nearly every bit of geospatial software out there. Instead, GML <em>profiles</em> are defined, which are subsets of GML that are relevant to your needs, and are then used in <em>application schemas</em>, which define the specific XML format you are using that will contain some of that GML profile in it.</p>
<p>GeoRSS is an application schema using <a href="https://schemas.opengis.net/georss/1.0/schema-1.1/gmlgeorss.xsd" target="_blank">a dedicated GML profile</a> that severely restricts GML so that we don't become too insane. You are limited to four geometries, one less that the five we saw in GeoRSS Simple: points, lines, boxes, and polygons. You do have access to some extra options though, and we'll look into that soon enough.</p>
<h3>Examples</h3>
<p>Here is an example I wrote previously for a single point in GeoRSS Simple, but rewritten for GeoRSS GML:</p>
<figure>
<pre>
&lt;rss
version="2.0"
xmlns:georss="http://www.georss.org/georss"
xmlns:gml="http://www.opengis.net/gml"
&gt;
&lt;channel&gt;
&lt;item&gt;
&lt;!-- ... --&gt;
&lt;georss:where&gt;
&lt;gml:Point&gt;
&lt;gml:pos&gt;-33.8735580 151.2344385&lt;/gml:pos&gt;
&lt;/gml:Point&gt;
&lt;/georss:where&gt;
&lt;georss:featureName&gt;Boat Syndication Australia&lt;/georss:featureName&gt;
&lt;georss:featureTypeTag&gt;shop&lt;/georss:featureTypeTag&gt;
&lt;georss:relationshipTag&gt;has-nothing-to-do-with&lt;/georss:relationshipTag&gt;
&lt;georss:elev&gt;5.25&lt;/georss:elev&gt;
&lt;georss:floor&gt;0&lt;/georss:floor&gt;
&lt;georss:radius&gt;4.5&lt;/georss:radius&gt;
&lt;/item&gt;
&lt;/channel&gt;
&lt;/rss&gt;
</pre>
<figcaption>Example of a point added to an RSS channel using GeoRSS GML</figcaption>
</figure>
<p>The only two differences are that there is now a new <code>gml</code> namespace, and that the <code>georss:point</code> element has been replaced with a <code>georss:where</code> element to hold the point defined with GML. And now for the examples of other geometry types, which you would now place inside of the <code>georss:where</code>:</p>
<figure>
<pre>
&lt;!-- Part of Haaldersbroekerdwarsstraat, a long street name in the Netherlands --&gt;
&lt;gml:LineString&gt;
&lt;gml:posList&gt;52.4718867,4.8277792 52.4721926,4.8275892 52.4729501,4.8270419&lt;/gml:posList&gt;
&lt;/gml:LineString&gt;
&lt;!-- Some random grass not so far away from there --&gt;
&lt;gml:Envelope&gt;
&lt;gml:lowerCorner&gt;52.5662344 4.7976189&lt;/gml:lowerCorner&gt;
&lt;gml:upperCorner&gt;52.5676983 4.8013674&lt;/gml:upperCorner&gt;
&lt;/gml:Envelope&gt;
&lt;!-- A building called ESPRESSO at the Very Large Telescope,
because astronomers need coffee to go through the night --&gt;
&lt;gml:Polygon&gt;
&lt;gml:exterior&gt;
&lt;gml:LinearRing&gt;
&lt;gml:posList&gt;
-24.6273416 -70.4045081
-24.6273922 -70.4044894
-24.6274264 -70.4046014
-24.6274789 -70.4045820
-24.6276119 -70.4045330
-24.6275341 -70.4042780
-24.6274634 -70.4043041
-24.6274763 -70.4043463
-24.6273109 -70.4044074
-24.6273416 -70.4045081
&lt;/gml:posList&gt;
&lt;/gml:LinearRing&gt;
&lt;/gml:exterior&gt;
&lt;/gml:Polygon&gt;
</pre>
<figcaption>Examples of other geometry types with GeoRSS GML</figcaption>
</figure>
<h3>Reference</h3>
<dl>
<dt><code>&lt;<dfn>georss:where</dfn>&gt;</code></dt>
<dd>The wrapper for GML within an RSS feed. While nothing really stops you from using GML directly without GeoRSS within an RSS item, most feedreaders and other parsers will only support GML wrapped into this element. This should not be used at the same time as the GeoRSS Simple geometry elements like <code>&lt;georss:point&gt;</code>.</dd>
<dt><code>&lt;<dfn>gml:pos</dfn>&gt;</code></dt>
<dd>A single coordinate pair, as two decimal numbers. The first is the latitude between &ndash;90 and 90°, and the second the longitude between &ndash;180 and 180°, as WGS84.</dd>
<dt><code>&lt;<dfn>gml:posList</dfn>&gt;</code></dt>
<dd>A list of 2 or more decimal numbers representing a series of coordinate pairs. There should always be an even number of coordinates.</dd>
<dt><code>&lt;<dfn>gml:Point</dfn>&gt;</code></dt>
<dd>A single point, containing a <code>&lt;gml:pos&gt;</code> element to indicate its coordinates.</dd>
<dt><code>&lt;<dfn>gml:LineString</dfn>&gt;</code></dt>
<dd>A series of points linked together by straight lines. This should contain a <code>&lt;gml:posList&gt;</code> to list the coordinates of each point.</dd>
<dt><code>&lt;<dfn>gml:Envelope</dfn>&gt;</code></dt>
<dd>A rectangle. This must contain a <code>&lt;gml:lowerCorner&gt;</code> and a <code>&lt;gml:upperCorner&gt;</code> to specify its two corners.</dd>
<dt><code>&lt;<dfn>gml:lowerCorner</dfn>&gt;</code></dt>
<dd>The lower-left, or southwest, corner of a <code>&lt;gml:Envelope&gt;</code>. Its value is the same as a <code>&lt;gml:pos&gt;</code>.</dd>
<dt><code>&lt;<dfn>gml:upperCorner</dfn>&gt;</code></dt>
<dd>The upper-right, or northeast, corner of a <code>&lt;gml:Envelope&gt;</code>. Its value is the same as a <code>&lt;gml:pos&gt;</code>.</dd>
<dt><code>&lt;<dfn>gml:Polygon</dfn>&gt;</code></dt>
<dd>In the <abbr title="Geographical Information Systems">GIS</abbr> world, a polygon is composed of multiple rings; at least one exterior ring, and zero or more interior rings that create holes within the exterior ring. This element therefore must have a <code>&lt;gml:exterior&gt;</code> ring. GeoRSS GML forbids any interior rings, since the GeoRSS Simple <code>&lt;georss:polygon&gt;</code> does not support interior rings, so the exterior ring is always alone.</dd>
<dt><code>&lt;<dfn>gml:exterior</dfn>&gt;</code></dt>
<dd>The exterior ring of a polygon. This should contain a <code>&lt;gml:LinearRing&gt;</code>.</dd>
<dt><code>&lt;<dfn>gml:LinearRing</dfn>&gt;</code></dt>
<dd>A <code>&lt;gml:LineString&gt;</code>, but there has to be at least four points, and the first and last coordinates must be equal, so that the line string forms a ring.</dd>
</dl>
]]></description>
<georss:where>
<gml:Polygon>
<gml:exterior>
<gml:LinearRing>
<gml:posList>
-24.6273416 -70.4045081
-24.6273922 -70.4044894
-24.6274264 -70.4046014
-24.6274789 -70.4045820
-24.6276119 -70.4045330
-24.6275341 -70.4042780
-24.6274634 -70.4043041
-24.6274763 -70.4043463
-24.6273109 -70.4044074
-24.6273416 -70.4045081
</gml:posList>
</gml:LinearRing>
</gml:exterior>
</gml:Polygon>
</georss:where>
<georss:featureName>ESPRESSO</georss:featureName>
<georss:featureTypeTag>building</georss:featureTypeTag>
<georss:relationshipTag>author-likes-the-name</georss:relationshipTag>
<georss:elev>2635</georss:elev>
</item>
</channel>
<access:restriction relationship="allow" />
</rss>