Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

share|improve this question
    
What GPS unit are you using, what data source are you using for the polyline? Was it a GPS output? –  lewis Feb 10 '13 at 16:00
    
I'm Using Garmin GPS map62S. Data source of polyline is polygon(I converted on QGIS). –  Jermain Marthin Feb 11 '13 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 '13 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:

</gpx>

Hope this helps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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