[GRASSLIST:1599] G_write_colors()

Massimiliano Cannata massimiliano.cannata at supsi.ch
Wed Oct 29 11:32:22 EST 2003


Hello users,
I have a problem setting the color in a raster
map,
in my C file i call:

.......
......
char *name,*result, *mapset;
struct Colors *colr;

name = input->answer;
result = output->answer;
mapset = G_find_cell2(name,"");

G_init_colors(colr);
G_add_color-rule( (CELL)-50, 0,0,255, (CELL)0,
255,255,255, colr);
G_add_color-rule( (CELL)0, 255,255,255, (CELL)50,
255,0,0, colr);
G_write_colors(result,mapset,colr); // this
generates segmentation fault!!!!!
G_free_colors(colr);

What i'm doing wrong?
I can directly write an ascii file in my color
folder nameing it with my raster file name,
but isn't it a wrong solution?
Any suggestions?
Thanks
--
-------------
note: change my e-mail reference to
massimiliano.cannata at supsi.ch
      because the old one will be deleted soon.
-------------
Ing.  Massimiliano Cannata
Istituto di Scienze della Terra - SUPSI
C.P. 72 - CH-6952 Canobbio (Ticino, Switzerland)
Tel +41 91 /935 12 25 - Fax +41 91 /935 12 09
eMail: massimiliano.cannata at supsi.ch
Internet: http://www.ist.supsi.ch

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


More information about the grass-user mailing list