Changeset 34366
- Timestamp:
- Nov 18, 2008, 5:27:00 AM (16 years ago)
- Location:
- grass/branches/develbranch_6/raster/r.recode
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
grass/branches/develbranch_6/raster/r.recode/main.c
r32583 r34366 7 7 * Jan-Oliver Wagner <jan intevation.de> 8 8 * PURPOSE: Recode categorical raster maps 9 * COPYRIGHT: (C) 1999-200 6by the GRASS Development Team9 * COPYRIGHT: (C) 1999-2008 by the GRASS Development Team 10 10 * 11 11 * This program is free software under the GNU General Public … … 35 35 36 36 /* any interaction must run in a term window */ 37 G_putenv("GRASS_UI_TERM", "1");37 /* G_putenv("GRASS_UI_TERM", "1"); */ 38 38 39 39 G_gisinit(argv[0]); 40 40 41 41 module = G_define_module(); 42 module->keywords = _("raster ");42 module->keywords = _("raster, recode category"); 43 43 module->description = _("Recodes categorical raster maps."); 44 44 … … 48 48 parm.output = G_define_standard_option(G_OPT_R_OUTPUT); 49 49 50 parm.rules = G_define_ option();50 parm.rules = G_define_standard_option(G_OPT_F_INPUT); 51 51 parm.rules->key = "rules"; 52 parm.rules->type = TYPE_STRING; 53 parm.rules->description = _("File containing recode rules"); 54 parm.rules->key_desc = "name"; 55 parm.rules->gisprompt = "old_file,file,input"; 52 parm.rules->label = _("File containing recode rules"); 53 parm.rules->required = NO; 56 54 57 55 parm.title = G_define_option(); … … 92 90 srcfp = fopen(parm.rules->answer, "r"); 93 91 if (!srcfp) 94 G_fatal_error(_(" Cannotopen rules file <%s>"),92 G_fatal_error(_("Unable to open rules file <%s>"), 95 93 parm.rules->answer); 96 94 } … … 108 106 do_recode(); 109 107 108 G_done_msg(_("Raster map <%s> created."), 109 result); 110 110 111 exit(EXIT_SUCCESS); 111 112 } -
grass/branches/develbranch_6/raster/r.recode/read_rules.c
r32583 r34366 17 17 if (inp_type != CELL_TYPE) { 18 18 if (G_read_fp_range(name, mapset, &drange) <= 0) 19 G_fatal_error(_("Unable to read f_range for map %s"), name); 19 G_fatal_error(_("Unable to read fp range of raster map <%s>"), 20 G_fully_qualified_name(name, mapset)); 20 21 21 22 G_get_fp_range_min_max(&drange, &old_dmin, &old_dmax); 22 23 if (G_is_d_null_value(&old_dmin) || G_is_d_null_value(&old_dmax)) 23 G_message(_("Data range is empty")); 24 G_important_message(_("Data range of raster map <%s> is empty"), 25 G_fully_qualified_name(name, mapset)); 24 26 else { 25 27 sprintf(buff, "%.10f", old_dmin); … … 27 29 G_trim_decimal(buff); 28 30 G_trim_decimal(buff2); 29 G_message(_("Data range of %s is %s to %s (entire map)"), name,30 buff, buff2);31 G_message(_("Data range of raster map <%s> is %s to %s (entire map)"), 32 G_fully_qualified_name(name, mapset), buff, buff2); 31 33 } 32 34 } 33 35 if (G_read_range(name, mapset, &range) <= 0) 34 G_fatal_error(_("Unable to read range for map <%s>"), name); 36 G_fatal_error(_("Unable to read range of raster map <%s>"), 37 G_fully_qualified_name(name, mapset)); 35 38 36 39 G_get_range_min_max(&range, &old_min, &old_max); 37 40 if (G_is_c_null_value(&old_min) || G_is_c_null_value(&old_max)) 38 G_message(_("Integer data range of %s is empty"), name); 41 G_important_message(_("Integer data range of raster map <%s> is empty"), 42 G_fully_qualified_name(name, mapset)); 39 43 else 40 G_message(_("Integer data range of %sis %d to %d"),41 name, (int)old_min, (int)old_max);44 G_message(_("Integer data range of raster mao <%s> is %d to %d"), 45 G_fully_qualified_name(name, mapset), (int) old_min, (int) old_max); 42 46 43 47 return 0; … … 121 125 } 122 126 else 123 G_message(_(" %sis not a valid rule"), buf);127 G_message(_("'%s' is not a valid rule"), buf); 124 128 break; 125 129 } /* switch */ -
grass/branches/develbranch_6/raster/r.recode/recode.c
r32527 r34366 1 1 #include <stdio.h> 2 3 #include <grass/glocale.h> 4 2 5 #include "global.h" 3 6 … … 43 46 in_fd = G_open_cell_old(name, mapset); 44 47 if (in_fd < 0) 45 G_fatal_error("Can't open input map"); 48 G_fatal_error(_("Unable to open raster map <%s>"), 49 G_fully_qualified_name(name, mapset)); 46 50 47 51 out_fd = G_open_raster_new(result, out_type);
Note:
See TracChangeset
for help on using the changeset viewer.
