[GRASS-SVN] r31836 - grass/trunk/scripts/v.in.gpsbabel
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 24 08:10:52 EDT 2008
Author: hamish
Date: 2008-06-24 08:10:52 -0400 (Tue, 24 Jun 2008)
New Revision: 31836
Modified:
grass/trunk/scripts/v.in.gpsbabel/v.in.gpsbabel
Log:
if altitude data is missing replace it with a 0 as v.in.ascii defined column type is expecting doubles (merge from devbr6)
Modified: grass/trunk/scripts/v.in.gpsbabel/v.in.gpsbabel
===================================================================
--- grass/trunk/scripts/v.in.gpsbabel/v.in.gpsbabel 2008-06-24 11:36:29 UTC (rev 31835)
+++ grass/trunk/scripts/v.in.gpsbabel/v.in.gpsbabel 2008-06-24 12:10:52 UTC (rev 31836)
@@ -296,10 +296,11 @@
cat "${TMP}.xcsv" | cut -f 1,2 -d '|'| tr '|' ' ' > "$TMP".base
# FIXME: if last field (comments) is empty it causes a not-enough fields error in v.in.ascii
-
+# FIXME: if altitude column is empty (1st attr) v.in.ascii complains as the column type is defined as 'double'
cat "${TMP}.xcsv" | tr '+' '|' | cut -f3,4,5,6 -d '|' | \
sed -e 's/-99999999.000000//' -e 's/|$/|_/' \
- -e 's/01\/01\/1970|00:00:00 AM/|/' > "$TMP".attributes
+ -e 's/01\/01\/1970|00:00:00 AM/|/' \
+ -e 's/^|/|/'> "$TMP".attributes
#### reproject if needed
@@ -344,7 +345,7 @@
g.message "Importing Tracks as points..."
fi
- cat "${TMP}.asc" | v.in.ascii output="$NAME" cat=0 \
+ v.in.ascii in="${TMP}.asc" output="$NAME" cat=0 \
columns='x double precision, y double precision, altitude double precision, gmt_date varchar(10), gmt_time varchar(11), comments varchar(40)'
EXITCODE=$?
More information about the grass-commit
mailing list