GPS: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
No edit summary
mNo edit summary
 
(One intermediate revision by one other user not shown)
Line 30: Line 30:
: - before plugging, load the drivers so that the device can be connected:<pre>sudo modprobe garmin_gps</pre>
: - before plugging, load the drivers so that the device can be connected:<pre>sudo modprobe garmin_gps</pre>
: - then plug your Garmin GPS-device to your computer
: - then plug your Garmin GPS-device to your computer
: - to import waypoints into GRASS, do the following (assuming that your GPS is mounted to /dev/ttyUSB0): <pre>v.in.gpsbabel -w input=/dev/ttyUSB0 format=garmin output=waypoints</pre>
: - import waypoints into GRASS (assuming that your GPS is mounted to /dev/ttyUSB0): <pre>v.in.gpsbabel -w input=/dev/ttyUSB0 format=garmin output=waypoints</pre>
: - export a point vector as waypoints to your GPS: <pre>v.out.gpsbabel -w input=villages format=garmin output=/dev/ttyUSB0</pre>
: - export a point vector as waypoints to your GPS: <pre>v.out.gpsbabel -w input=villages format=garmin output=/dev/ttyUSB0</pre>


Line 40: Line 40:


[[Category: Documentation]]
[[Category: Documentation]]
[[Category: Import]]

Latest revision as of 15:03, 20 December 2012

GPS applications with GRASS

Tools

Import

  • v.in.gpsbabel: allows the user to import waypoint, route and track data from a locally connected GPS receiver or a text file containing GPS data of many common formats.
- calls the GPS Babel software
  • v.in.garmin: allows the user to import from a Garmin device
- gardump from the garmin-utils package
- gpstrans software
  • v.in.ascii: allows the user to import generic points, lines or polygons from an ASCII file. Using v.in.ascii combined with gpsbabel, it's possible to import attribute columns from GPS units, that might otherwise get "lost" when using v.in.garmin. Here's a oneliner to pull waypoints from a usb connected GPS straight into a GRASS vector points map:
gpsbabel -w -i garmin -o unicsv -f USB: -F - | v.in.ascii out=gps_points fs=, column="num integer, y_coord double, x_coord double, elev double, date_str varchar(16), time_str varchar(16)" x=3 y=2 skip=1  

The gpsbabel output format "unicsv" creates a comma-separated-value table of all attributes from the GPS. The output is piped straight into the v.in.ascii command. The parameter "fs=," sets the field separator for the csv GPS output. Then the "column=..." parameter must be setup in the same format as the GPS output table. If the output isn't known, (or if you just want to save a text file of the gps data) then run gpsbabel saving the output to a file i.e. "-F points.txt" then examine the file to find the attribute columns. Finally, use the v.in.ascii "x=" and "y=" to set the correct column number for X and Y coordinates. Note that the GPS output is often in the "geographic" Lat-Lon order, which means Y first, then X. So be sure to choose the right column numbers for X (longitude) and Y (latitude).

Export

  • v.out.gpsbabel: allows the user to export waypoints, route and track data to a locally connected GPS receiver.
- calls the GPS Babel software

Tasks

- first of all, be sure that your device interface is setup to serial garmin mode; for this, on your device go to >Menu > Setup > Interface
- before plugging, load the drivers so that the device can be connected:
sudo modprobe garmin_gps
- then plug your Garmin GPS-device to your computer
- import waypoints into GRASS (assuming that your GPS is mounted to /dev/ttyUSB0):
v.in.gpsbabel -w input=/dev/ttyUSB0 format=garmin output=waypoints
- export a point vector as waypoints to your GPS:
v.out.gpsbabel -w input=villages format=garmin output=/dev/ttyUSB0

Links

- see also the d.out.gpsdrive module