Changeset 30450


Ignore:
Timestamp:
Mar 3, 2008, 10:00:43 AM (16 years ago)
Author:
epatton
Message:

Backported warning message improvement from TRUNK

File:
1 edited

Legend:

Unmodified
Added
Removed
  • grass/branches/releasebranch_6_3/raster/r.out.gdal/main.c

    r29556 r30450  
    1 
    21/****************************************************************************
    32*
     
    87*               Replace r.out.gdal.sh script based on gdal_translate
    98*               executable.
    10 * COPYRIGHT:    (C) 2006 by the GRASS Development Team
     9* COPYRIGHT:    (C) 2006-2007 by the GRASS Development Team
    1110*
    1211*               This program is free software under the GNU General Public
     
    272271            for (col = 0; col < cols; col++)
    273272                if (nulls[col]) {
    274                     ((DCELL *) bufer)[col] = dnullval;
     273                    ((DCELL *) bufer)[col] = dnullval;
    275274                    if (n_nulls == 0) {
    276275                        GDALSetRasterNoDataValue(hBand, nodataval);
     
    302301            for (col = 0; col < cols; col++)
    303302                if (nulls[col]) {
    304                     ((CELL *) bufer)[col] = inullval;
     303                    ((CELL *) bufer)[col] = inullval;
    305304                    if (n_nulls == 0) {
    306305                        GDALSetRasterNoDataValue(hBand, nodataval);
     
    322321        if (maptype == CELL_TYPE)
    323322            G_warning(_("Input raster map constains cells with NULL-value (no-data). "
    324                         "For no-data values was used value %d. "
     323                        "The value %d was used to represent no-data values in the input map."
    325324                        "You can specify nodata value by %s parameter."),
    326325                      (int) nodataval, nodatakey);
    327326        else
    328327            G_warning(_("Input raster map constains cells with NULL-value (no-data). "
    329                         "For no-data values was used value %g. "
     328                        "The value %g was used to represent no-data values in the input map."
    330329                        "You can specify nodata value by %s parameter."),
    331330                      nodataval, nodatakey);
    332331    }
    333                    
    334                    
     332
    335333    return 0;
    336334}
     
    380378    flag_l->key = 'l';
    381379    flag_l->description = _("List supported output formats");
     380    flag_l->guisection = _("Print");
    382381
    383382    input = G_define_standard_option(G_OPT_R_INPUT);
    384383    input->required = NO;
     384    input->description = _("Name of raster map (or group) to export");
     385    input->guisection = _("Required");
    385386
    386387    format = G_define_option();
     
    417418    output->required = NO;
    418419    output->gisprompt = "new_file,file,output";
     420    output->description = _("Name for output raster file");
     421    output->guisection = _("Required");
    419422
    420423    createopt = G_define_option();
     
    452455        supported_formats(&gdal_formats);
    453456        exit(EXIT_SUCCESS);
     457    }
     458
     459    if (!input->answer) {
     460        G_fatal_error(_("Required parameter <%s> not set"),
     461                      input->key);
    454462    }
    455463
     
    578586    /* If file type not set by user ... */
    579587    /* Get min/max values. */
    580     if( G_read_fp_range(input->answer, mapset, &sRange ) == -1 ) {
     588    if( G_read_fp_range(ref.file[0].name, ref.file[0].mapset, &sRange ) == -1 ) {
    581589        bHaveMinMax = FALSE;
    582590    } else {
     
    601609            if (dfCellMin >= 0 && dfCellMax < 256 ) {
    602610                datatype = GDT_Byte;
     611                nodataval = (double)(unsigned char)0xFFu;
    603612            } else {
    604613                if (dfCellMin >= 0 && dfCellMax < 65536 ) {
    605                         datatype = GDT_UInt16;
     614                    datatype = GDT_UInt16;
     615                    nodataval = (double)(short)0x8000;
    606616                } else {
    607                         datatype = GDT_Int32; /* need to furthermore fine tune this? */
     617                    datatype = GDT_Int32; /* need to furthermore fine tune this? */
     618                    nodataval = (double)(int)0x80000000;
    608619                }
    609620            }
    610             nodataval = (double)(int)0x80000000;
    611621        }
    612622    }
     
    676686    int band;
    677687    for (band = 0; band < ref.nfiles; band++) {
     688        if (ref.nfiles > 1) {
     689            G_verbose_message(_("Exporting raster map <%s> (band %d)..."),
     690                              G_fully_qualified_name(ref.file[band].name, ref.file[band].mapset),
     691                              band+1);
     692        }
    678693        if (import_band
    679694            (hCurrDS, band + 1, ref.file[band].name, ref.file[band].mapset,
Note: See TracChangeset for help on using the changeset viewer.