[GRASSLIST:9832] GPS Tracklog points to lines (GPS Babel)

I find that often when using GPS tools and v.in.garmin I only have success importing track logs as points. not as lines. When using GPSMan I get lines but all the track logs compressed into one.

This makes vector import, creation and management using GPS in GRASS quite a challenge. The tutorial I am writing up has more to do with cleaning vectors than importing or using GPS data.

I need to change my individual track log points into connected network. There is a script published in mapping hacks of how to do it using a perl script and a few other scripts are posted.

It strikes me as weird that these are not incorporated into GRASS. It also confuses me why GPStrans and v.in.garmin always fails unless you force the import of track logs as points.

I even tried using GPSMan and exporting to GPX. Then using gpx2shp and then covert the shape file to through OGR. However using gpx2shp cuts out 90% of the log because it can't measure using Dec. Deg coords. GPSman only exports the GPX format using Lat/long DD.

The QGIS route again fails at the GPX format conversion. Unless QGIS could export a vector diretcly to GRASS. But that would just mean I should be able to use GRASS.

Sooooo... I am curous to know how work is going on GPSBabel for GRASS. Because it seems like nothing is working and my tutorial looks like a flop for January 19. I'll have to bring in dummy data that I had to pre-process in ArcGIS with the DNRgarmin plugin on a windows platform. Defeats many of the goals of my tutorial.

GPS is a popular means of aquiring data. Giving GRASS a fully supported GPS module will open up its use to more public and make GRASS a viable option for many groups to use.

If someone wants to show me where I am messing up then please include the steps and I will use them for my tutorial. As for scripts, the users in the tutorial are overwhlemed enough with Fedora Core and GRASS, no need to add a script in to confuse them more.

Cheers

On Jan 14, 2006, at 1:54 PM, Dave Sampson wrote:

I find that often when using GPS tools and v.in.garmin I only have success importing track logs as points. not as lines. When using GPSMan I get lines but all the track logs compressed into one.

I, and many others on this list have had similar problems. I think that it has something to do with what your GPS is ouputting, and what gpsman/v.in.garmin is expecting. This may or may not be a bug in v.in.garmin ...? (Hamish.. ?)

In order to get lines from my tracklog, I have been using gpsman from the command like, dumping the result to a text file, and the processing this file with AWK to create a GRASS-compatible ascii formated file. Note that you might have to do some trimming of the output from gpsman, as it adds some extra information at the top of its output.

sample code

gpsman ....... > walk1.raw

awk '
BEGIN{print "VERTI:"; n = 0}

{
vertex = $6" "$7
if( (n > 0 && n < 3) )
{
print "L 2\n"old_vertex"\n"vertex
}
else if(n >2 )
{
print "L 2\n"old_vertex"\n"vertex
}

old_vertex = vertex; ;n++
}
' walk1.raw > walk1.ascii

i am then able to import the lines with

v.in.ascii in=walk1.ascii format=standard out=walk1

I know that it is possible to get tracklog _lines_ imported into GRASS via v.in.garmin , but it seemed like that functionality was broken sometime in the last 7 months or so.
--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

Hi,

I am the author of (the modern) v.in.garmin. It all "works fine for me".

I don't know why it isn't working for you, can you run gpstrans by
itself and send me the -dt track file so I can test your data?

And a copy of what is written to the console (use -v verbose mode) when
you attempt to load a track?

Are you using the *very* latest CVS version of the script?
  http://freegis.org/cgi-bin/viewcvs.cgi/grass6/scripts/v.in.garmin/

Which model garmin? 1/2 inch round connector to serial or new smaller
usb cable?

No promises by the 19th, but I will be doing some testing with this (and
v.in.gpsbabel) in the next week or so before heading back out into
the field. I hope Davide Spano and Claudio Porta's v.in.gpsbabel will
provide a Mac solution too. (not sure if gpstrans works on Mac?)

v.in.gpsbabel (rename it v.in.gps?) was posted by its authors to
the "grass5" (grass developer's) mailing list yesterday or so. forwarding
it to you. If all goes well it will be in CVS soon.

gpstrans + USB has always been reported non-functional in the past,
interesting to hear of (some) success. gpstrans is old & not maintained,
but has always worked for older garmins over a serial connection AFAIK.

Dylan wrote:

I, and many others on this list have had similar problems.

..

I know that it is possible to get tracklog _lines_ imported into GRASS

via v.in.garmin , but it seemed like that functionality was broken
sometime in the last 7 months or so.

I wasn't aware the problems were that widespread. Could be I am using a
Debian awk extension that isn't standard across distros??

My recent work has been logging 10 sec positions directly with a custom
gpsd client in situ instead of downloading tracks afterwards, so I
haven't tried in a few months. Will post my findings.

FWIW, my versions of v.in.garmin were tested with a garmin 48, 45, and
12XL (all pretty much the same unit).

Hamish

Hamish,

1. I'll try to grab the GPS trans stuff in a bit, on other OS.
2. I used what was in grass6.0 and 6.0.1 and then downloaded a CVS version from a mailing archived in the list May 2005. All gave the same results
3. Garmin ETREX Vista
4. I wasn't looking for a promise. I should have tested it a long time ago before I started preparing the tutorial. But I assumed it work. My bad.
5. You need a field assistant that knows GRASS (apart from the GPS interface apparently)? I'm for hire and have wheels.
6. Thanks for the forward. I will test it out.
7. GPS is native rs232 but I have had the same successes and challenges through a Prolific serial2usb convertor ("iconcepts" pl232). Laptop has no serial.
8. Another GRASS head (Scott Mitchell) was helping out with troubleshooting and some thoughts on changes to how GRASS imports ASCII came up when the ASCII module started screaming. This would happen when we did not force conversion to points.
9. The same problem existed in the lab (Fedora core) and my home machine (Gentoo). I've seen reference to awk scripts to change points to lines, but alwasy looked hack and slash (mainly cause I don't know awk).
10. if this lab goes well we might play with some insitu stuff. I want to try the GRASS moduyle for Palm Pilot that can do GPS stuff. Let me know if your gpsd becomes part of grass.
11. I'm using Garmin Etrex Vista. I imagine the garmin protocol has not changed. I am looking to enslave a Garmin RINO with a home made cable to do some post processing corrections. perhaps your GPSD might be useful.

thanks for looking into this

Hi,

I am the author of (the modern) v.in.garmin. It all "works fine for me".

I don't know why it isn't working for you, can you run gpstrans by
itself and send me the -dt track file so I can test your data?

And a copy of what is written to the console (use -v verbose mode) when
you attempt to load a track?

Are you using the *very* latest CVS version of the script?
http://freegis.org/cgi-bin/viewcvs.cgi/grass6/scripts/v.in.garmin/

Which model garmin? 1/2 inch round connector to serial or new smaller usb cable?

No promises by the 19th, but I will be doing some testing with this (and
v.in.gpsbabel) in the next week or so before heading back out into
the field. I hope Davide Spano and Claudio Porta's v.in.gpsbabel will
provide a Mac solution too. (not sure if gpstrans works on Mac?)

v.in.gpsbabel (rename it v.in.gps?) was posted by its authors to the "grass5" (grass developer's) mailing list yesterday or so. forwarding it to you. If all goes well it will be in CVS soon.

gpstrans + USB has always been reported non-functional in the past,
interesting to hear of (some) success. gpstrans is old & not maintained,
but has always worked for older garmins over a serial connection AFAIK.

Dylan wrote:

I, and many others on this list have had similar problems.
   

..

I know that it is possible to get tracklog _lines_ imported into GRASS

via v.in.garmin , but it seemed like that functionality was broken sometime in the last 7 months or so.
   
I wasn't aware the problems were that widespread. Could be I am using a Debian awk extension that isn't standard across distros??

My recent work has been logging 10 sec positions directly with a custom gpsd client in situ instead of downloading tracks afterwards, so I
haven't tried in a few months. Will post my findings.

FWIW, my versions of v.in.garmin were tested with a garmin 48, 45, and
12XL (all pretty much the same unit).

Hamish

re. v.in.garmin loading track-as-point but not track-as-line

Dave:

2. I used what was in grass6.0 and 6.0.1 and then downloaded a CVS
version from a mailing archived in the list May 2005. All gave the
same results

Please get the lastest 6.1 CVS snapshot version and try with it. There
have been 9 revisions to the module since last May. Here is the link to
it from online CVS interface:
http://freegis.org/cgi-bin/viewcvs.cgi/*checkout*/grass6/scripts/v.in.garmin/v.in.garmin?rev=HEAD&content-type=text/plain

Dylan:

>> I, and many others on this list have had similar problems.
>>
>> I know that it is possible to get tracklog _lines_ imported into
>> GRASS via v.in.garmin , but it seemed like that functionality was
>> broken sometime in the last 7 months or so.

me:

> I wasn't aware the problems were that widespread. Could be I am
> using a Debian awk extension that isn't standard across distros??

I have now tested the latest CVS version on Debian/stable (sarge) and
Redhat 9. It works fine for me on both.

Dave:

5. You need a field assistant that knows GRASS (apart from the
GPS interface apparently)? I'm for hire and have wheels.

You'd need wings or gills... I'm in the south pacific. :slight_smile:

7. GPS is native rs232 but I have had the same successes and
challenges through a Prolific serial2usb convertor ("iconcepts"
pl232). Laptop has no serial.

gpstrans is known to have problems over USB. But as you've been able to
get point data through, gpstrans is most likely working for you and the
problem is possibly in the awk or cs2cs processing steps?

8. Another GRASS head (Scott Mitchell) was helping out with
troubleshooting and some thoughts on changes to how GRASS imports
ASCII came up when the ASCII module started screaming. This would
happen when we did not force conversion to points.

Need to see the exact error messages to diagnose. But update to the
latest CVS version first.

9. The same problem existed in the lab (Fedora core) and my home
machine (Gentoo).

Again, v.in.garmin works fine for me when I test it on Debian/sarge &
Redhat 9. So maybe the trouble lies elsewhere.

does this work?

gpstrans -p/dev/gps -i

I've seen reference to awk scripts to change points to lines, but
alwasy looked hack and slash (mainly cause I don't know awk).

Ascii import as a line with 'v.in.ascii -n format=standard' is fairly
simple, only annoying bit is you need to calculate how many vertices in
each line before you present the data.

hint: steal the awk commands from the v.in.garmin script.

10. if this lab goes well we might play with some insitu stuff.

..

Let me know if your gpsd becomes part of grass.

No, my client for gpsd is just a datalogging routine, not much to do
with a GIS. If you want one, I recommend the gpxlogger program that
comes with gpsd 2.30.
  http://gpsd.berlios.de/

I had written a m.realtime_gps module using gpsd to do real time GPS
plotting into GRASS 5, but the display driver really isn't made for that
sort of thing. I have mostly abandoned it in favour of gpsdrive with
backdrop maps created with the GRASS 6.1cvs d.out.gpsdrive module.
  http://www.gpsdrive.cc/
  http://grass.ibiblio.org/grass61/manuals/html61_user/d.out.gpsdrive.html

11. I'm using Garmin Etrex Vista. I imagine the garmin protocol has
not changed.

Someone here has an etrex, I'll try and get hold of it to test. I have
no idea what garmin has done or not done to their protocol. You can
test it in linux using the gpsman or gpsbabel Garmin interface.

I am looking to enslave a Garmin RINO with a home made cable to do
some post processing corrections. perhaps your GPSD might be useful.

Gpsd isn't mine, I just wrote a simple client for it. See above link.
It's nice.

me:

> can you run gpstrans by itself and send me the -dt track file so I
> can test your data?

?

>And a copy of what is written to the console (use -v verbose mode)
>when you attempt to load a track?

?

Hamish