Browse Source

r.in.arc, r.out.arc, r.out.tiff modules moved to Addons (trunk, https://trac.osgeo.org/grass/changeset/62524)

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62527 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler 10 years ago
parent
commit
d0349c2ed4

+ 0 - 9
gui/wxpython/xml/toolboxes.xml

@@ -263,9 +263,6 @@
       <module-item name="r.in.bin">
         <label>Raw binary array import</label>
       </module-item>
-      <module-item name="r.in.arc">
-        <label>ESRI ASCII grid import</label>
-      </module-item>
       <module-item name="r.in.gridatb">
         <label>GRIDATB.FOR import</label>
       </module-item>
@@ -385,9 +382,6 @@
         <label>ASCII x,y,z points export</label>
       </module-item>
       <separator/>
-      <module-item name="r.out.arc">
-        <label>ESRI ASCII grid export</label>
-      </module-item>
       <module-item name="r.out.gridatb">
         <label>GRIDATB.FOR export</label>
       </module-item>
@@ -414,9 +408,6 @@
       <module-item name="r.out.pov">
         <label>POV-Ray export</label>
       </module-item>
-      <module-item name="r.out.tiff">
-        <label>TIFF export</label>
-      </module-item>
       <module-item name="r.out.vrml">
         <label>VRML export</label>
       </module-item>

+ 0 - 3
raster/Makefile

@@ -28,7 +28,6 @@ SUBDIRS = \
 	r.gwflow \
 	r.his \
 	r.horizon \
-	r.in.arc \
 	r.in.ascii \
 	r.in.bin \
 	r.in.gdal \
@@ -48,7 +47,6 @@ SUBDIRS = \
 	r.mode \
 	r.neighbors \
 	r.null \
-	r.out.arc \
 	r.out.ascii \
 	r.out.bin \
 	r.out.gdal \
@@ -59,7 +57,6 @@ SUBDIRS = \
 	r.out.pov \
 	r.out.ppm \
 	r.out.ppm3 \
-	r.out.tiff \
 	r.out.vrml \
 	r.out.vtk \
 	r.param.scale \

+ 0 - 11
raster/r.in.arc/Makefile

@@ -1,11 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = r.in.arc
-
-LIBES = $(RASTERLIB) $(GISLIB)
-DEPENDENCIES = $(RASTERDEP) $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-
-default: cmd

+ 0 - 7
raster/r.in.arc/README

@@ -1,7 +0,0 @@
-
-Module to import ARC/INFO ascii raster files 
-
-This undocumented program was found in "untested"
-portion of 4.2.1 distribution from Hannover.  I 
-added support for null value and floating point. 
-- Bill

+ 0 - 172
raster/r.in.arc/gethead.c

@@ -1,172 +0,0 @@
-#include <string.h>
-#include <ctype.h>
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include "local_proto.h"
-#include <grass/glocale.h>
-
-static int scan_int(char *, void *, int);
-static int scan_res(char *, void *, int);
-static int scan_easting(char *, void *, int);
-static int scan_northing(char *, void *, int);
-static int scan_cellsize(char *, void *, int);
-static int extract(int, char *, char *, void *, int,
-		   int (*)(char *, void *, int));
-static int missing(int, char *);
-
-int gethead(FILE * fd, struct Cell_head *cellhd, int *missingval)
-{
-    int i, ok;
-    int nodata, res, s, w, r, c;
-    char label[100], value[100];
-    char buf[1024];
-
-    s = nodata = res = w = r = c = 0;
-
-    cellhd->zone = G_zone();
-    cellhd->proj = G_projection();
-
-    while (nodata == 0 || s == 0 || res == 0 || w == 0 || r == 0 || c == 0) {
-	if (!G_getl2(buf, sizeof buf, fd))
-	    break;
-	*label = *value = '\0';
-	sscanf(buf, "%s %s", label, value);
-	if (*label == '\0')
-	    continue;		/* ignore blank lines */
-	for (i = 0; i < strlen(label); i++) {
-	    label[i] = tolower(label[i]);
-	}
-
-
-	if (strcmp(label, "ncols") == 0) {
-	    if (!extract(c++, label, value, &cellhd->cols, cellhd->proj,
-			 scan_int))
-		ok = 0;
-	    continue;
-	}
-
-	if (strcmp(label, "nrows") == 0) {
-	    if (!extract(r++, label, value, &cellhd->rows, cellhd->proj,
-			 scan_int))
-		ok = 0;
-	    continue;
-	}
-
-	if (strcmp(label, "xllcorner") == 0) {
-	    if (!extract(w++, label, value, &cellhd->west, cellhd->proj,
-			 scan_easting))
-		ok = 0;
-	    continue;
-	}
-
-	if (strcmp(label, "yllcorner") == 0) {
-	    if (!extract(s++, label, value, &cellhd->south, cellhd->proj,
-			 scan_northing))
-		ok = 0;
-	    continue;
-	}
-
-	if (strcmp(label, "cellsize") == 0) {
-	    if (!extract(res++, label, value, &cellhd->ew_res, cellhd->proj,
-			 scan_cellsize))
-		ok = 0;
-
-	    cellhd->ns_res = cellhd->ew_res;
-	    cellhd->north = cellhd->south + (cellhd->ns_res * cellhd->rows);
-	    cellhd->east = cellhd->west + (cellhd->ew_res * cellhd->cols);
-
-	    continue;
-	}
-
-	if (strcmp(label, "nodata_value") == 0) {
-	    if (!extract(nodata++, label, value, missingval, cellhd->proj,
-			 scan_res))
-		ok = 0;
-	    continue;
-	}
-
-	G_warning(_("Illegal line in header"));
-	G_warning(buf);
-
-	missing(s, "yllcorner");
-	missing(w, "xllcorner");
-	missing(r, "nrows");
-	missing(c, "ncols");
-	missing(res, "cellsize");
-	missing(nodata, "nodata_value");
-	return 0;
-    }
-
-    G_adjust_Cell_head(cellhd, 1, 1);
-
-    return 1;
-}
-
-static int scan_int(char *s, void *v, int proj)
-{
-    char dummy[3];
-    int *i = v;
-
-    *dummy = 0;
-
-    if (sscanf(s, "%d%1s", i, dummy) != 1)
-	return 0;
-    if (*dummy)
-	return 0;
-    if (*i <= 0)
-	return 0;
-    return 1;
-}
-
-static int scan_res(char *s, void *v, int proj)
-{
-    char dummy[3];
-    int *i = v;
-
-    *dummy = 0;
-
-    if (sscanf(s, "%d%1s", i, dummy) != 1)
-	return 0;
-    if (*dummy)
-	return 0;
-    if (*i <= -9999999)
-	return 0;
-    return 1;
-}
-
-
-static int scan_easting(char *s, void *v, int i)
-{
-    return G_scan_easting(s, (double *)v, i);
-}
-
-static int scan_northing(char *s, void *v, int i)
-{
-    return G_scan_northing(s, (double *)v, i);
-}
-
-static int scan_cellsize(char *s, void *v, int i)
-{
-    return G_scan_resolution(s, (double *)v, i);
-}
-
-static int extract(int count, char *label, char *value,
-		   void *data, int proj, int (*scanner) (char *, void *, int))
-{
-    if (count) {
-	G_warning(_("Duplicate \"%s\" field in header"), label);
-	return 0;
-    }
-    if (scanner(value, data, proj))
-	return 1;
-    G_warning(_("Illegal \"%s\" value in header: \"%s\""), label, value);
-    return 0;
-}
-
-static int missing(int count, char *label)
-{
-    if (count)
-	return 0;
-    G_warning(_("\"%s\" field missing from header"), label);
-    return 1;
-}

+ 0 - 5
raster/r.in.arc/local_proto.h

@@ -1,5 +0,0 @@
-/* gethead.c */
-int gethead(FILE *, struct Cell_head *, int *);
-
-/* main.c */
-int file_cpy(FILE *, FILE *);

+ 0 - 230
raster/r.in.arc/main.c

@@ -1,230 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.in.arc
- * AUTHOR(S):    Unknown German author,
- *                updated by Bill Brown to floating point support (original contributors)
- *               Markus Neteler <neteler itc.it>, Huidae Cho <grass4u gmail.com>,
- *               Roberto Flor <flor itc.it>, Jachym Cepicky <jachym les-ejk.cz>,
- *               Jan-Oliver Wagner <jan intevation.de>
- * PURPOSE:      Import an ESRI ARC/INFO ascii raster file
- * COPYRIGHT:    (C) 1999-2006 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- *****************************************************************************/
-#include <stdlib.h>
-#include <string.h>
-#include <grass/config.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include <grass/glocale.h>
-#include "local_proto.h"
-
-FILE *Tmp_fd = NULL;
-char *Tmp_file = NULL;
-
-int main(int argc, char *argv[])
-{
-    char *input;
-    char *output;
-    char *title;
-    FILE *fd;
-    int cf;
-    struct Cell_head cellhd;
-    CELL *cell;
-    FCELL *fcell;
-    DCELL *dcell;
-    int row, col;
-    int nrows, ncols;
-    static int missingval;
-    int rtype;
-    double mult_fact;
-    double x;
-    struct GModule *module;
-    struct History history;
-    struct
-    {
-	struct Option *input, *output, *type, *title, *mult;
-    } parm;
-
-
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("raster"));
-    G_add_keyword(_("import"));
-    G_add_keyword("ASCII");
-    module->description =
-	_("Converts an ESRI ARC/INFO ascii raster file (GRID) into a GRASS raster map.");
-    
-    parm.input = G_define_standard_option(G_OPT_F_INPUT);
-    parm.input->description =
-	_("Name of ARC/INFO ASCII raster file (GRID) to be imported");
-    
-    parm.output = G_define_standard_option(G_OPT_R_OUTPUT);
-
-    parm.type = G_define_option();
-    parm.type->key = "type";
-    parm.type->type = TYPE_STRING;
-    parm.type->required = NO;
-    parm.type->options = "CELL,FCELL,DCELL";
-    parm.type->answer = "FCELL";
-    parm.type->description = _("Storage type for resultant raster map");
-
-    parm.title = G_define_option();
-    parm.title->key = "title";
-    parm.title->key_desc = "phrase";
-    parm.title->type = TYPE_STRING;
-    parm.title->required = NO;
-    parm.title->description = _("Title for resultant raster map");
-
-    parm.mult = G_define_option();
-    parm.mult->key = "mult";
-    parm.mult->type = TYPE_DOUBLE;
-    parm.mult->answer = "1.0";
-    parm.mult->required = NO;
-    parm.mult->description = _("Multiplier for ASCII data");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-    input = parm.input->answer;
-    output = parm.output->answer;
-    title = parm.title->answer;
-    if (title)
-	G_strip(title);
-
-    sscanf(parm.mult->answer, "%lf", &mult_fact);
-    if (strcmp("CELL", parm.type->answer) == 0)
-	rtype = CELL_TYPE;
-    else if (strcmp("DCELL", parm.type->answer) == 0)
-	rtype = DCELL_TYPE;
-    else
-	rtype = FCELL_TYPE;
-
-    if (strcmp("-", input) == 0) {
-	Tmp_file = G_tempfile();
-	if (NULL == (Tmp_fd = fopen(Tmp_file, "w+")))
-	    G_fatal_error(_("Unable to open temporary file <%s>"), Tmp_file);
-	unlink(Tmp_file);
-	if (0 > file_cpy(stdin, Tmp_fd))
-	    exit(EXIT_FAILURE);
-	fd = Tmp_fd;
-    }
-    else
-	fd = fopen(input, "r");
-
-    if (fd == NULL)
-	G_fatal_error(_("Unable to open input file <%s>"), input);
-
-    if (!gethead(fd, &cellhd, &missingval))
-	G_fatal_error(_("Can't get cell header"));
-
-    nrows = cellhd.rows;
-    ncols = cellhd.cols;
-    Rast_set_window(&cellhd);
-
-    if (nrows != Rast_window_rows())
-	G_fatal_error(_("OOPS: rows changed from %d to %d"), nrows,
-		      Rast_window_rows());
-    if (ncols != Rast_window_cols())
-	G_fatal_error(_("OOPS: cols changed from %d to %d"), ncols,
-		      Rast_window_cols());
-
-    switch (rtype) {
-    case CELL_TYPE:
-	cell = Rast_allocate_c_buf();
-	break;
-    case FCELL_TYPE:
-	fcell = Rast_allocate_f_buf();
-	break;
-    case DCELL_TYPE:
-	dcell = Rast_allocate_d_buf();
-	break;
-    }
-    cf = Rast_open_new(output, rtype);
-
-    for (row = 0; row < nrows; row++) {
-	G_percent(row, nrows, 5);
-	for (col = 0; col < ncols; col++) {
-	    if (fscanf(fd, "%lf", &x) != 1) {
-		Rast_unopen(cf);
-		G_fatal_error(_("Data conversion failed at row %d, col %d"),
-			      row + 1, col + 1);
-	    }
-	    switch (rtype) {
-	    case CELL_TYPE:
-		if ((int)x == missingval)
-		    Rast_set_c_null_value(cell + col, 1);
-		else
-		    cell[col] = (CELL) x *mult_fact;
-
-		break;
-	    case FCELL_TYPE:
-		if ((int)x == missingval)
-		    Rast_set_f_null_value(fcell + col, 1);
-		else
-		    fcell[col] = (FCELL) x *mult_fact;
-
-		break;
-	    case DCELL_TYPE:
-		if ((int)x == missingval)
-		    Rast_set_d_null_value(dcell + col, 1);
-		else
-		    dcell[col] = (DCELL) x *mult_fact;
-
-		break;
-	    }
-	}
-	switch (rtype) {
-	case CELL_TYPE:
-	    Rast_put_c_row(cf, cell);
-	    break;
-	case FCELL_TYPE:
-	    Rast_put_f_row(cf, fcell);
-	    break;
-	case DCELL_TYPE:
-	    Rast_put_d_row(cf, dcell);
-	    break;
-	}
-    }
-    /* G_message(_("CREATING SUPPORT FILES FOR %s"), output); */
-    Rast_close(cf);
-    if (title)
-	Rast_put_cell_title(output, title);
-    Rast_short_history(output, "raster", &history);
-    Rast_command_history(&history);
-    Rast_write_history(output, &history);
-
-
-    exit(EXIT_SUCCESS);
-}
-
-int file_cpy(FILE * from, FILE * to)
-{
-    char buf[BUFSIZ];
-    long size;
-    int written = 0;
-
-    while (1) {
-	size = fread(buf, 1, BUFSIZ, from);
-	if (!size) {
-	    if (written) {
-		fflush(to);
-		G_fseek(to, 0l, 0);
-	    }
-	    return (0);
-	}
-	if (!fwrite(buf, 1, size, to)) {
-	    G_warning(_("Failed to copy file"));
-	    return (-1);
-	}
-	written = 1;
-    }
-    /* NOTREACHED */
-}

+ 0 - 51
raster/r.in.arc/r.in.arc.html

@@ -1,51 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>r.in.arc</em> allows a user to create a (binary) GRASS raster map layer
-from an ESRI ARC/INFO ascii GRID file with (optional) title.
-
-<p>
-The ARC/INFO ascii GRID file header has 6 lines (last line optional):
-<div class="code"><pre>
-     ncols:
-     nrows:
-     xllcorner:
-     yllcorner:
-     cellsize:
-     nodata_value:
-</pre></div>
-
-or alternatively (not supported by <em>r.in.arc</em>, but by
-<i><a href=r.in.gdal.html>r.in.gdal</a></i>, last line optional):
-
-<div class="code"><pre>
-     ncols:
-     nrows:
-     xllcenter:
-     yllcenter:
-     cellsize:
-     nodata_value:
-</pre></div>
-
-<h2>NOTES</h2>
-
-<em>r.in.arc</em> handles floating point cell values. The <b>mult</b>
-option allows the number of significant figures of a floating point cell
-to be increased before importing. Multiples of ten are the most functional
-multipliers.
-
-<h2>EXAMPLE</h2>
-
-To import a ARC/INFO ascii grid, applying a 10x multiplier during import, with title:
-<div class="code"><pre>
-r.in.arc input=elev_meters.asc output=elev_decimeters title="Elevation data converted to decimeters" mult=10
-</pre></div>
-
-<h2>SEE ALSO</h2>
-
-<i><a href="r.in.gdal.html">r.in.gdal</a></i>
-<i><a href="r.out.arc.html">r.out.arc</a></i>
-
-<h2>AUTHOR</h2>
-Unknown German author, updated by Bill Brown to floating point support.
-
-<p><i>Last changed: $Date$</i>

+ 2 - 3
raster/r.in.ascii/r.in.ascii.html

@@ -63,7 +63,7 @@ types using the <b>-i</b>, <b>-f</b>, and <b>-d</b> flags, respectively.
 <p>
 The header information in ESRI Raster ASCII files differs from GRASS.  
 To convert an Arc/Info (ArcView) ASCII grid file into GRASS, see 
-<em><a href="r.in.arc.html">r.in.arc</a></em>.
+<em><a href="r.in.gdal.html">r.in.gdal</a></em>.
 
 <p>
 SURFER (Golden Software) ASCII files may be imported by passing the <b>-s</b> flag.
@@ -97,9 +97,8 @@ null:                      -9999
 
 <em>
 <a href="r.out.ascii.html">r.out.ascii</a>,
-<a href="r.in.arc.html">r.in.arc</a>, 
 <a href="r.in.gdal.html">r.in.gdal</a>, 
-<a href="r.out.arc.html">r.out.arc</a>,
+<a href="r.out.gdal.html">r.out.gdal</a>,
 <a href="r.in.bin.html">r.in.bin</a>,
 <a href="r3.in.ascii.html">r3.in.ascii</a>,
 <a href="http://grass.osgeo.org/gdp/html_grass5/ascii_formats.html">GRASS ASCII formats</a>

+ 6 - 7
raster/r.in.bin/r.in.bin.html

@@ -17,8 +17,9 @@ If the bytes field is entered incorrectly an error will be generated
 suggesting a closer bytes value. 
 
 <p><em>r.in.bin</em> can be used to import numerous binary arrays including:
-ETOPO30, ETOPO-5, ETOPO-2, Globe DEM, BIL, AVHRR and GMT binary arrays (ID 1 &amp; 2)
-<p>
+ETOPO30, ETOPO-5, ETOPO-2, Globe DEM, BIL, AVHRR and GMT binary arrays
+(ID 1 &amp; 2).
+
 <h2>NOTES</h2>
 
 If optional parameters are not supplied, <b>r.in.bin</b> attempts
@@ -77,7 +78,6 @@ The following is a sample call of <em>r.in.bin</em> to import an AVHRR image:
 r.in.bin in=p07_b6.dat out=avhrr c=128 r=128
 </pre></div>
 
-
 <h3>ETOPO2</h3>
 The following is a sample call of <em>r.in.bin</em> to import 
 <a href="http://www.ngdc.noaa.gov/mgg/image/2minrelief.html">ETOPO2 DEM</a> data (here full data set):
@@ -121,10 +121,8 @@ r.in.bin in=gpcp_v2.2_psg.1979 out=gpcp_1979. \
 
 <em>
 <a href="r.out.bin.html">r.out.bin</a>,
-<a href="r.in.ascii.html">r.in.ascii</a>, 
-<a href="r.out.ascii.html">r.out.ascii</a>, 
-<a href="r.in.arc.html">r.in.arc</a>, 
-<a href="r.out.arc.html">r.out.arc</a>,
+<a href="r.in.ascii.html">r.in.ascii</a>,
+<a href="r.out.ascii.html">r.out.ascii</a>,
 <a href="r.in.gdal.html">r.in.gdal</a>,
 <a href="r.out.gdal.html">r.out.gdal</a>,
 <a href="r.in.srtm.html">r.in.srtm</a>
@@ -136,4 +134,5 @@ Jacques Bouchard, France (bouchard@onera.fr)<br>
 Bob Covill, Canada (bcovill@tekmap.ns.ca)<br>
 Markus Metz<br>
 Man page: Zsolt Felker (felker@c160.pki.matav.hu)
+
 <p><i>Last changed: $Date$</i>

+ 0 - 1
raster/r.in.gdal/r.in.gdal.html

@@ -311,7 +311,6 @@ r.in.gdal HDF4_EOS:EOS_GRID:"MOD15A2.A2003153.h18v04.004.2003171141042.hdf":MOD_
 <em>
 <a href="r.colors.html">r.colors</a>,
 <a href="r.in.ascii.html">r.in.ascii</a>,
-<a href="r.in.arc.html">r.in.arc</a>,
 <a href="r.in.bin.html">r.in.bin</a>,
 <a href="r.null.html">r.null</a>
 </em>

+ 0 - 11
raster/r.out.arc/Makefile

@@ -1,11 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = r.out.arc
-
-LIBES = $(RASTERLIB) $(GISLIB)
-DEPENDENCIES = $(RASTERDEP) $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-
-default: cmd

+ 0 - 216
raster/r.out.arc/main.c

@@ -1,216 +0,0 @@
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-#include <stdio.h>
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include <grass/glocale.h>
-
-/*
- ****************************************************************************
- *
- * MODULE:       r.out.arc
- * AUTHOR(S):    Original author: Michael Shapiro (r.out.ascii)
- *               modified to r.out.arc by Markus Neteler, Univ. of Hannover
- *               neteler geog.uni-hannover.de (11/99)
- * PURPOSE:      r.out.arc: writes ARC/INFO ASCII GRID file
- * COPYRIGHT:    (C) 2000 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *              License (>=v2). Read the file COPYING that comes with GRASS
- *              for details.
- *
- *****************************************************************************/
-
-int main(int argc, char *argv[])
-{
-    void *raster, *ptr;
-
-    /*
-       char  *null_row;
-     */
-    RASTER_MAP_TYPE out_type, map_type;
-    char *outfile;
-    char null_str[80];
-    char cell_buf[300];
-    int fd;
-    int row, col;
-    int nrows, ncols, dp;
-    int do_stdout;
-    FILE *fp;
-    double cellsize;
-    struct GModule *module;
-    struct
-    {
-	struct Option *map;
-	struct Option *output;
-	struct Option *dp;
-	struct Option *null;
-    } parm;
-    struct
-    {
-	struct Flag *noheader;
-	struct Flag *singleline;
-	struct Flag *ccenter;
-    } flag;
-
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("raster"));
-    G_add_keyword(_("export"));
-    G_add_keyword("ASCII");
-    module->description =
-	_("Converts a raster map layer into an ESRI ARCGRID file.");
-
-    /* Define the different options */
-    parm.map = G_define_standard_option(G_OPT_R_INPUT);
-
-    parm.output = G_define_standard_option(G_OPT_F_OUTPUT);
-    parm.output->description =
-	_("Name for output ARC-GRID file (use out=- for stdout)");
-
-    parm.dp = G_define_option();
-    parm.dp->key = "dp";
-    parm.dp->type = TYPE_INTEGER;
-    parm.dp->required = NO;
-    parm.dp->answer = "8";
-    parm.dp->description = _("Number of decimal places");
-
-    flag.noheader = G_define_flag();
-    flag.noheader->key = 'h';
-    flag.noheader->description = _("Suppress printing of header information");
-
-    /* Added to optionally produce a single line output.     -- emes -- 12.10.92 */
-    flag.singleline = G_define_flag();
-    flag.singleline->key = '1';
-    flag.singleline->description =
-	_("List one entry per line instead of full row");
-
-    /* use cell center in header instead of cell corner */
-    flag.ccenter = G_define_flag();
-    flag.ccenter->key = 'c';
-    flag.ccenter->description =
-	_("Use cell center reference in header instead of cell corner");
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-
-    sscanf(parm.dp->answer, "%d", &dp);
-    if (dp > 20 || dp < 0)
-	G_fatal_error("dp has to be from 0 to 20");
-
-    outfile = parm.output->answer;
-    if ((strcmp("-", outfile)) == 0)
-	do_stdout = 1;
-    else
-	do_stdout = 0;
-
-    sprintf(null_str, "-9999");
-
-    fd = Rast_open_old(parm.map->answer, "");
-
-    map_type = Rast_get_map_type(fd);
-    out_type = map_type;
-
-    /*
-       null_row = Rast_allocate_null_buf();
-     */
-    raster = Rast_allocate_buf(out_type);
-
-    nrows = Rast_window_rows();
-    ncols = Rast_window_cols();
-
-    /* open arc file for writing */
-    if (do_stdout)
-	fp = stdout;
-    else if (NULL == (fp = fopen(outfile, "w")))
-	G_fatal_error(_("Unable to open file <%s>"), outfile);
-
-    if (!flag.noheader->answer) {
-	struct Cell_head region;
-	char buf[128];
-
-	G_get_window(&region);
-	fprintf(fp, "ncols %d\n", region.cols);
-	fprintf(fp, "nrows %d\n", region.rows);
-	cellsize = fabs(region.east - region.west) / region.cols;
-
-	if (G_projection() != PROJECTION_LL) {	/* Is Projection != LL (3) */
-	    if (!flag.ccenter->answer) {
-		G_format_easting(region.west, buf, region.proj);
-		fprintf(fp, "xllcorner %s\n", buf);
-		G_format_northing(region.south, buf, region.proj);
-		fprintf(fp, "yllcorner %s\n", buf);
-	    }
-	    else {
-		G_format_easting(region.west + cellsize / 2., buf, region.proj);
-		fprintf(fp, "xllcenter %s\n", buf);
-		G_format_northing(region.south + cellsize / 2., buf, region.proj);
-		fprintf(fp, "yllcenter %s\n", buf);
-	    }
-	}
-	else {			/* yes, lat/long */
-	    G_format_easting(region.west, buf, -1);
-	    fprintf(fp, "xllcorner %s\n", buf);
-
-	    G_format_northing(region.south, buf, -1);
-	    fprintf(fp, "yllcorner %s\n", buf);
-	}
-
-	G_format_resolution(cellsize, buf, -1);
-	fprintf(fp, "cellsize %s\n", buf);
-	fprintf(fp, "NODATA_value %s\n", null_str);
-    }
-
-    for (row = 0; row < nrows; row++) {
-	G_percent(row, nrows, 2);
-	Rast_get_row(fd, raster, row, out_type);
-	/*
-	   Rast_get_null_value_row(fd, null_row, row);
-	 */
-	for (col = 0, ptr = raster; col < ncols; col++,
-	     ptr = G_incr_void_ptr(ptr, Rast_cell_size(out_type))) {
-	    if (!Rast_is_null_value(ptr, out_type)) {
-		if (out_type == CELL_TYPE)
-		    fprintf(fp, "%d", *((CELL *) ptr));
-
-		else if (out_type == FCELL_TYPE) {
-		    sprintf(cell_buf, "%.*f", dp, *((FCELL *) ptr));
-		    G_trim_decimal(cell_buf);
-		    fprintf(fp, "%s", cell_buf);
-		}
-		else if (out_type == DCELL_TYPE) {
-		    sprintf(cell_buf, "%.*f", dp, *((DCELL *) ptr));
-		    G_trim_decimal(cell_buf);
-		    fprintf(fp, "%s", cell_buf);
-		}
-	    }
-	    else
-		fprintf(fp, "%s", null_str);
-
-	    if (!flag.singleline->answer)
-		fprintf(fp, " ");
-	    else
-		fprintf(fp, "\n");
-	}
-
-	if (!flag.singleline->answer)
-	    fprintf(fp, "\n");
-
-	/*
-	   for (col = 0; col < ncols; col++)
-	   fprintf (fp,"%d ", null_row[col]);
-	   fprintf (fp,"\n");
-	 */
-    }
-
-    /* make sure it got to 100% */
-    G_percent(1, 1, 2);
-
-    Rast_close(fd);
-    fclose(fp);
-
-    exit(EXIT_SUCCESS);
-}

+ 0 - 54
raster/r.out.arc/r.out.arc.html

@@ -1,54 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>r.out.arc</em> converts a user-specified raster map layer
-(<b>input=</b><em>name</em>) into an ESRI ARC-GRID ascii file
-(<b>output=</b><em>name</em>) suitable for export to other computer systems. 
-The dp=<em>value</em> option (where <em>value</em> is a number of the user's
-choice) can be used to request that numbers after decimal points are
-limited.  However, to use this, the user should know the maximum number of
-digits that will occur in the output file.  The user can find the maximum
-number of digits occurring in the output file by running <em>r.out.arc</em>
-without the <b>dp=</b><em>value</em> option.
-
-
-<p>
-The GRASS program <em><a href="r.in.arc.html">r.in.arc</a></em> can be used
-to perform the reverse function, converting an ESRI ARC-GRID ascii file in
-suitable format to GRASS raster map format. The order of cell values in
-file is from lower left to upper right (reverse to GRASS).
-
-<h2>NOTES</h2>
-
-The output from <em>r.out.arc</em> may also be placed into a file
-by using the UNIX redirection mechanism;  e.g.:
-
-<div class="code"><pre>
-r.out.arc input=soils output=- &gt; out.grd
-</pre></div>
-
-The output file <em>out.grd</em> can then be copied
-onto a CDROM or floppy disk for export purposes.
-
-<p><br>
-An Arc ASCII grid can be loaded into ArcGIS 8.3 though ArcToolbox.<br>
-Use the "Import to Raster" -> "ASCII to Grid" tool to create a binary grid 
-which can be selected using ArcCatalog. The spatial analyst extension may 
-need to be installed and activated within Arc.
-<p>In ArcGIS 9.0 the import tool can be found at:<br>
-ArcMap -> Toolbox -> Conversion Tools -> To Raster -> ASCII to Raster
-<p>A GeoTIFF created with <em><a href="r.out.gdal.html">r.out.gdal</a></em> is
-sometimes a better solution for transferring raster maps to other GIS software.
-<p><h2>SEE ALSO</h2>
-
-<em><a href="r.in.arc.html">r.in.arc</a></em><br>
-<em><a href="r.out.gdal.html">r.out.gdal</a></em><br>
-
-
-<h2>AUTHOR</h2>
-
-Markus Neteler, University of Hannover, Germany, <br>
-based on r.out.ascii written by <br>
-Michael Shapiro,
-U.S.Army Construction Engineering Research Laboratory
-
-<p><i>Last changed: $Date$</i>

+ 1 - 1
raster/r.out.ascii/r.out.ascii.html

@@ -42,7 +42,7 @@ use the <em><a href="r.out.xyz.html">r.out.xyz</a></em> module.
 
 <em>
 <a href="r.in.ascii.html">r.in.ascii</a>,
-<a href="r.in.arc.html">r.in.arc</a>,
+<a href="r.in.gdal.html">r.in.gdal</a>,
 <a href="r.out.bin.html">r.out.bin</a>,
 <a href="r.out.gdal.html">r.out.gdal</a>,
 <a href="r.out.xyz.html">r.out.xyz</a>

+ 6 - 5
raster/r.out.bin/r.out.bin.html

@@ -27,14 +27,15 @@ a float array was output.
 
 <h2>SEE ALSO</h2>
 
-<em><a href="r.in.bin.html">r.in.bin</a>,
-<a href="r.in.ascii.html">r.in.ascii</a> 
+<em>
+<a href="r.in.bin.html">r.in.bin</a>,
+<a href="r.in.ascii.html">r.in.ascii</a>,
+<a href="r.in.gdal.html">r.in.gdal</a>,
 <a href="r.out.ascii.html">r.out.ascii</a>
-<a href="r.in.arc.html">r.in.arc</a>,
-<a href="r.out.arc.html">r.out.arc</a></em>
-
+</em>
 
 <h2>AUTHOR</h2>
+
 This program is derived from <em><a href="r.out.ascii.html">r.out.ascii</a></em> 
 with a few modifications. <br>
 Author: <a href="mailto:bcovill@tekmap.ns.ca">Bob Covill</a>

+ 2 - 7
raster/r.out.gdal/r.out.gdal.html

@@ -229,16 +229,11 @@ page.
 <br>
 <em>
 <a href="r.out.ascii.html">r.out.ascii</a>,
-<a href="r.out.arc.html">r.out.arc</a>,
 <a href="r.out.bin.html">r.out.bin</a>,
 <a href="r.out.mat.html">r.out.mat</a>,
 <a href="r.out.png.html">r.out.png</a>,
-<a href="r.out.ppm.html">r.out.ppm</a>,
-<a href="r.out.tiff.html">r.out.tiff</a>
-<br>
-<a href="r.out.gdal.sh.html">r.out.gdal.sh</a></em>
- (old shell script version using <tt>gdal_translate</tt>)
-
+<a href="r.out.ppm.html">r.out.ppm</a>
+</em>
 
 <h2>REFERENCES</h2>
 

+ 0 - 1
raster/r.out.png/r.out.png.html

@@ -15,7 +15,6 @@ file will be called <tt>png_map.wld</tt>.
 <em>
 <a href="r.out.gdal.html">r.out.gdal</a>,
 <a href="r.out.ppm.html">r.out.ppm</a>,
-<a href="r.out.tiff.html">r.out.tiff</a>,
 <a href="r.out.ascii.html">r.out.ascii</a>,
 <a href="r.in.png.html">r.in.png</a>
 </em>

+ 10 - 7
raster/r.out.ppm/r.out.ppm.html

@@ -12,7 +12,8 @@ before running <em>r.out.ppm</em>.<p>
 By default the PPM file created is 24-bit color, rawbits storage.
 You can use the <b>-g</b> flag to force <em>r.out.ppm</em> to 
 output an 8-bit greyscale instead.
-The greyscale conversion uses the NTSC conversion:<p>
+The greyscale conversion uses the NTSC conversion:
+<p>
 <div class="code"><pre>
 Y = .30*Red + .59*Green + .11*Blue
 </pre></div>
@@ -42,12 +43,14 @@ pnmtopng -transparent white raster.ppm > raster.png
 </pre></div>
 
 <h2>SEE ALSO</h2>
-<em><a href="d.out.png.html">d.out.png</a></em><br>
-<em><a href="r.out.ascii.html">r.out.ascii</a></em><br>
-<em><a href="r.out.mpeg.html">r.out.mpeg</a></em><br>
-<em><a href="r.out.png.html">r.out.png</a></em><br>
-<em><a href="r.out.ppm3.html">r.out.ppm3</a></em><br>
-<em><a href="r.out.tiff.html">r.out.tiff</a></em>
+<em>
+<a href="d.out.file.html">d.out.file</a>,
+<a href="r.out.ascii.html">r.out.ascii</a>,
+<a href="r.out.gdal.html">r.out.gdal</a>,
+<a href="r.out.mpeg.html">r.out.mpeg</a>,
+<a href="r.out.png.html">r.out.png</a>,
+<a href="r.out.ppm3.html">r.out.ppm3</a>
+</em>
  
 <h2>AUTHOR</h2>
 

+ 0 - 14
raster/r.out.tiff/Makefile

@@ -1,14 +0,0 @@
-MODULE_TOPDIR = ../..
-
-PGM = r.out.tiff
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-EXTRA_CFLAGS = $(TIFFINCPATH)
-
-LIBES = $(RASTERLIB) $(GISLIB) $(TIFFLIBPATH) $(TIFFLIB)
-DEPENDENCIES = $(RASTERDEP) $(GISDEP)
-
-ifneq ($(strip $(TIFFLIBPATH) $(TIFFLIB)),)
-default: cmd
-endif

+ 0 - 437
raster/r.out.tiff/main.c

@@ -1,437 +0,0 @@
-
-/****************************************************************************
- *
- * MODULE:       r.out.tiff
- *   
- * AUTHOR(S):    Sam Leffler
- *               Updated by Marco Valagussa <marco duffy.crcc.it>,
- *               Markus Neteler, Eric G. Miller, Luca Cristelli
- *
- * PURPOSE:      Exports a GRASS raster map to a 8/24bit TIFF image file
- *               at the pixel resolution of the currently defined region.
-
- * COPYRIGHT:    (C) 1999-2007 by the GRASS Development Team
- *
- *               This program is free software under the GNU General Public
- *               License (>=v2). Read the file COPYING that comes with GRASS
- *               for details.
- *
- *****************************************************************************/
-/* 
- * Added support for Tiled TIFF output ( -l switch )
- * Luca Cristelli (luca.cristelli ies.it) 1/2001
- * 
- * Added flag to write a TIFF World file like r.out.arctiff
- * Eric G. Miller 4-Nov-2000
- *
- * Corrected Rast_set_window to G_get_window to make r.out.tiff sensitive
- * to region settings.   - Markus Neteler  (neteler geog.uni-hannover.de
- * 8/98        
- *
- * This r.tiff version uses the standard libtiff from your system.
- *  8. June 98 Marco Valagussa <marco duffy.crcc.it>
- *
- * Original version:
- * Portions Copyright (c) 1988, 1990 by Sam Leffler.
- * All rights reserved.
- *
- * This file is provided for unrestricted use provided that this
- * legend is included on all tape media and as a part of the
- * software program in whole or part.  Users may copy, modify or
- * distribute this file at will.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <float.h>
-#include <sys/types.h>
-#include <tiffio.h>
-#include <grass/gis.h>
-#include <grass/raster.h>
-#include <grass/glocale.h>
-#include "rasterfile.h"
-
-/* global variables */
-
-#define MAX_TILE_LENGTH 512
-
-#undef howmany
-#define	howmany(x, y)	(((x)+((y)-1))/(y))
-#define	streq(a,b)	(strcmp(a,b) == 0)
-
-unsigned short config = PLANARCONFIG_CONTIG;
-unsigned short compression = -1;
-unsigned short rowsperstrip = 0;
-
-/* global functions */
-static int write_tfw(const char *, const struct Cell_head *);
-
-int main(int argc, char *argv[])
-{
-    unsigned char *buf, *tmpptr;
-    int row, linebytes;
-    TIFF *out;
-    int in;
-    struct rasterfile h;
-    struct Option *inopt, *outopt, *compopt;
-    struct Flag *pflag, *lflag, *wflag; /* *tflag, */
-    CELL *cell, *cellptr, *cells[MAX_TILE_LENGTH];
-    struct Cell_head cellhd;
-    struct GModule *module;
-    int col, tfw, palette, tiled;
-    char *basename, *filename;
-    struct Colors colors;
-    int red, grn, blu, mapsize, isfp;
-/*    int do_alpha; */
-
-    G_gisinit(argv[0]);
-
-    /* Set description */
-    module = G_define_module();
-    G_add_keyword(_("raster"));
-    G_add_keyword(_("export"));
-    module->description =
-	_("Exports a GRASS raster map to a 8/24bit TIFF image file.");
-
-    inopt = G_define_standard_option(G_OPT_R_INPUT);
-
-    outopt = G_define_standard_option(G_OPT_F_OUTPUT);
-    outopt->required = YES;
-    outopt->gisprompt = "new,bin,file";
-    outopt->description = _("Name for output TIFF file");
-
-    compopt = G_define_option();
-    compopt->key = "compression";
-    compopt->type = TYPE_STRING;
-    compopt->required = NO;
-    compopt->options = "none,packbit,deflate,lzw";
-    compopt->description = _("TIFF file compression");
-    compopt->answer = "none";
-
-    pflag = G_define_flag();
-    pflag->key = 'p';
-    pflag->description = _("TIFF Palette output (8bit instead of 24bit).");
-
-/* TODO (copy method from r.out.png)
-    tflag = G_define_flag();
-    tflag->key = 't';
-    tflag->description = _("Make NULL cells transparent");
-*/
-    wflag = G_define_flag();
-    wflag->key = 'w';
-    wflag->description = _("Output TIFF world file");
-
-    lflag = G_define_flag();
-    lflag->key = 'l';
-    lflag->description = _("Output Tiled TIFF");
-
-/*todo?   bgcolor = G_define_standard_option(G_OPT_C_BG); */
-
-    /*todo:
-     * gscale = G_define_flag ();
-     * gscale->key = 'g';
-     * gscale->description = "Output greyscale instead of color";
-     */
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    if (strncmp(compopt->answer, "packbit", 7) == 0)
-	compression = COMPRESSION_PACKBITS;
-    else if (strncmp(compopt->answer, "deflate", 7) == 0)
-	compression = COMPRESSION_DEFLATE;
-    else if (strncmp(compopt->answer, "lzw", 3) == 0)
-	compression = COMPRESSION_LZW;
-    else
-	compression = COMPRESSION_NONE;
-
-    tiled = lflag->answer;
-    palette = pflag->answer;
-    tfw = wflag->answer;
-
-/*
-    if(alpha->answer && pflag->answer)
-	G_fatal_error(_("Palletted images do not support transparency."));
-    do_alpha = alpha->answer ? TRUE : FALSE;
-*/
-#ifdef MAYBE_LATER
-    /* ... if at all */
-    ret = G_str_to_color(bgcolor->answer, &def_red, &def_grn, &def_blu);
-    if (ret == 0)
-	G_fatal_error(_("[%s]: No such color"), bgcolor->answer);
-    else if (ret == 2) {  /* (ret==2) is "none" */
-	if(!do_alpha)
-	    do_alpha = TRUE;
-    }
-#endif
-
-    Rast_get_cellhd(inopt->answer, "", &cellhd);
-
-    G_get_window(&cellhd);
-
-    Rast_read_colors(inopt->answer, "", &colors);
-    if ((isfp = Rast_map_is_fp(inopt->answer, "")))
-	G_warning(_("Raster map <%s>> is a floating point "
-		    "map. Fractional values will be rounded to integer"),
-		  inopt->answer);
-
-    Rast_set_null_value_color(255, 255, 255, &colors);
-    if (palette && (colors.cmax - colors.cmin > 255))
-	G_fatal_error(_("Color map for palette must have less "
-			"than 256 colors for the available range of data"));
-
-    cell = Rast_allocate_c_buf();
-    in = Rast_open_old(inopt->answer, "");
-
-    basename = G_store(outopt->answer);
-    G_basename(basename, "tiff");
-    G_basename(basename, "tif");
-    filename = G_malloc(strlen(basename) + 5);
-    sprintf(filename, "%s.tif", basename);
-
-    out = TIFFOpen(filename, "w");
-    if (out == NULL)
-	G_fatal_error(_("Unable to open TIFF file <%s>"), filename);
-
-    h.ras_width = cellhd.cols;
-    h.ras_height = cellhd.rows;
-    h.ras_depth = 24;
-    if (pflag->answer)
-	h.ras_depth = 8;
-
-    TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, h.ras_depth > 8 ? 3 : 1);
-/*
-    if(do_alpha) {
-	h.ras_depth = 32;
-	uint16 extras[] = { EXTRASAMPLE_ASSOCALPHA };
-	TIFFSetField(out, TIFFTAG_EXTRASAMPLES, 1, extras);
-	// ? -or- ?
-	TIFFSetField(out, TIFFTAG_EXTRASAMPLES, EXTRASAMPLE_ASSOCALPHA);
-	TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 4);
-    }
-*/
-    TIFFSetField(out, TIFFTAG_IMAGEWIDTH, h.ras_width);
-    TIFFSetField(out, TIFFTAG_IMAGELENGTH, h.ras_height);
-    TIFFSetField(out, TIFFTAG_ORIENTATION, ORIENTATION_TOPLEFT);
-    TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, h.ras_depth > 1 ? 8 : 1);
-    TIFFSetField(out, TIFFTAG_PLANARCONFIG, config);
-    mapsize = 1 << h.ras_depth;
-
-    if (palette) {
-	unsigned short *redp, *grnp, *blup, *mapptr;
-	int i;
-
-	G_debug(1, "max %f min %f mapsize %d",
-		colors.cmax, colors.cmin, mapsize);
-
-	mapptr = (unsigned short *) G_calloc(mapsize * 3, sizeof(unsigned short));
-	redp = mapptr;
-	grnp = redp + mapsize;
-	blup = redp + mapsize * 2;
-
-	/* XXX -- set pointers up before we step through arrays */
-#define	SCALE(x)	(((x)*((1L<<16)-1))/255)
-
-	for (i = colors.cmin; i <= colors.cmax; i++, redp++, grnp++, blup++) {
-	    Rast_get_c_color(&i, &red, &grn, &blu, &colors);
-	    *redp = (unsigned short) (SCALE(red));
-	    *grnp = (unsigned short) (SCALE(grn));
-	    *blup = (unsigned short) (SCALE(blu));
-
-	    G_debug(1, " %d : %d %d %d   %d %d %d",
-		    i, red, grn, blu, *redp, *grnp, *blup);
-	}
-
-	TIFFSetField(out, TIFFTAG_COLORMAP,
-		     mapptr, mapptr + mapsize, mapptr + mapsize * 2);
-	TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_PALETTE);
-	TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
-    }
-    else {
-	/* XXX this is bogus... */
-	TIFFSetField(out, TIFFTAG_PHOTOMETRIC, h.ras_depth == 24 ?
-		     PHOTOMETRIC_RGB : PHOTOMETRIC_MINISBLACK);
-	TIFFSetField(out, TIFFTAG_COMPRESSION, compression);
-    }
-
-    if (tiled) {
-	int tilewidth = 128;
-	int tilelength = 128;
-	int imagewidth, imagelength;
-	int spp;
-	char *obuf;
-	char *tptr;
-	uint32 col, oskew, width, i, j;
-
-	imagewidth = h.ras_width;
-	imagelength = h.ras_height;
-	spp = h.ras_depth;
-
-	TIFFSetField(out, TIFFTAG_TILEWIDTH, tilewidth);
-	TIFFSetField(out, TIFFTAG_TILELENGTH, tilelength);
-	obuf = (char *)_TIFFmalloc(TIFFTileSize(out));
-
-	G_debug(1, "Tile buff size: %d", TIFFTileSize(out));
-
-	/* allocate cell buffers */
-	for (i = 0; i < tilelength; i++)
-	    cells[i] = Rast_allocate_c_buf();
-
-	/* build tiff tiles from grass buffer */
-	for (row = 0; row < imagelength; row += tilelength) {
-	    uint32 nrow =
-		(row + tilelength >
-		 imagelength) ? imagelength - row : tilelength;
-	    uint32 colb = 0;
-
-	    for (i = 0; i < nrow; i++)
-		Rast_get_c_row(in, cells[i], row + i);
-
-	    for (col = 0; col < imagewidth; col += tilewidth) {
-		tsample_t s;
-
-		i = nrow;
-		tptr = obuf;
-		spp = 1;
-		s = 0;
-		oskew = 0;
-		width = tilewidth;
-
-		G_debug(1, "Tile #: r %d, c %d, s %d", row, col, s);
-
-		/*
-		 * Tile is clipped horizontally.  Calculate
-		 * visible portion and skewing factors.
-		 */
-		if (colb + tilewidth > imagewidth) {
-		    width = (imagewidth - colb);
-		    oskew = tilewidth - width;
-		}
-
-		for (i = 0; i < nrow; i++) {
-		    cellptr = cells[i];
-
-		    if (palette) {
-			cellptr += col;
-			for (j = 0; j < width; j++)
-			    *tptr++ = (unsigned char) * cellptr++;
-
-			tptr += oskew;
-		    }
-		    else {
-			for (j = 0; j < width; j++) {
-			    Rast_get_c_color(&(cellptr[col + j]), &red, &grn, &blu,
-					     &colors);
-			    *tptr++ = (unsigned char) red;
-			    *tptr++ = (unsigned char) grn;
-			    *tptr++ = (unsigned char) blu;
-			}
-
-			tptr += oskew * 3;
-		    }
-
-		    G_debug(3, "row #: i %d tptr %lx", i, (long)tptr);
-		}
-
-		G_debug(1, "Write Tile #: col %d row %d s %d", col, row, s);
-
-		if (TIFFWriteTile(out, obuf, col, row, 0, s) < 0) {
-		    _TIFFfree(obuf);
-		    return (-1);
-		}
-
-		G_percent(row, h.ras_height, 1);
-	    }
-
-	    colb += tilewidth;
-	}
-    }
-    else {
-	linebytes = ((h.ras_depth * h.ras_width + 15) >> 3) & ~1;
-
-	G_debug(1, "linebytes = %d, TIFFscanlinesize = %d", linebytes,
-		TIFFScanlineSize(out));
-
-	if (TIFFScanlineSize(out) > linebytes)
-	    buf = (unsigned char *) G_malloc(linebytes);
-	else
-	    buf = (unsigned char *) G_malloc(TIFFScanlineSize(out));
-
-	if (rowsperstrip != (unsigned short) - 1)
-	    rowsperstrip = (unsigned short) (8 * 1024 / linebytes);
-
-	G_debug(1, "rowsperstrip = %d", rowsperstrip);
-
-	TIFFSetField(out, TIFFTAG_ROWSPERSTRIP,
-		     rowsperstrip == 0 ? 1 : rowsperstrip);
-
-	for (row = 0; row < h.ras_height; row++) {
-	    tmpptr = buf;
-
-	    G_percent(row, h.ras_height, 2);
-
-	    Rast_get_c_row(in, cell, row);
-
-	    cellptr = cell;
-	    if (palette) {
-		for (col = 0; col < h.ras_width; col++)
-		    *tmpptr++ = (unsigned char) (*cellptr++ - colors.cmin);
-	    }
-	    else {
-		for (col = 0; col < h.ras_width; col++) {
-		    Rast_get_c_color(&(cell[col]), &red, &grn, &blu, &colors);
-		    *tmpptr++ = (unsigned char) red;
-		    *tmpptr++ = (unsigned char) grn;
-		    *tmpptr++ = (unsigned char) blu;
-		}
-	    }
-
-	    if (TIFFWriteScanline(out, buf, row, 0) < 0)
-		break;
-	}
-
-	G_percent(row, h.ras_height, 2);
-    }
-
-    (void)TIFFClose(out);
-
-    if (tfw) {
-	sprintf(filename, "%s.tfw", basename);
-	write_tfw(filename, &cellhd);
-    }
-
-    G_free(filename);
-    G_free(basename);
-
-    G_done_msg(" ");
-
-    exit(EXIT_SUCCESS);
-}
-
-
-static int write_tfw(const char *fname, const struct Cell_head *win)
-{
-    int width = DBL_DIG;
-    FILE *outfile;
-
-    G_message(_("Writing TIFF World file"));
-
-    if (fname == NULL)
-	G_fatal_error(_("Got null file name"));
-    if (win == NULL)
-	G_fatal_error(_("Got null region struct"));
-
-    if ((outfile = fopen(fname, "w")) == NULL)
-	G_fatal_error(_("Unable to open TIFF world file for writing"));
-
-    fprintf(outfile, "%36.*f \n", width, win->ew_res);
-    fprintf(outfile, "%36.*f \n", width, 0.0);
-    fprintf(outfile, "%36.*f \n", width, 0.0);
-    fprintf(outfile, "%36.*f \n", width, -1 * win->ns_res);
-    fprintf(outfile, "%36.*f \n", width, win->west + win->ew_res / 2.0);
-    fprintf(outfile, "%36.*f \n", width, win->north - win->ns_res / 2.0);
-
-    fclose(outfile);
-    return 0;
-}

+ 0 - 39
raster/r.out.tiff/r.out.tiff.html

@@ -1,39 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<p>This program converts a GRASS raster map to a TIFF raster map. Output may
-be 8 or 24 bit (TrueColor).  Optionally, a TIFF World file compatible with
-ESRI's and other's products may be output.
-
-<p>The program prompts the user for the name of a GRASS raster map, an output
-TIFF file, whether an 8 or 24 bit format is desired, and whether or not to
-create a TIFF world file.  Currently only uncompressed, packpit, or deflate
-TIFF files are written.  These output formats are known to be compatible
-with r.in.tiff.
-
-<p>The output filename will always have the suffix <code>.tif</code>, and the Tiff World
-file (if requested) <code>.tfw</code>. Any <code>.tif</code> or
-<code>.tiff</code> suffix (case insensitive) specified in the output filename 
-will be discarded.
-
-<p>When writing with "-l" option, tiles are written at 128x128 pixels.  For
-programs that can utilize tiles, it can help speed up some drawing
-operations.
-
-<p>The user may adjust region and resolution before export using
-<a href="g.region.html">g.region</a>.
-
-<p>A better choice to export GRASS raster data might be
-<a href="r.out.gdal.html">r.out.gdal</a>.
-
-<h2>SEE ALSO</h2>
-
-<em><a href="g.region.html">g.region</a>,</em>
-<em><a href="r.in.gdal.html">r.in.gdal</a>,</em>
-<em><a href="r.out.gdal.html">r.out.gdal</a></em>
-
-<h2>AUTHOR</h2>
-Michael Shapiro,
-U.S. Army Construction Engineering Research Laboratory
-<p>GRASS 5.0 team
-
-<p><i>Last changed: $Date$</i>

+ 0 - 42
raster/r.out.tiff/rasterfile.h

@@ -1,42 +0,0 @@
-
-/*
- * Description of header for files containing raster images
- */
-struct rasterfile
-{
-    int ras_magic;		/* magic number */
-    int ras_width;		/* width (pixels) of image */
-    int ras_height;		/* height (pixels) of image */
-    int ras_depth;		/* depth (1, 8, or 24 bits) of pixel */
-    int ras_length;		/* length (bytes) of image */
-    int ras_type;		/* type of file; see RT_* below */
-    int ras_maptype;		/* type of colormap; see RMT_* below */
-    int ras_maplength;		/* length (bytes) of following map */
-    /* color map follows for ras_maplength bytes, followed by image */
-};
-
-#define	RAS_MAGIC	0x59a66a95
-
-	/* Sun supported ras_type's */
-#define RT_OLD		0	/* Raw pixrect image in 68000 byte order */
-#define RT_STANDARD	1	/* Raw pixrect image in 68000 byte order */
-#define RT_BYTE_ENCODED	2	/* Run-length compression of bytes */
-#define RT_EXPERIMENTAL 0xffff	/* Reserved for testing */
-
-	/* Sun registered ras_maptype's */
-#define RMT_RAW		2
-	/* Sun supported ras_maptype's */
-#define RMT_NONE	0	/* ras_maplength is expected to be 0 */
-#define RMT_EQUAL_RGB	1	/* red[ras_maplength/3],green[],blue[] */
-
-/*
- * NOTES:
- *      Each line of the image is rounded out to a multiple of 16 bits.
- *   This corresponds to the rounding convention used by the memory pixrect
- *   package (/usr/include/pixrect/memvar.h) of the SunWindows system.
- *      The ras_encoding field (always set to 0 by Sun's supported software)
- *   was renamed to ras_length in release 2.0.  As a result, rasterfiles
- *   of type 0 generated by the old software claim to have 0 length; for
- *   compatibility, code reading rasterfiles must be prepared to compute the
- *   true length from the width, height, and depth fields.
- */