[GRASSLIST:4509] multiple field....

Massimiliano Cannata massimiliano.cannata at supsi.ch
Tue Oct 12 13:39:56 EDT 2004


Hiello everybody,

I'm trying to  write a code to create a point map (in 5.7 version) with 
6 field but I have some great doubt.....
I guess I have to create 1 coor file with 6 fields (columns) like this:

point_id | x | y | z | field_1 | field_2 | ....... | field_6

and 6 tables with attributes: one for every field.......

table for field_1:
cat | attribute_1 | attribute_2 | ........ | attribute_n

table for field_2:
cat | attribute_1 | attribute_2 | ........ | attribute_n

etc.....

my question are:

with the following code do I create a field_info struct for the field_1 
or with 1 field?
Fi = Vect_default_field_info ( &Map, 1, NULL, GV_1TABLE );

and with the foolowing code do I create the table for field_1 ( cat | 
attribute_1 | attribute_2 ) ?

db_zero_string (&sql);
sprintf ( buf, "create table %s ( cat integer", Fi->table );
db_append_string ( &sql, buf );
db_append_string ( &sql, ", attribute_1integer" );
sprintf ( buf, ", attribute_2 varchar(%d)", clen );
db_append_string ( &sql, buf );
db_append_string ( &sql, ")" );

Thanks you for the future response and for any suggestion/help.......
Maxi

-- 
_____________________________________________________

Ing. Massimiliano Cannata

SUPSI - Istituto Scienze della Terra
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 (0)91 935 12 25 - Fax +41 (0)91 935 12 09
mailto:massimiliano.cannata at supsi.ch
http://www.ist.supsi.ch

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20041012/7cfff707/attachment.html


More information about the grass-user mailing list