Print This Post

Embedding GML in non-GML grammars

There are lots of people who want to use GML for locations, extents etc. – but don't want to subscribe to the more formal grammar of GML (object-property-value) throughout their own grammar. Some examples might include the embedding of GML in RSS, Atom, CAP and otrher XML grammars that have a limited requirement for geographic information – but which wish to define a "property" that has some geometric extent.

For example – I might wish to associate a news story with a location. I might write (this is not RSS per se)

1
2
3
4
5
6
7
8
9
    <NewsStory>
      <author>John Lamb</author>
      <dated>10-Jan-2006</dated>
      <where>
        <gml:Point id="p21">
          <gml:pos>45.2 -89.7</gml:pos>
        </gml:Point>
      </where>
    </NewsStory>

In this case only the bits with the "gml" prefix are in the GML namespace (http://www.opengis.net/gml). and the rest need NOT be a formal GML application schema. The rest are in my web-feed grammar.

In a similar way I might use GML to disseminate information about a public alert (syntax below is NOT CAP) – I might want to describe an alert with an impact area for the alert.

1
2
3
4
5
6
7
8
9
10
11
    <Alert id="a100">
      <dateReleased>10-Jan-2007</dateReleased>
      <type>ice storm</type>
      <impactArea>
        <gml:Polygon>
          <gml:exterior>
            <gml:LinearRing>….</gml:LinearRing>
          </gml:exterior>
        </gml:Polygon>
      </impactArea>
    </Alert>

again – ONLY the stuff with the gml prefix is in the GML namespace and the rest need NOT be a formal GML application schema.

Why then would I want this to appear in a GML application schema? Well to begin with it means I can use GML aware software – and not create new software to process an exploding set of XML grammars. Additionally I know that I can use certain features of GML that are useful like remote property references. The web feed example if it was in GML (not just the geometry part) could also be written:

subscribe to the more formal grammar of GML (object-property-value) throughout their own grammar. Some examples might include the embedding of GML in RSS, Atom, CAP and otrher XML grammars that have a limited requirement for geographic information – but which wish to define a "property" that has some geometric extent.

For example – I might wish to associate a news story with a location. I might write (this is not RSS per se)

1
2
3
4
5
    <NewsStory>
      <author>John Lamb</author>
      <dated>10-Jan-2006</dated>
      <where xlink:href="… "/> this points to the GML geometry Point
</NewsStory>

Similarily the Alert example could become:

1
2
3
4
5
    <Alert id="a100">
      <dateReleased>10-Jan-2007</dateReleased>
      <type>ice storm</type>
      <impactArea xlink:href="… "/> Points to the impact area geometry in GML
</Alert>

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>