tl;dr:

Adding geotagging capabilities to DokuWiki using a custom syntax plugin.

DokuWikiSpatial: geotagging for your wiki

Geotagging

After adding mapping capabilities to your wiki using the openlayersmap plugin we will now look into actually creating spatial data as part of your content using geotagging. Geotagging is the process of adding geographic (meta) data to content, in our case wiki pages.

To accomplish this a syntax plugin was developed which allows adding the relevant data to the page. An example of this syntax is shown in the following code snippet.


{{geotag>lat:48.19344, lon:16.46085, placename:VERBUND-Wasserarena,
    country:AT, region:AT-9}}

This syntax is parsed and rendered as part of the page metadata:

...
<meta name="geo.region" content="AT-9"/>
<meta name="geo.placename" content="VERBUND-Wasserarena"/>
<meta name="geo.position" content="48.19344;16.46085"/>
<meta name="geo.country" content="AT"/>
<meta name="ICBM" content="48.19344, 16.46085"/>
<meta name="geo.geohash" content="u2ednt67js"/>
<meta name="DC.title" content="nieuwe Wildwaterbaan Donau Insel, Wenen"/>
...

This metadata is also stored in the wiki’s metadata system so that it can be indexed and searched. When using a plugin such as socialcards the appropriate OpenGraph elements are also exported in the page headers.

The geotag is rendered as part of the page content/body in the form of a geo microformat and a schema.org Place. This allows indexing of the page location by search engines such as Yandex, Bing and Google.

...
<span class="geotagPrint">Geotag (locatie) voor: </span>
<div class="geo" title="Geotag (locatie) voor VERBUND-Wasserarena"
    itemscope itemtype="http://schema.org/Place">
  <span itemprop="name">VERBUND-Wasserarena</span>:&nbsp;<a
     href="wildwaterbaan_donau_insel_wenen?do=findnearby&amp;lat=48.19344&amp;lon=16.46085"
     title="Zoek in de buurt van VERBUND-Wasserarena">
  <span itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates">
  <span class="latitude" itemprop="latitude" content="48.19344">48º11'36.384"N</span>;
  <span class="longitude" itemprop="longitude" content="16.46085">16º27'39.06"E</span>
  <span class="a11y">Zoek in de buurt van VERBUND-Wasserarena</span></a></span>
</div>
...

Which looks something like the figure below in the default DokuWiki layout.

geotag example screen capture
An example of a rendered geotag on a wiki page locating the VERBUND-Wasserarena at 48º11'36.384"N;16º27'39.06"E.

Using the geotags on your pages opens up other ways of exploring and viewing your pages. One example is using the content in an augmented reality application such as Mixare. Another is finding pages that are located nearby to the current page or using a map as a browsing interface for exploration of yout wiki.

Read more posts in this series on:

Talk about this on twitter.

If you've published a reaction to this blog, let me know the url by twitter or mail and I will add your link here.

Tweets van @GeoDiensten