[GRASS-dev] [bug #5209] (grass) v.in.ascii table creation broken for DDD:MM:SS input

this bug's URL: http://intevation.de/rt/webrt?serial_num=5209
-------------------------------------------------------------------------

Subject: v.in.ascii table creation broken for DDD:MM:SS input

Hi,

v.in.ascii gives this error when input data is in DDD:MM:SS.SSSSSS format.

G63> v.in.ascii in=lidaratm2_100LL2.txt out=tmp_vLL fs=,
Scanning input for column types ...
Maximum input row length: 55
Maximum number of columns: 3
Minimum number of columns: 3
column: 1 type: double
column: 2 type: double
column: 3 type: double
Importing points ...
DBMI-DBF driver error:
SQL parser error in statement:
insert into tmp_vLL values ( 1, 75:37:46.5563999999961W,
35:56:58.8948000000124N, 8.898)
Error in db_execute_immediate()

ERROR: Cannot insert values: insert into tmp_vLL values ( 1,
       75:37:46.5563999999961W, 35:56:58.8948000000124N, 8.898)

The scanning step converts to double format for testing and sanitizing for the
next import step, but then the column type is wrong. If you use the "-t" flag
it imports ok, but no table is created.

workaround: specify column= values to force varchar() columns.

G63> v.in.ascii in=lidaratm2_100LL2.txt out=tmp_vLL fs=, \
        columns="x varchar(40), y varchar(40), elev double"

(works ok)

# test data:
75:37:46.5563999999961W,35:56:58.8948000000124N,8.898
75:37:16.5000000000123W,35:56:58.8948000000124N,2.457
75:37:43.6403999999914W,35:56:58.8948000000124N,5.319
75:37:19.0092000000209W,35:56:58.8948000000124N,3.553
75:37:24.1176000000155W,35:56:58.8948000000124N,6.816
75:37:25.0175999999942W,35:56:58.8948000000124N,8.541
75:37:36.1271999999803W,35:56:58.8948000000124N,3.836
75:37:25.4748000000166W,35:56:58.8948000000124N,8.722
75:37:25.6115999999781W,35:56:58.8948000000124N,9.369
75:37:17.2415999999816W,35:56:58.8948000000124N,4.605

Hamish

-------------------------------------------- Managed by Request Tracker