Changeset 30450
- Timestamp:
- Mar 3, 2008, 10:00:43 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
grass/branches/releasebranch_6_3/raster/r.out.gdal/main.c
r29556 r30450 1 2 1 /**************************************************************************** 3 2 * … … 8 7 * Replace r.out.gdal.sh script based on gdal_translate 9 8 * executable. 10 * COPYRIGHT: (C) 2006 by the GRASS Development Team9 * COPYRIGHT: (C) 2006-2007 by the GRASS Development Team 11 10 * 12 11 * This program is free software under the GNU General Public … … 272 271 for (col = 0; col < cols; col++) 273 272 if (nulls[col]) { 274 ((DCELL *) bufer)[col] = dnullval;273 ((DCELL *) bufer)[col] = dnullval; 275 274 if (n_nulls == 0) { 276 275 GDALSetRasterNoDataValue(hBand, nodataval); … … 302 301 for (col = 0; col < cols; col++) 303 302 if (nulls[col]) { 304 ((CELL *) bufer)[col] = inullval;303 ((CELL *) bufer)[col] = inullval; 305 304 if (n_nulls == 0) { 306 305 GDALSetRasterNoDataValue(hBand, nodataval); … … 322 321 if (maptype == CELL_TYPE) 323 322 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." 325 324 "You can specify nodata value by %s parameter."), 326 325 (int) nodataval, nodatakey); 327 326 else 328 327 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." 330 329 "You can specify nodata value by %s parameter."), 331 330 nodataval, nodatakey); 332 331 } 333 334 332 335 333 return 0; 336 334 } … … 380 378 flag_l->key = 'l'; 381 379 flag_l->description = _("List supported output formats"); 380 flag_l->guisection = _("Print"); 382 381 383 382 input = G_define_standard_option(G_OPT_R_INPUT); 384 383 input->required = NO; 384 input->description = _("Name of raster map (or group) to export"); 385 input->guisection = _("Required"); 385 386 386 387 format = G_define_option(); … … 417 418 output->required = NO; 418 419 output->gisprompt = "new_file,file,output"; 420 output->description = _("Name for output raster file"); 421 output->guisection = _("Required"); 419 422 420 423 createopt = G_define_option(); … … 452 455 supported_formats(&gdal_formats); 453 456 exit(EXIT_SUCCESS); 457 } 458 459 if (!input->answer) { 460 G_fatal_error(_("Required parameter <%s> not set"), 461 input->key); 454 462 } 455 463 … … 578 586 /* If file type not set by user ... */ 579 587 /* 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 ) { 581 589 bHaveMinMax = FALSE; 582 590 } else { … … 601 609 if (dfCellMin >= 0 && dfCellMax < 256 ) { 602 610 datatype = GDT_Byte; 611 nodataval = (double)(unsigned char)0xFFu; 603 612 } else { 604 613 if (dfCellMin >= 0 && dfCellMax < 65536 ) { 605 datatype = GDT_UInt16; 614 datatype = GDT_UInt16; 615 nodataval = (double)(short)0x8000; 606 616 } 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; 608 619 } 609 620 } 610 nodataval = (double)(int)0x80000000;611 621 } 612 622 } … … 676 686 int band; 677 687 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 } 678 693 if (import_band 679 694 (hCurrDS, band + 1, ref.file[band].name, ref.file[band].mapset,
Note:
See TracChangeset
for help on using the changeset viewer.
