[GRASS-dev] r.external no cats file?

Markus Metz markus.metz.giswork at googlemail.com
Tue Jun 28 04:17:42 EDT 2011

When linking external raster maps with r.external, I have to manually
create a corresponding cats file, otherwise a number of modules, e.g.
d.rast do not work properly. Is there any reason why no corresponding
cats file is produced?

This patch for trunk works for me:


Index: main.c
--- main.c	(revision 46815)
+++ main.c	(working copy)
@@ -461,6 +461,7 @@
 		       const char *title, int flip)
     struct History history;
+    struct Categories cats;

     Rast_put_cellhd(output, cellhd);

@@ -491,6 +492,8 @@
     Rast_write_history(output, &history);

     Rast_write_colors(output, G_mapset(), &info->colors);
+    Rast_init_cats(NULL, &cats);
+    Rast_write_cats((char *)output, &cats);

     if (title)
 	Rast_put_cell_title(output, title);


Markus M

More information about the grass-dev mailing list