I would like to see polyline on GPS. First, I try to convert polyline to GPX. I uploaded GPX on GPS. SO far, I could not see the line on GPS.

First of all,is it possible to see polyline as route or track data on GPS?

  • What GPS unit are you using, what data source are you using for the polyline? Was it a GPS output?
    – lewis
    Feb 10, 2013 at 16:00
  • I'm Using Garmin GPS map62S. Data source of polyline is polygon(I converted on QGIS). Feb 11, 2013 at 21:58
  • It is possible, I'd check the data format and the help instructions that come with your unit for the relevant steps and see which step is the problem or which format other than gpx might be suitable, you could just reupload the output without a conversion I would think, does you unit support this operation is the only other thing I can think of, most modern gps units with a map display should.
    – lewis
    Feb 12, 2013 at 13:02

1 Answer 1


Just endeded doing what you're asking. I saved on a gpx "generic" file coordinates and I'll set the file up when I'll land where I'm going to go (I'm gonna rent a gps device, so I still don't know what model will be).

When you create a polyline, then you can reach your coordinates using that function:

    var tra;
    dojo.connect(tb, "onDrawEnd", getCoords);
            function getCoords(geo) {
                    // reach every line
                    for ( var path = 0; path < geo.paths.length; path ++ ) {                  
                        // reach every point
                        for ( var pt = 0; pt < geo.paths[path].length; pt++ ) { 
                            tra += '<wpt lat="'+geo.paths[path][pt][0]+'" lon="'+geo.paths[path][pt][1]+'"></wpt>';

Then I send the "tra" var to a php file that saves its content to a gpx file with this header:

<?xml version="1.0"?><gpx version="1.0" 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-01-31T17:38:33Z</time>

Then, before closing the file, write:


Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.