Question

What I have: a .gpx file which contains a series of waypoints, built via methods outlined here: Simulating Locations with Xcode.

What I want to do: A) Have Xcode simulate movement along a path outlined by the waypoints. B) change the rate at which those waypoints are ingested by Xcode (ie. simulate travel velocity).

Step A is working wonderfully, but I have not found any information on how to achieve step B.

Sample from .gpx file:

    <?xml version="1.0" encoding="UTF-8"?>
    <gpx
      version="1.0"
      creator="GPSBabel - http://www.gpsbabel.org"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns="http://www.topografix.com/GPX/1/0"
      xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
    <time>2014-02-01T14:06:32Z</time>
    <bounds minlat="38.879180000" minlon="-77.978110000" maxlat="38.889860000" maxlon="-77.023940000"/>
    <wpt lat="38.889860000" lon="-77.023940000">
      <ele>0.000000</ele>
      <name>X</name>
      <cmt>X</cmt>
      <desc>X</desc>
    </wpt>
    <wpt lat="38.889740000" lon="-77.023930000">
      <ele>0.000000</ele>
    </wpt>
    <wpt lat="38.889620000" lon="-77.023900000">
      <ele>0.000000</ele>
    </wpt>
    <wpt lat="38.889520000" lon="-77.023870000">
      <ele>0.000000</ele>
    </wpt>
    <wpt lat="38.889430000" lon="-77.023840000">
      <ele>0.000000</ele>
    </wpt>
    <wpt lat="38.889426700" lon="-77.023838900">
      <ele>0.000000</ele>
      <name>National Mall, Washington, DC</name>
      <cmt>9th Street Expressway, Washington, DC 20565, USA</cmt>
      <desc>9th Street Expressway, Washington, DC 20565, USA</desc>
    </wpt>
    <trk>
      <name>Directions from X to National Mall, Washington, DC</name>
    <trkseg>

    </trkseg>
    </trk>
    </gpx>

Was it helpful?

Solution 2

Currently no support for this in xcode.

OTHER TIPS

I'm running Xcode 7.1 and when using custom GPX files, I have noticed that the simulator does play them back including timing (if present) in the GPX file. You can also vary the time between points to "simulate travel velocity". However, what Apple appears to be doing under the hood is interpolating your data and providing GPS updates every second. Since it is interpolating the GPX wpt, it does not use the speed, course, or accuracy from the GPX wpt tags. I always see accuracy of 5 meters, -1 speed, -1 course and the time is used for how to interpolate between waypoints. The actual time reported is of course the current time for each reading. Once the last waypoint is reach is goes immediately back to the first waypoint.

Here's an example file with variable time between waypoints. You can play it using the simulator and watch the Apple Maps app to see it play out.

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="bikehike.co.uk" version="1.1" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<wpt lat="33.102265" lon="-96.788330">
  <ele>13</ele>
  <time>2013-12-02T12:00:10Z</time>
  <name>pt0</name>
</wpt>
<wpt lat="33.103990" lon="-96.787085">
  <ele>13</ele>
  <time>2013-12-02T12:01:20Z</time>
  <name>pt1</name>
</wpt>
<wpt lat="33.105428" lon="-96.784124">
  <ele>13</ele>
  <time>2013-12-02T12:02:30Z</time>
  <name>pt2</name>
</wpt>
<wpt lat="33.106860" lon="-96.780312">
  <ele>13</ele>
  <time>2013-12-02T12:02:40Z</time>
  <name>pt3</name>
</wpt>
<wpt lat="33.108401" lon="-96.776281">
  <ele>13</ele>
  <time>2013-12-02T12:02:50Z</time>
  <name>pt4</name>
</wpt>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top