[GRASS5] [bug #2763] (grass) v.in.ascii auto-detection too strict

Radim Blazek blazek at itc.it
Fri Dec 3 05:45:35 EST 2004


Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=2763
> -------------------------------------------------------------------------
> 
> Subject: v.in.ascii auto-detection too strict
> 
> Platform: GNU/Linux/i386
> grass obtained from: Mirror of Trento site
> grass binary for platform: Compiled from Sources
> GRASS Version: 5.7-cvs_nov04
> 
> Hi,
> 
> when using v.in.ascii it automatically decides column type, even if you
> specify with 'columns=' e.g.:
> 
> columns='x double precision, y double precision, cat int, name varchar(10)'
> 
> 
> problem I am having:
> 
> I have an input column with data like:
> 001
> 002
> 003
> 004
> 005
> etc.
> 
> I want to load that as a string column, not an int column (even though
> they are all numbers). I use 'id_num varchar(3)' but it gives an error
> that column type does not match input data type. :(

For me it works:
cat pok.txt
0|1|1|001
2|3|2|002
4|5|3|003

cat pok.txt  | v.in.ascii output=pok columns="x double precision, y 
double precision, cat int, name varchar(10)" catcol=3

db.describe schema1.pok
...
column:name
description:
type:CHARACTER
len:10

> problem two:
> I want to input "nan" into a double precision column, it complains
> "column foo defined as double has string values"
> 
> 'nan' and 'inf' are valid IEEE float/double values;
>   scanf "%f" reads them, etc.

Added to my TODO > 6.0

Radim




More information about the grass-dev mailing list