Opened 14 years ago

Closed 13 years ago

#1171 closed enhancement (fixed)

wingrass: include a gpsbabel with XML support

Reported by: hamish Owned by: grass-dev@…
Priority: normal Milestone: 6.4.1
Component: Packaging Version: svn-develbranch6
Keywords: gpsbabel, wingrass Cc:
CPU: x86-64 Platform: MSWindows XP

Description

Hi,

one of the major jobs of v.in.gpsbabel is to import GPX files. (In grass7 this has even become the default import format)

WinGRASS65> v.in.gpsbabel in=foo.gpx format=gpx  
WARNING: No features requested for download. Assuming waypoints.
Loading Waypoints from <foo.gpx>...
GPX: This build excluded GPX support because expat was not installed.
...

is it possible to get a gpsbabel.exe with libexpat XML support?

thanks, Hamish

ps- there is a C:\Program Files\GRASS-65-SVN\gpsbabel dir but it is empty. The version of GPSBabel.exe in extrabin/ is found by "which" in msys despite the mixed-case name. (I think this partition is NTFS, but not sure)

Change History (11)

comment:1 by hamish, 14 years ago

Keywords: wingrass added

in reply to:  description comment:2 by hellik, 14 years ago

Replying to hamish:

Hi,

one of the major jobs of v.in.gpsbabel is to import GPX files. (In grass7 this has even become the default import format)

the gpsbabel-version comes from the osgeo4w-stack which builds the WinGrass-build-environment, so maybe an osgeo4w-ticket there?

ps- there is a C:\Program Files\GRASS-65-SVN\gpsbabel dir but it is empty. The version of GPSBabel.exe in extrabin/ is found by "which" in msys despite the mixed-case name. (I think this partition is NTFS, but not sure)

the idea of C:\Program Files\GRASS-65-SVN\gpsbabel-folder comes from the ancient recipe of Marco Pasetti (http://www.webalice.it/marco.pasetti/grass/BuildFromSource.html) for compiling grass, as at this time gpsbabel was downloaded in an extra way.

IMHO now this folder, dynamically written by the NSIS-installer, can be removed from the NSIS-script.

Helmut

comment:3 by hamish, 14 years ago

see libexpat.dll discussion in:

https://trac.osgeo.org/osgeo4w/ticket/59 https://trac.osgeo.org/osgeo4w/ticket/171

"there is already a copy of that in osgeo4w/bin/"

if so, can we copy it over to GRASS-64-SVN/extralib/ ? or is the error message accurate and it needs to be found at build-time to work?

Hamish

in reply to:  3 ; comment:4 by hellik, 14 years ago

Replying to hamish:

see libexpat.dll discussion in:

https://trac.osgeo.org/osgeo4w/ticket/59 https://trac.osgeo.org/osgeo4w/ticket/171

"there is already a copy of that in osgeo4w/bin/"

if so, can we copy it over to GRASS-64-SVN/extralib/ ? or is the error message accurate and it needs to be found at build-time to work?

Hamish

just a little test:

  • I've re-installed gpsbabel by the osgeo4w-setup/installer
  • gpsbabel.exe lives in c:\osgeo4w/bin with following properties:
C:\wd\mg>gpsbabel --version
GPSBabel Version 1.4.1.  http://www.gpsbabel.org
20.07.2010  20:29           845.824 GPSBabel.exe
GPSBabel Version 1.4.1.  http://www.gpsbabel.org

Usage:
    gpsbabel [options] -i INTYPE -f INFILE [filter] -o OUTTYPE -F OUTFILE
    gpsbabel [options] -i INTYPE -o OUTTYPE INFILE [filter] OUTFILE

    Converts GPS route and waypoint data from one format type to another.
    The input type and filename are specified with the -i INTYPE
    and -f INFILE options. The output type and filename are specified
    with the -o OUTTYPE and -F OUTFILE options.
    If '-' is used for INFILE or OUTFILE, stdin or stdout will be used.

    In the second form of the command, INFILE and OUTFILE are the
    first and second positional (non-option) arguments.

    INTYPE and OUTTYPE must be one of the supported file types and
    may include options valid for that file type.  For example:
      'gpx', 'gpx,snlen=10' and 'ozi,snlen=10,snwhite=1'
    (without the quotes) are all valid file type specifications.

Options:
    -p               Preferences file (gpsbabel.ini)
    -s               Synthesize shortnames
    -r               Process route information
    -t               Process track information
    -T               Process realtime tracking information
    -w               Process waypoint information [default]
    -b               Process command file (batch mode)
    -c               Character set for next operation
    -N               No smart icons on output
    -x filtername    Invoke filter (placed between inputs and output) 
    -D level         Set debug level [0]
    -l               Print GPSBabel builtin character sets and exit
    -h, -?           Print detailed help and exit
    -V               Print GPSBabel version and exit

File Types (-i and -o options):
	gdb                   Garmin MapSource - gdb
	  cat                   Default category on output (1..16) 
	  bitscategory          Bitmap of categories 
	  ver                   Version of gdb file to generate (1..3) 
	  via                   (0/1) Drop route points that do not have an equivalent w 
	  roadbook              (0/1) Include major turn points (with description) from  
	mapsource             Garmin MapSource - mps
	  snlen                 Length of generated shortnames 
	  snwhite               (0/1) Allow whitespace synth. shortnames 
	  mpsverout             Version of mapsource file to generate (3,4,5) 
	  mpsmergeout           (0/1) Merge output with existing file 
	  mpsusedepth           (0/1) Use depth values on output (default is ignore) 
	  mpsuseprox            (0/1) Use proximity values on output (default is ignore) 
	pcx                   Garmin PCX5
	  deficon               Default icon name 
	  cartoexploreur        (0/1) Write tracks compatible with Carto Exploreur 
	garmin                Garmin serial/USB protocol
	  snlen                 Length of generated shortnames 
	  snwhite               (0/1) Allow whitespace synth. shortnames 
	  deficon               Default icon name 
	  get_posn              (0/1) Return current position as a waypoint 
	  power_off             (0/1) Command unit to power itself down 
	  resettime             (0/1) Sync GPS time to computer time 
	  category              Category number to use for written waypoints 
	  bitscategory          Bitmap of categories 
	gtrnctr               Garmin Training Center
	  course                (0/1) Write course rather than history, default yes 
	  sport                 Sport: Biking (deflt), Running, MultiSport, Other 
	geo                   Geocaching.com .loc
	  deficon               Default icon name 
	  nuke_placer           (0/1) Omit Placer name 
	kml                   Google Earth (Keyhole) Markup Language
	  deficon               Default icon name 
	  lines                 (0/1) Export linestrings for tracks and routes 
	  points                (0/1) Export placemarks for tracks and routes 
	  line_width            Width of lines, in pixels 
	  line_color            Line color, specified in hex AABBGGRR 
	  floating              (0/1) Altitudes are absolute and not clamped to ground 
	  extrude               (0/1) Draw extrusion line from trackpoint to ground 
	  track                 (0/1) Write KML track (default = 0) 
	  trackdata             (0/1) Include extended data for trackpoints (default = 1 
	  trackdirection        (0/1) Indicate direction of travel in track icons (defau 
	  units                 Units used when writing comments ('s'tatute or 'm' 
	  labels                (0/1) Display labels on track and routepoints  (default  
	  max_position_point    Retain at most this number of position points  (0  
	gpx                   GPX XML
	  snlen                 Length of generated shortnames 
	  suppresswhite         (0/1) No whitespace in generated shortnames 
	  logpoint              (0/1) Create waypoints from geocache log entries 
	  urlbase               Base URL for link tag in output 
	  gpxver                Target GPX version for output 
	  humminbirdextensio    (0/1) Add info (depth) as Humminbird extension 
	  garminextensions      (0/1) Add info (depth) as Garmin extension 
	vpl                   Honda/Acura Navigation System VP Log File Format
	mapsend               Magellan Mapsend
	  trkver                MapSend version TRK file to generate (3,4) 
	magellanx             Magellan SD files (as for eXplorist)
	  deficon               Default icon name 
	  maxcmts               Max number of comments to write (maxcmts=200) 
	magellan              Magellan SD files (as for Meridian)
	  deficon               Default icon name 
	  maxcmts               Max number of comments to write (maxcmts=200) 
	magellan              Magellan serial protocol
	  deficon               Default icon name 
	  maxcmts               Max number of comments to write (maxcmts=200) 
	  baud                  Numeric value of bitrate (baud=4800) 
	  noack                 (0/1) Suppress use of handshaking in name of speed 
	  nukewpt               (0/1) Delete all waypoints 
	nmea                  NMEA 0183 sentences
	  snlen                 Max length of waypoint name to write 
	  gprmc                 (0/1) Read/write GPRMC sentences 
	  gpgga                 (0/1) Read/write GPGGA sentences 
	  gpvtg                 (0/1) Read/write GPVTG sentences 
	  gpgsa                 (0/1) Read/write GPGSA sentences 
	  date                  Complete date-free tracks with given date (YYYYMMD 
	  get_posn              (0/1) Return current position as a waypoint 
	  pause                 Decimal seconds to pause between groups of strings 
	  append_positioning    (0/1) Append realtime positioning data to the output fil 
	  baud                  Speed in bits per second of serial port (baud=4800 
	  gisteq                (0/1) Write tracks for Gisteq Phototracker 
	ozi                   OziExplorer
	  pack                  (0/1) Write all tracks into one file 
	  snlen                 Max synthesized shortname length 
	  snwhite               (0/1) Allow whitespace synth. shortnames 
	  snupper               (0/1) UPPERCASE synth. shortnames 
	  snunique              (0/1) Make synth. shortnames unique 
	  wptfgcolor            Waypoint foreground color 
	  wptbgcolor            Waypoint background color 
	  proximity             Proximity distance 
	  altunit               Unit used in altitude values 
	  proxunit              Unit used in proximity values 
	wbt                   Wintec WBT-100/200 GPS Download
	  erase                 (0/1) Erase device data after download 

Supported data filters:
  • and a little test with a small gpx-file of a garmin-gps:
C:\wd\mg>gpsbabel -i gpx -f ask_bayern_ll_wgs84.gpx -o gpx -F testgpsbabel.gpx
GPX: This build excluded GPX support because expat was not installed.

so it seems that Jürgen's updated version didn't find its way to the officinal osgeo4w-stack?

and see a message in the osgeo4w-ML: http://lists.osgeo.org/pipermail/osgeo4w-dev/2010-September/001062.html

[...]
 ... of putting a copy on osgeo4w that very likely is going to get out of date.
[...]

what would be the best way to get this working for the WinGrass-builds and WinGrass-build-environment?

replacing osgeo4w's gpsbabel with a copy of http://www.gpsbabel.org/download.html?

IMHO gps-data is nowadays a very important data source which should be imported as default to any gis-software.

best regards Helmut

in reply to:  4 comment:5 by hellik, 14 years ago

Replying to hellik:

Replying to hamish:

see libexpat.dll discussion in:

https://trac.osgeo.org/osgeo4w/ticket/59 https://trac.osgeo.org/osgeo4w/ticket/171

"there is already a copy of that in osgeo4w/bin/"

if so, can we copy it over to GRASS-64-SVN/extralib/ ? or is the error message accurate and it needs to be found at build-time to work?

Hamish

just a little test:

  • I've re-installed gpsbabel by the osgeo4w-setup/installer
  • gpsbabel.exe lives in c:\osgeo4w/bin with following properties:
C:\wd\mg>gpsbabel --version
GPSBabel Version 1.4.1.  http://www.gpsbabel.org
20.07.2010  20:29           845.824 GPSBabel.exe
GPSBabel Version 1.4.1.  http://www.gpsbabel.org

Usage:
    gpsbabel [options] -i INTYPE -f INFILE [filter] -o OUTTYPE -F OUTFILE
    gpsbabel [options] -i INTYPE -o OUTTYPE INFILE [filter] OUTFILE

    Converts GPS route and waypoint data from one format type to another.
    The input type and filename are specified with the -i INTYPE
    and -f INFILE options. The output type and filename are specified
    with the -o OUTTYPE and -F OUTFILE options.
    If '-' is used for INFILE or OUTFILE, stdin or stdout will be used.

    In the second form of the command, INFILE and OUTFILE are the
    first and second positional (non-option) arguments.

    INTYPE and OUTTYPE must be one of the supported file types and
    may include options valid for that file type.  For example:
      'gpx', 'gpx,snlen=10' and 'ozi,snlen=10,snwhite=1'
    (without the quotes) are all valid file type specifications.

Options:
    -p               Preferences file (gpsbabel.ini)
    -s               Synthesize shortnames
    -r               Process route information
    -t               Process track information
    -T               Process realtime tracking information
    -w               Process waypoint information [default]
    -b               Process command file (batch mode)
    -c               Character set for next operation
    -N               No smart icons on output
    -x filtername    Invoke filter (placed between inputs and output) 
    -D level         Set debug level [0]
    -l               Print GPSBabel builtin character sets and exit
    -h, -?           Print detailed help and exit
    -V               Print GPSBabel version and exit

File Types (-i and -o options):
	gdb                   Garmin MapSource - gdb
	  cat                   Default category on output (1..16) 
	  bitscategory          Bitmap of categories 
	  ver                   Version of gdb file to generate (1..3) 
	  via                   (0/1) Drop route points that do not have an equivalent w 
	  roadbook              (0/1) Include major turn points (with description) from  
	mapsource             Garmin MapSource - mps
	  snlen                 Length of generated shortnames 
	  snwhite               (0/1) Allow whitespace synth. shortnames 
	  mpsverout             Version of mapsource file to generate (3,4,5) 
	  mpsmergeout           (0/1) Merge output with existing file 
	  mpsusedepth           (0/1) Use depth values on output (default is ignore) 
	  mpsuseprox            (0/1) Use proximity values on output (default is ignore) 
	pcx                   Garmin PCX5
	  deficon               Default icon name 
	  cartoexploreur        (0/1) Write tracks compatible with Carto Exploreur 
	garmin                Garmin serial/USB protocol
	  snlen                 Length of generated shortnames 
	  snwhite               (0/1) Allow whitespace synth. shortnames 
	  deficon               Default icon name 
	  get_posn              (0/1) Return current position as a waypoint 
	  power_off             (0/1) Command unit to power itself down 
	  resettime             (0/1) Sync GPS time to computer time 
	  category              Category number to use for written waypoints 
	  bitscategory          Bitmap of categories 
	gtrnctr               Garmin Training Center
	  course                (0/1) Write course rather than history, default yes 
	  sport                 Sport: Biking (deflt), Running, MultiSport, Other 
	geo                   Geocaching.com .loc
	  deficon               Default icon name 
	  nuke_placer           (0/1) Omit Placer name 
	kml                   Google Earth (Keyhole) Markup Language
	  deficon               Default icon name 
	  lines                 (0/1) Export linestrings for tracks and routes 
	  points                (0/1) Export placemarks for tracks and routes 
	  line_width            Width of lines, in pixels 
	  line_color            Line color, specified in hex AABBGGRR 
	  floating              (0/1) Altitudes are absolute and not clamped to ground 
	  extrude               (0/1) Draw extrusion line from trackpoint to ground 
	  track                 (0/1) Write KML track (default = 0) 
	  trackdata             (0/1) Include extended data for trackpoints (default = 1 
	  trackdirection        (0/1) Indicate direction of travel in track icons (defau 
	  units                 Units used when writing comments ('s'tatute or 'm' 
	  labels                (0/1) Display labels on track and routepoints  (default  
	  max_position_point    Retain at most this number of position points  (0  
	gpx                   GPX XML
	  snlen                 Length of generated shortnames 
	  suppresswhite         (0/1) No whitespace in generated shortnames 
	  logpoint              (0/1) Create waypoints from geocache log entries 
	  urlbase               Base URL for link tag in output 
	  gpxver                Target GPX version for output 
	  humminbirdextensio    (0/1) Add info (depth) as Humminbird extension 
	  garminextensions      (0/1) Add info (depth) as Garmin extension 
	vpl                   Honda/Acura Navigation System VP Log File Format
	mapsend               Magellan Mapsend
	  trkver                MapSend version TRK file to generate (3,4) 
	magellanx             Magellan SD files (as for eXplorist)
	  deficon               Default icon name 
	  maxcmts               Max number of comments to write (maxcmts=200) 
	magellan              Magellan SD files (as for Meridian)
	  deficon               Default icon name 
	  maxcmts               Max number of comments to write (maxcmts=200) 
	magellan              Magellan serial protocol
	  deficon               Default icon name 
	  maxcmts               Max number of comments to write (maxcmts=200) 
	  baud                  Numeric value of bitrate (baud=4800) 
	  noack                 (0/1) Suppress use of handshaking in name of speed 
	  nukewpt               (0/1) Delete all waypoints 
	nmea                  NMEA 0183 sentences
	  snlen                 Max length of waypoint name to write 
	  gprmc                 (0/1) Read/write GPRMC sentences 
	  gpgga                 (0/1) Read/write GPGGA sentences 
	  gpvtg                 (0/1) Read/write GPVTG sentences 
	  gpgsa                 (0/1) Read/write GPGSA sentences 
	  date                  Complete date-free tracks with given date (YYYYMMD 
	  get_posn              (0/1) Return current position as a waypoint 
	  pause                 Decimal seconds to pause between groups of strings 
	  append_positioning    (0/1) Append realtime positioning data to the output fil 
	  baud                  Speed in bits per second of serial port (baud=4800 
	  gisteq                (0/1) Write tracks for Gisteq Phototracker 
	ozi                   OziExplorer
	  pack                  (0/1) Write all tracks into one file 
	  snlen                 Max synthesized shortname length 
	  snwhite               (0/1) Allow whitespace synth. shortnames 
	  snupper               (0/1) UPPERCASE synth. shortnames 
	  snunique              (0/1) Make synth. shortnames unique 
	  wptfgcolor            Waypoint foreground color 
	  wptbgcolor            Waypoint background color 
	  proximity             Proximity distance 
	  altunit               Unit used in altitude values 
	  proxunit              Unit used in proximity values 
	wbt                   Wintec WBT-100/200 GPS Download
	  erase                 (0/1) Erase device data after download 

Supported data filters:
  • and a little test with a small gpx-file of a garmin-gps:
C:\wd\mg>gpsbabel -i gpx -f ask_bayern_ll_wgs84.gpx -o gpx -F testgpsbabel.gpx
GPX: This build excluded GPX support because expat was not installed.

so it seems that Jürgen's updated version didn't find its way to the officinal osgeo4w-stack?

and see a message in the osgeo4w-ML: http://lists.osgeo.org/pipermail/osgeo4w-dev/2010-September/001062.html

[...]
 ... of putting a copy on osgeo4w that very likely is going to get out of date.
[...]

what would be the best way to get this working for the WinGrass-builds and WinGrass-build-environment?

replacing osgeo4w's gpsbabel with a copy of http://www.gpsbabel.org/download.html?

IMHO gps-data is nowadays a very important data source which should be imported as default to any gis-software.

best regards Helmut

what I've done:

C:\wd\mg>gpsbabel -i gpx -f ask_bayern_ll_wgs84.gpx -o gpx -F testgpsbabel.gpx

works without any problem.

  • I've copied the same exe to C:\Program Files\GRASS-65-SVN\extrabin and tested v.in.gpsbabel in a WGS84-ll-location:
v.in.gpsbabel input=C:\wd\mg\ask_bayern_ll_wgs84.gpx output=testvingpsbabel format=gpx
No features requested for download. Assuming waypoints.
Loading Waypoints from <C:wdmgask_bayern_ll_wgs84.gpx>...
GPX: Cannot open file 'C:wdmgask_bayern_ll_wgs84.gpx'!
c:/Program Files/GRASS-65-SVN/scripts/v.in.gpsbabel: line
271: C:\gisdata\grassdata/wgs84gc/user1/.tmp/1192.0.xcsv: No
such file or directory
c:/Program Files/GRASS-65-SVN/scripts/v.in.gpsbabel: line
271: [: : integer expression expected
ERROR: Error loading data from gpsbabel

so there seems to be a path-problem:

GPX: Cannot open file 'C:wdmgask_bayern_ll_wgs84.gpx'!

Helmut

comment:6 by hamish, 14 years ago

try quoting the input file name, the \x is being treated as a literal character "x", not "\" and "x".

-input=C:\wd\mg\ask_bayern_ll_wgs84.gpx
+input="C:\wd\mg\ask_bayern_ll_wgs84.gpx"

what terminal is this from? (I'd expect it if unquoted from sh/bash)

Hamish

in reply to:  6 comment:7 by hellik, 14 years ago

Replying to hamish:

try quoting the input file name, the \x is being treated as a literal character "x", not "\" and "x".

-input=C:\wd\mg\ask_bayern_ll_wgs84.gpx
+input="C:\wd\mg\ask_bayern_ll_wgs84.gpx"

what terminal is this from? (I'd expect it if unquoted from sh/bash)

Hamish

no terminal, I've started the v.in.gpsbabel-wx-gui and picked up there the gpx-file.

Helmut

in reply to:  6 ; comment:8 by hellik, 14 years ago

Replying to hamish:

try quoting the input file name, the \x is being treated as a literal character "x", not "\" and "x".

-input=C:\wd\mg\ask_bayern_ll_wgs84.gpx
+input="C:\wd\mg\ask_bayern_ll_wgs84.gpx"

what terminal is this from? (I'd expect it if unquoted from sh/bash)

Hamish

tested as quoted in the wxgui:

v.in.gpsbabel -w input="C:\wd\mg\testgpsbabel.gpx" output=test2 format=gpx      
Loading Waypoints from <"C:wdmgtestgpsbabel.gpx">...
GPX: Cannot open file '"C:wdmgtestgpsbabel.gpx"'!
c:/Program Files/GRASS-65-SVN/scripts/v.in.gpsbabel: line
271: C:\gisdata\grassdata/wgs84gc/user1/.tmp/5640.0.xcsv: No
such file or directory
c:/Program Files/GRASS-65-SVN/scripts/v.in.gpsbabel: line
271: [: : integer expression expected
ERROR: Error loading data from gpsbabel

it doesn't work neither with a quoted path in the wxgui. the path-problem remains.

Helmut

in reply to:  8 comment:9 by hellik, 14 years ago

Replying to hellik:

Replying to hamish:

try quoting the input file name, the \x is being treated as a literal character "x", not "\" and "x".

-input=C:\wd\mg\ask_bayern_ll_wgs84.gpx
+input="C:\wd\mg\ask_bayern_ll_wgs84.gpx"

what terminal is this from? (I'd expect it if unquoted from sh/bash)

Hamish

tested as quoted in the wxgui:

v.in.gpsbabel -w input="C:\wd\mg\testgpsbabel.gpx" output=test2 format=gpx      
Loading Waypoints from <"C:wdmgtestgpsbabel.gpx">...
GPX: Cannot open file '"C:wdmgtestgpsbabel.gpx"'!
c:/Program Files/GRASS-65-SVN/scripts/v.in.gpsbabel: line
271: C:\gisdata\grassdata/wgs84gc/user1/.tmp/5640.0.xcsv: No
such file or directory
c:/Program Files/GRASS-65-SVN/scripts/v.in.gpsbabel: line
271: [: : integer expression expected
ERROR: Error loading data from gpsbabel

it doesn't work neither with a quoted path in the wxgui. the path-problem remains.

Helmut

following tested in the WinGrass65-msys-cmd-line

v.in.gpsbabel -w input="C:\wd\mg\testgpsbabel.gpx" output=test2 format=gpx 

there it's working with the quoted path.

so back to the original issue of this ticket:

the gpsbabel.exe from http://www.gpsbabel.org/download.html - copied over that version delivered by osgeo4w - v.in.gpsbabel works in WinGrass.

Helmut

comment:10 by hamish, 14 years ago

opened as # 181 in the osgeo4w trac system.

https://trac.osgeo.org/osgeo4w/ticket/181

comment:11 by hamish, 13 years ago

Resolution: fixed
Status: newclosed

apparently fixed in osgeo4w

Note: See TracTickets for help on using tickets.