[GRASSLIST:2727] Re: Upload sites to db
hwehr at hs-harz.de
Tue Dec 4 02:36:06 EST 2001
Radim Blazek wrote:
> On Thu 29. November 2001 07:42, Harald Wehr wrote:
>>to upload a vector to a database I can use "v.to.db". But I didn' t find
>>any hints on how many columns the table must have and which _datatypes_
>>a column therefore should have.
>>Can you give any hints?
> The table should have at least id/key (integer) and x, y (numbers).
> db.connect driver=odbc database=sites
> echo "create table sites (id int4, x float8, y float8, type char(1), \
> name varchar(50))" | db.execute
> # postgresql specific types used here
> v.to.db type=site map=sites option=cat table=sites key=id
> v.to.db type=site map=sites option=coor table=sites key=id col1=x col2=y
I exactly followed your instructions to this point. First i digitized
some sites in grass. Then i created a table like this above and then
tried to put these sites into the table. But after that there are no
sites in the table. Only the category, i have assigned to all sites is
written in the column "id". There is nothing else in the table "sites".
Can you give any hints what i'm doing wrong?
More information about the grass-user