W3C home > Mailing lists > Public > www-svg@w3.org > August 2005

Re: GPS Coordinates in Tiny SVG

From: bz <bz@datenkueche.com>
Date: Wed, 31 Aug 2005 17:14:30 +0200
Message-ID: <4315C956.9080301@datenkueche.com>
To: www-svg@w3.org


Here is an update for "Enable to use of GPS Coordinates in SVG":

    long,lat, height above See Level, time of measurement,
   Status of Satelite Connection

       There are some events a GPS modul COULD send to SVG:

Simple Event Model:
      If the GPS modul receives a signal and calculates position, the 
Event "onGPSsignal" will be fired.
      If the GPS modul does not receive a proper signal, there is NO 
Event (no error event).
      SVG may loose focus, the onSVGSignal event  is still important for 
drawing traces.

Pointer Device  vs. GPS Device
       GPS can loose connection to satelite
       GPS fires onGPSsignal in variable time interval. If the GPS modul 
does not move, the coordinates maybe will not change - but the 
"onGPSsignal" Event fires. (100% CPU for redraw?)

Not covered:
      How often the GPS modul fires the event "onGPSstatus" is not defined
      Privacy Protection
     The Term "GPS" is not good if Gallileo Signal is received

This is my conclusion:

<item title="to be done in SVG or DOM or XML Events or Salzamt">

         evt.gpsLong  (signed dezimal; eample: "-56.234433")
         evt.gpsLat (signed dezimal; example: "23.3433")
         evt.gpsHeight (in meter above elipsoid; example "2145.5" (no unit))
         evt.gpsTime (GMT, timeformat ?????)

        EVENT: onGPSsignal  

(maybe not so important: precision, number of satelites)
Privacy Protection:
    There must be a mechanism to prevent giving GPS location to SVG if 
the User don't want (similar to cookie).
    If this could be turned on/off using javascript it would be useless 
-> not in the scope.
    If GPS data are available they will be used as parameter for 
Client/Server communication.
    There is no mechanism to use GPS Data in ClientSide scripting and 
protect privacy at the same time.
Done by Javascript (or other languages):
    o other units like feed
    o speed, direction
    o convert to other Coordinate Systems (enjoy the WGS-84 calculation)
    o statuscheck


Here an example how to use GPS in SVG - this is not real ecmaScript - it 
will not work without changes!!!

<svg onGPSsignal="redrawMap(evt);|setInterval("checkstatus","1000")|" 
xmlns="http://www.w3.org/2000/svg" version"=1.2 Tiny">
SVG Map that follows GPS coordinates
description: The center of the map is the GPS position. If GPS 
coordinates change the map will move and a trace is drawn
author: Bernhard Zwischenbrugger
copyright: Public Domain //copy, sell, destroy - do what you want with this
this is pseudo code (not real javascript / not runable)
<script type="text/javascript">
var lastupdate=null;  

function redrawMap(evt){
       //onGPSsignal fires only if there is a connection to satelites
       lastupdate = evt.gpsTime;
*-1+","+evt.gpsLat *-1+")";
function checkstatus(){
       //pseudo code -  time format not clear -> calculation not possible
       var now=new Date();
       if((now - lastupdate) > 10 min){
             alert("signal lost");
function drawPath(evt){
      var path=svgDocument.getElementById('trace');
      var points=path.getAttribute('d');
      points=points.concat(" l "+evt.long+" "+evt.lat);
       <!-- center is  0,0 -->
       <circle r="20" fill="none" stroke="black"/>

    <!-- move to gps coordinates (redrawMap)-->
    <g id="movinger">

        <!-- scale your view -->
       <g translate="scale(5600)" id="scalinger">

             <!-- satelite image - have google map in mind -->
              <image x="-43.2342342" y="23.2342344" width="0.00100" 
height="0.00100" xlink:href="http://kh.google.com/kh?v=3&t=trtqttt"/>

             <!-- now the Metadata -->
              <circle id="new york" x="-43.2323423" y="23.223423" 
r="0.0000100" fill="none" stroke="red"/>
              <circle id="vienna" x="-43.2333423" y="23.225423" 
r="0.0000100" fill="none" stroke="red"/>
             <path id="trace"/>



GPS Communication format:

In German:

Version: 2
Version: 3

GPS Trace in XML Format:

thanks for reading

Bernhard Zwischenbrugger
Received on Wednesday, 31 August 2005 15:15:13 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:29:28 UTC