2

I use Cycle.travel to draw cycling routes. However, the Android application I use on my smartphone only supports KML.

As an alternative to GPSVisualizer, I tried the command-line utility GPSBabel, but, besides turning a compact 5K GPX into a much bigger 80K KML, the route is displayed as a long series of waypoints instead of a simple line:

enter image description here

Does someone know of an alternative command-line utility to GPSBabel?

Here's a sample from the source GPX file and the KML generated by GPSBabel:

GPX

<trk>
<name>ACTIVE LOG</name>
<trkseg>
<trkpt lat="48.81569" lon="2.31610" />
<trkpt lat="48.81579" lon="2.31590" />
…
<trkpt lat="48.75456" lon="2.18915" />
<trkpt lat="48.75510" lon="2.18814" />
</trkseg>
</trk>

KML from GpsBabel

…
    <LookAt>
      <longitude>2.252120</longitude>
      <latitude>48.785320</latitude>
      <range>15131.199708</range>
    </LookAt>
    <!-- Normal track style -->
    <Style id="track_n">
      <IconStyle>
        <scale>.5</scale>
        <Icon>
          <href>http://earth.google.com/images/kml-icons/track-directional/track-none.png</href>
        </Icon>
      </IconStyle>
      <LabelStyle>
        <scale>0</scale>
      </LabelStyle>
    </Style>
…
…
<![CDATA[<table>
<tr><td><b>Distance</b> 9.8 mi </td></tr>
</table>]]>
</description>
        <Folder>
          <name>Points</name>
          <Placemark>
            <name>ACTIVE LOG-0</name>
            <snippet/>
            <description><![CDATA[
<table>
<tr><td>Longitude: 2.316100 </td></tr>
<tr><td>Latitude: 48.815690 </td></tr>
<tr><td>Heading: 2.0 </td></tr>
</table>
…
        <Placemark>
          <name>Path</name>
          <styleUrl>#lineStyle</styleUrl>
          <LineString>
            <tessellate>1</tessellate>
            <coordinates>
2.316100,48.815690
2.315900,48.815790
…
2.189150,48.754560
2.188140,48.755100
</coordinates>
          </LineString>
        </Placemark>
      </Folder>
    </Folder>
  </Document>
</kml>
  • 1
    I use this site gpx2kml.com for conversion of this kind of data. It works very well. – Michael B Jul 13 '15 at 14:42
  • Thanks, but I'm looking for a command-line utility. GPSVisualizer is another web-based solution that works well. – Gulbahar Jul 13 '15 at 15:11
  • Right, that is why I posted as a comment instead of answer, I have added your question as a favorite, because I would also be interested in learning about a cmd line utility for this purpose. – Michael B Jul 13 '15 at 15:17
  • 1
    You're probably looking for ogr2ogr. See the duplicate Windows script/application to convert GPX to KML? (this question is phrased better, the answers over there are applicable). – matt wilkie Jul 15 '15 at 4:04
  • 1
    Thanks for the pointer. GPSBabel works ok, but requires the following switch before creating the KML output: -o kml,points=0 – Gulbahar Jul 16 '15 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.