]> git.street.me.uk Git - andy/viking.git/commitdiff
[DOC] Explain datasources.xml usage.
authorRob Norris <rw_norris@hotmail.com>
Sun, 3 Mar 2013 10:57:23 +0000 (10:57 +0000)
committerRob Norris <rw_norris@hotmail.com>
Thu, 2 May 2013 23:46:17 +0000 (00:46 +0100)
Add an example datasources.xml file.

doc/examples/Makefile.am
doc/examples/datasources.xml [new file with mode: 0644]
doc/viking.xml
help/C/viking.xml

index eede2156f023232dabad30d8ccf392baef9e815b..e3db0d62d1d48de7b4cc768b580308d3b8d0ddf6 100644 (file)
@@ -1 +1 @@
-EXTRA_DIST = maps.xml external_tools.xml goto_tools.xml
+EXTRA_DIST = maps.xml external_tools.xml goto_tools.xml datasources.xml
diff --git a/doc/examples/datasources.xml b/doc/examples/datasources.xml
new file mode 100644 (file)
index 0000000..4a5d727
--- /dev/null
@@ -0,0 +1,33 @@
+<objects>
+  <!-- NB In built, but this is the equivalent -->
+  <object class="VikWebtoolDatasource">
+    <property name="label">OpenStreetBugs</property>
+    <property name="url_format_code">LRBT</property>
+    <!-- format_code describes the order and what each of the substitution values are in the URL -->
+    <!-- B = Bottom of the current view  i.e. minimum latitude -->
+    <!-- L = Left of the current view  i.e. minimum longitude -->
+    <!-- T = Top of the current view  i.e. maximum latitude -->
+    <!-- R = Right of the current view i.e. maximum longitude -->
+    <!-- A = center lAtitude of the current view -->
+    <!-- O = center lOngitude of the current view -->
+    <!-- Z = OSM Zoom value of the current view (http://wiki.openstreetmap.org/wiki/Zoom_levels) -->
+    <property name="file_type"></property>
+    <!-- A non defined or empty value (as above) means use internal GPX processing -->
+    <!--  otherwise the value is used in calling gpsbabel with the '-i' parameter to identify the file format e.g. gpx or kml -->
+    <!-- See http://www.gpsbabel.org/capabilities.html for the full range of file types. The value is case sensitive. -->
+    <property name="url">http://openstreetbugs.schokokeks.org/api/0.1/getGPX?l=%s&amp;r=%s&amp;b=%s&amp;t=%s&amp;open=only_open_bugs</property>
+  </object>
+  <object class="VikWebtoolDatasource">
+    <property name="label">PostBoxes</property>
+    <property name="url_format_code">AO</property>
+    <!-- file_type not set, so uses internal GPX handler -->
+    <property name="url">robert.mathmos.net/osm/postboxes/2/mapdata.cgi?lat=%s&amp;lon=%s&amp;output=gpx</property>
+    <!-- URL doesn't have to have the starting 'http://' -->
+  </object>
+  <object class="VikWebtoolDatasource">
+    <property name="label">OpenPlaques</property>
+    <property name="url_format_code">TLBR</property>
+    <property name="url">http://openplaques.org/plaques.kml?box=[%s,%s],[%s,%s]</property>
+    <property name="file_type">kml</property>
+  </object>
+</objects>
index d3bdd5cb15d0d0940b913aef25be24b58d909653..dd845a89f7b1cd5e5e1761ddb8968d766aaffec9 100644 (file)
@@ -64,7 +64,7 @@ and docbook-xsl in your Build-Depends control field.
       <holder>Guilhem Bonnefille</holder>
     </copyright>
     <copyright>
-      <year>2012</year>
+      <year>2013</year>
       <holder>Rob Norris</holder>
     </copyright>
     &dhdate;
@@ -308,14 +308,57 @@ and docbook-xsl in your Build-Depends control field.
         <para>The related properties are:
           <variablelist>
             <varlistentry>
+              <term>label</term>
+              <listitem><para>the text displayed in the menu entry</para></listitem>
             </varlistentry>
+            <varlistentry>
+              <term>url</term>
+              <listitem><para>the parametrized address of the tile, in the spirit of C printf format, with 4 "%s" fields for left, right, bottom and top (eg. "http://hostname:8111/load_and_zoom?left=%s&amp;right=%s&amp;bottom=%s&amp;top=%s")</para></listitem>
+            </varlistentry>
+          </variablelist>
+        </para>
+      </formalpara>
+
+      <formalpara>
+        <title>Remote File Datasources</title>
+        <para>It is possible to add web references expected to return a file which can then be opened directly or converted via GPSBabel.</para>
+        <para>The file is <filename>~/.viking/datasources.xml</filename>.</para>
+        <para>An example of the file is in the source distribution <filename>doc/examples/datasources.xml</filename>.</para>
+        <para>The VikWebtoolDatasource allows to declare any URL using logic based on coordinates.</para>
+        <para>The related properties are:
+          <variablelist>
             <varlistentry>
               <term>label</term>
               <listitem><para>the text displayed in the menu entry</para></listitem>
             </varlistentry>
             <varlistentry>
               <term>url</term>
-              <listitem><para>the parametrized address of the tile, in the spirit of C printf format, with 4 "%s" fields for left, right, bottom and top (eg. "http://hostname:8111/load_and_zoom?left=%s&amp;right=%s&amp;bottom=%s&amp;top=%s")</para></listitem>
+              <listitem>
+                <para>the parametrized URL to open in the spirit of C printf format, with up to 7 "%s" values. e.g. <literal>http://hostname/getfile?lat=%s&amp;lon=%s</literal></para>
+                <para>The order and meaning of these parameters is given by the url_format_code below</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>url_format_code</term>
+              <listitem>
+                <para>A string describing the parametrized URL substitution parameters, each character represents how to translate each term.</para>
+                <para>B = Bottom of the current view i.e. minimum latitude</para>
+                <para>L = Left of the current view i.e. minimum longitude</para>
+                <para>T = Top of the current view i.e. maximum latitude</para>
+                <para>R = Right of the current view i.e. maximum longitude</para>
+                <para>A = center lAtitude of the current view</para>
+                <para>O = center lOngitude of the current view</para>
+                <para>Z = OSM Zoom value of the current view. See <ulink url="http://wiki.openstreetmap.org/wiki/Zoom_levels">Zoom Levels</ulink></para>
+                <para>Thus for the url example above then the format code should be <emphasis>AO</emphasis></para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>file_type</term>
+              <listitem>
+                <para>This value is passed on for the -i parameter in interfacing with GPSBabel.</para>
+                <para>If it is not defined then the returned file is interpreted internally as a GPX file.</para>
+                <para>Possible values such as 'kml', 'mapsource' etc.. can be used. See <ulink url="http://www.gpsbabel.org/capabilities.html">GPSBabel File Formats</ulink> for the full list.</para>
+              </listitem>
             </varlistentry>
           </variablelist>
         </para>
@@ -347,6 +390,13 @@ and docbook-xsl in your Build-Depends control field.
           <para>See previous section for details.</para>
        </listitem>
       </varlistentry>
+      <varlistentry>
+        <term><filename>~/.viking/datasources.xml</filename></term>
+        <listitem>
+          <para>File containing definition of remote file datasources.</para>
+          <para>See previous section for details.</para>
+       </listitem>
+      </varlistentry>
       <varlistentry>
         <term><filename>~/.viking/viking.prefs</filename></term>
         <listitem>
@@ -375,6 +425,7 @@ and docbook-xsl in your Build-Depends control field.
 
        <para>Extension files (<filename>maps.xml</filename>,
        <filename>goto_tools.xml</filename>,
+       <filename>datasources.xml</filename>,
        <filename>external_tools.xml</filename>)
        are also searched in <filename>/etc/viking</filename> and
        <filename>/usr/share/viking</filename> directories (or related in your system).</para>
index 1357c925805f4516523909725dbd0572143a6090..2aa1d871560d8bd86f82988609a8e30f5d206786 100644 (file)
@@ -2410,11 +2410,56 @@ Accept: */*
         </para>
       </section>
       
+      <section>
+        <title>Remote File Datasources</title>
+        <para>It is possible to add web references expected to return a file which can then be opened directly or converted via GPSBabel.</para>
+        <para>The file is <filename>~/.viking/datasources.xml</filename>.</para>
+        <para>An example of the file is in the source distribution <filename>doc/examples/datasources.xml</filename>.</para>
+        <para>The VikWebtoolDatasource allows to declare any URL using logic based on coordinates.</para>
+        <para>The related properties are:
+          <variablelist>
+            <varlistentry>
+              <term>label</term>
+              <listitem><para>the text displayed in the menu entry</para></listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>url</term>
+              <listitem>
+                <para>the parametrized URL to open in the spirit of C printf format, with up to 7 "%s" values. e.g. <literal>http://hostname/getfile?lat=%s&amp;lon=%s</literal></para>
+                <para>The order and meaning of these parameters is given by the url_format_code below</para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>url_format_code</term>
+              <listitem>
+                <para>A string describing the parametrized URL substitution parameters, each character represents how to translate each term.</para>
+                <para>B = Bottom of the current view i.e. minimum latitude</para>
+                <para>L = Left of the current view i.e. minimum longitude</para>
+                <para>T = Top of the current view i.e. maximum latitude</para>
+                <para>R = Right of the current view i.e. maximum longitude</para>
+                <para>A = center lAtitude of the current view</para>
+                <para>O = center lOngitude of the current view</para>
+                <para>Z = OSM Zoom value of the current view. See <ulink url="http://wiki.openstreetmap.org/wiki/Zoom_levels">Zoom Levels</ulink></para>
+                <para>Thus for the url example above then the format code should be <emphasis>AO</emphasis></para>
+              </listitem>
+            </varlistentry>
+            <varlistentry>
+              <term>file_type</term>
+              <listitem>
+                <para>This value is passed on for the -i parameter in interfacing with GPSBabel.</para>
+                <para>If it is not defined then the returned file is interpreted internally as a GPX file.</para>
+                <para>Possible values such as 'kml', 'mapsource' etc.. can be used. See <ulink ref="http://www.gpsbabel.org/capabilities.html">GPSBabel File Formats</ulink> for the full list.</para>
+              </listitem>
+            </varlistentry>
+          </variablelist>
+        </para>
+      </section>
+
       <section>
         <title>More</title>
-        <para>Note that, on <trademark>UNIX</trademark> like systems, the extension files (<filename>maps.xml</filename>, <filename>goto_tools.xml</filename>, <filename>external_tools.xml</filename>) are also searched in <filename>/etc/viking</filename> and <filename>/usr/share/viking</filename> directories (or related in your system).</para>
+        <para>Note that, on <trademark>UNIX</trademark> like systems, the extension files (<filename>maps.xml</filename>, <filename>goto_tools.xml</filename>, <filename>external_tools.xml</filename>, <filename>datasources.xml</filename>) are also searched in <filename>/etc/viking</filename> and <filename>/usr/share/viking</filename> directories (or related in your system).</para>
         <para>The <envar>XDG_DATA_DIRS</envar> environment variable can be used to change these directories.</para>
-        <para>The <envar>XDG_DATA_HOME</envar> environment variable s also used (if set) to look for these extension files.</para>
+        <para>The <envar>XDG_DATA_HOME</envar> environment variable is also used (if set) to look for these extension files.</para>
       </section>
 
 </section>