[GRASS-user] v.in.ogr with postgis layer

Hi to all,
I've a postgis table named *map_points_pluvio*, having these fields:

id_stazione: integer;
valore: numeric;
the_geom: postgis geometric type;

when I run the v.in.ogr command to import data into grass

v.in.ogr --overwrite dsn="..." output=map_points_pluvio_grass
layer=map_points_pluvio

the new postgis table *map_points_pluvio_grass* is created as
expected, but it has the following structure:

cat: integer;
id_stazione: integer;
valore: integer;

As you can see, the data type of the field *valore* is integer not
numeric as it was in origin.
Where am I wrong?

Thanks in advance
Marco

Solved.
It seems v.in.ogr doesn't manage numeric data type. I changed the original
data type of *valore* in double precisions type so the import process
succeeded.
Bye

--
View this message in context: http://osgeo-org.1560.n6.nabble.com/v-in-ogr-with-postgis-layer-tp5019554p5019809.html
Sent from the Grass - Users mailing list archive at Nabble.com.

On 29/11/12 13:49, Marco wrote:

Hi to all,
I've a postgis table named *map_points_pluvio*, having these fields:

id_stazione: integer;
valore: numeric;
the_geom: postgis geometric type;

when I run the v.in.ogr command to import data into grass

v.in.ogr --overwrite dsn="..." output=map_points_pluvio_grass
layer=map_points_pluvio

the new postgis table *map_points_pluvio_grass* is created as
expected, but it has the following structure:

cat: integer;
id_stazione: integer;
valore: integer;

As you can see, the data type of the field *valore* is integer not
numeric as it was in origin.
Where am I wrong?

If the numeric type is defined with precision=0 then it is treated as an integer.

I just did a test (in grass6.4.2 and grass7) with a table containing the following fields:

test_num numeric(10,3)
test_double double precision
test_num0 numeric(10,0)

test_num and test_double get imported as double precision, test_num0 gets imported as integer.

Moritz