Explorar o código

r.le suite (r.le.setup, r.le.trace, r.le.pixel, r.le.patch) moved to Addons

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@62540 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=10) %!d(string=hai) anos
pai
achega
24becd9314
Modificáronse 49 ficheiros con 8 adicións e 19435 borrados
  1. 1 1
      grasslib.dox
  2. 0 11
      gui/wxpython/xml/toolboxes.xml
  3. 0 2
      raster/Makefile
  4. 0 14
      raster/r.le/Makefile
  5. 0 10
      raster/r.le/r.le.patch/Makefile
  6. 0 2881
      raster/r.le/r.le.patch/driver.c
  7. 0 668
      raster/r.le/r.le.patch/input.c
  8. 0 202
      raster/r.le/r.le.patch/main.c
  9. 0 2448
      raster/r.le/r.le.patch/patch.c
  10. 0 169
      raster/r.le/r.le.patch/patch.h
  11. 0 40
      raster/r.le/r.le.patch/r.le.patch.html
  12. 0 1828
      raster/r.le/r.le.patch/trace.c
  13. 0 10
      raster/r.le/r.le.pixel/Makefile
  14. 0 490
      raster/r.le/r.le.pixel/cellclip.c
  15. 0 1851
      raster/r.le/r.le.pixel/driver.c
  16. 0 415
      raster/r.le/r.le.pixel/input.c
  17. 0 1
      raster/r.le/r.le.pixel/local_proto.h
  18. 0 157
      raster/r.le/r.le.pixel/main.c
  19. 0 107
      raster/r.le/r.le.pixel/pixel.h
  20. 0 39
      raster/r.le/r.le.pixel/r.le.pixel.html
  21. 0 1371
      raster/r.le/r.le.pixel/texture.c
  22. 0 14
      raster/r.le/r.le.setup/Makefile
  23. 0 366
      raster/r.le/r.le.setup/ask_group.c
  24. 0 35
      raster/r.le/r.le.setup/colors.h
  25. 0 139
      raster/r.le/r.le.setup/main.c
  26. 0 372
      raster/r.le/r.le.setup/mv_wind.c
  27. 0 24
      raster/r.le/r.le.setup/polytocell/Makefile
  28. 0 1
      raster/r.le/r.le.setup/polytocell/README
  29. 0 110
      raster/r.le/r.le.setup/polytocell/bmf.b
  30. 0 138
      raster/r.le/r.le.setup/polytocell/bmf_to_cll.c
  31. 0 12
      raster/r.le/r.le.setup/polytocell/do_dots.c
  32. 0 159
      raster/r.le/r.le.setup/polytocell/do_line.c
  33. 0 105
      raster/r.le/r.le.setup/polytocell/find_area.c
  34. 0 142
      raster/r.le/r.le.setup/polytocell/ply_t_bmif.c
  35. 0 32
      raster/r.le/r.le.setup/polytocell/ply_to_cll.h
  36. 0 32
      raster/r.le/r.le.setup/polytocell/save_area.c
  37. 0 48
      raster/r.le/r.le.setup/polytocell/wrte_recrd.c
  38. 0 20
      raster/r.le/r.le.setup/polytocell/yadjust.c
  39. 0 471
      raster/r.le/r.le.setup/r.le.setup.html
  40. 0 1762
      raster/r.le/r.le.setup/sample.c
  41. 0 814
      raster/r.le/r.le.setup/setup.c
  42. 0 67
      raster/r.le/r.le.setup/setup.h
  43. 0 10
      raster/r.le/r.le.trace/Makefile
  44. 0 1
      raster/r.le/r.le.trace/local_proto.h
  45. 0 1645
      raster/r.le/r.le.trace/main.c
  46. 0 75
      raster/r.le/r.le.trace/r.le.trace.h
  47. 0 43
      raster/r.le/r.le.trace/r.le.trace.html
  48. 0 75
      raster/r.le/r.le.trace/user_input.c
  49. 7 8
      raster/r.li/r.li.html

+ 1 - 1
grasslib.dox

@@ -51,7 +51,7 @@ href="http://grass.osgeo.org">http://grass.osgeo.org</a>
  - gis: \ref gislib
  - raster: \ref rasterlib
  - vector: \ref vectorlib
- - Temporal GIS API: \ref pythontemporallib
+ - Temporal GIS API: See http://grass.osgeo.org/grass71/manuals/libpython/temporal_framework.html
 
 \section interfaces Interfaces
 

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

@@ -920,17 +920,6 @@
       </module-item>
     </items>
   </toolbox>
-  <toolbox name="LandscapeStructureModeling">
-    <label>Landscape structure modeling</label>
-    <items>
-      <module-item name="r.le.pixel">
-        <label>Analyze landscape</label>
-      </module-item>
-      <module-item name="r.le.patch">
-        <label>Analyze patches</label>
-      </module-item>
-    </items>
-  </toolbox>
   <toolbox name="LandscapePatchAnalysis">
     <label>Landscape patch analysis</label>
     <items>

+ 0 - 2
raster/Makefile

@@ -131,8 +131,6 @@ SUBDIRS = \
 	r.what.color \
 	simwe
 
-#	r.le \
-
 PGM = rasterintro
 
 include $(MODULE_TOPDIR)/include/Make/Dir.make

+ 0 - 14
raster/r.le/Makefile

@@ -1,14 +0,0 @@
-
-MODULE_TOPDIR = ../..
-
-SUBDIRS = \
-	r.le.patch \
-	r.le.pixel \
-	r.le.setup \
-	r.le.trace
-# r.le.setup/polytocell
-
-include $(MODULE_TOPDIR)/include/Make/Dir.make
-
-default: parsubdirs
-

+ 0 - 10
raster/r.le/r.le.patch/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../../..
-
-PGM = r.le.patch
-
-LIBES = $(GISLIB)
-DEPENDENCIES = $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 2881
raster/r.le/r.le.patch/driver.c


+ 0 - 668
raster/r.le/r.le.patch/input.c

@@ -1,668 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.patch/input.c                               *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To analyze attributes of patches in a landscape *
- *         input.c reads the user's requests from the       *
- *         and sets appropriate flags                       *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <grass/config.h>
-#include "patch.h"
-
-
-
-extern struct CHOICE *choice;
-
-void user_input(int argc, char **argv)
-{
-
-    int i, count = 0;
-
-    /* setup the GRASS parsing routine
-       structures to be used to read
-       in the user's parameter choices */
-
-    struct Flag *cor;
-    struct Flag *pat;
-    struct Flag *bound;
-    struct Flag *trace;
-    struct Flag *units;
-    struct Option *name;
-    struct Option *sampling_method;
-    struct Option *region;
-    struct Option *att;
-    struct Option *size;
-    struct Option *edge;
-    struct Option *core;
-    struct Option *shape;
-    struct Option *shape_m;
-    struct Option *boundary;
-    struct Option *perimeter;
-    struct Option *out;
-
-
-    /* use the GRASS parsing routines
-       to read in the user's parameter
-       choices */
-
-    cor = G_define_flag();
-    cor->key = 'c';
-    cor->description =
-	"Output map 'interior' with patch cores (specify co1 & co2)";
-
-    pat = G_define_flag();
-    pat->key = 'n';
-    pat->description = "Output map 'num' with patch numbers";
-
-    bound = G_define_flag();
-    bound->key = 'p';
-    bound->description = "Include sampling area boundary as perimeter";
-
-    trace = G_define_flag();
-    trace->key = 't';
-    trace->description = "Use 4 neighbor instead of 8 neighbor tracing";
-
-    units = G_define_flag();
-    units->key = 'u';
-    units->description =
-	"Output maps 'units_x' with sampling units for each scale x ";
-
-    name = G_define_option();
-    name->key = "map";
-    name->description = "Raster map to be analyzed";
-    name->type = TYPE_STRING;
-    name->gisprompt = "old,cell,raster";
-    name->required = YES;
-
-    sampling_method = G_define_option();
-    sampling_method->answer = "w";
-    sampling_method->key = "sam";
-    sampling_method->description =
-	"Sampling method (choose only 1 method): \n"
-	"\tw = whole map     u = units     m = moving window    r = regions";
-    sampling_method->type = TYPE_STRING;
-    sampling_method->multiple = NO;
-    sampling_method->required = NO;
-
-    region = G_define_option();
-    region->key = "reg";
-    region->description =
-	"Name of regions map, only when sam = r; omit otherwise";
-    region->type = TYPE_STRING;
-    region->gisprompt = "old,cell,raster";
-    region->required = NO;
-
-    att = G_define_option();
-    att->key = "att";
-    att->description = "a1 = mn. pixel att. \t\ta2 = s.d. pixel att.\n"
-	"\ta3 = mn. patch att. \t\ta4 = s.d. patch att.\n"
-	"\ta5 = cover by gp \t\ta6 = density by gp\n"
-	"\ta7 = total density \t\ta8 = eff. mesh number";
-    att->options = "a1,a2,a3,a4,a5,a6,a7,a8";
-    att->type = TYPE_STRING;
-    att->multiple = YES;
-    att->required = NO;
-
-    size = G_define_option();
-    size->key = "siz";
-    size->description = "s1 = mn. patch size\t\ts2 = s.d. patch size\n"
-	"\ts3 = mn. patch size by gp\ts4 = s.d. patch size by gp \n"
-	"\ts5 = no. by size class\t\ts6 = no. by size class by gp\n"
-	"\ts7 = eff. mesh size \t\ts8 = deg. landsc. division";
-    size->options = "s1,s2,s3,s4,s5,s6,s7,s8";
-    size->type = TYPE_STRING;
-    size->multiple = YES;
-    size->required = NO;
-
-    edge = G_define_option();
-    edge->key = "co1";
-    edge->description =
-	"Depth-of-edge-influence in pixels (integer) for use with co2";
-    edge->type = TYPE_INTEGER;
-    edge->required = NO;
-
-    core = G_define_option();
-    core->key = "co2";
-    core->description =
-	"Core size measures (required if co1 was specified):\n"
-	"\tc1 = mn. core size\t\tc2 = s.d. core size\n"
-	"\tc3 = mn. edge size\t\tc4 = s.d. edge size\n"
-	"\tc5 = mn. core size by gp\tc6 = s.d. core size by gp\n"
-	"\tc7 = mn. edge size by gp\tc8 = s.d. edge size by gp\n"
-	"\tc9 = no. by size class\t\tc10 = no. by size class by gp";
-    core->options = "c1,c2,c3,c4,c5,c6,c7,c8,c9,c10";
-    core->type = TYPE_STRING;
-    core->multiple = YES;
-    core->required = NO;
-
-    shape = G_define_option();
-    shape->key = "sh1";
-    shape->description = "Shape index (choose only 1 index):\n"
-	"\tm1 = per./area    m2 = corr. per./area    m3 = rel. circum. circle";
-    shape->type = TYPE_STRING;
-    shape->multiple = NO;
-    shape->required = NO;
-
-    shape_m = G_define_option();
-    shape_m->key = "sh2";
-    shape_m->description = "Shape measures (required if sh1 was specified):\n"
-	"\th1 = mn. patch shape\t\th2 = s.d. patch shape\n"
-	"\th3 = mn. patch shape by gp\th4 = s.d. patch shape by gp\n"
-	"\th5 = no. by shape class \th6 = no. by shape class by gp";
-    shape_m->options = "h1,h2,h3,h4,h5,h6";
-    shape_m->type = TYPE_STRING;
-    shape_m->multiple = YES;
-    shape_m->required = NO;
-
-    boundary = G_define_option();
-    boundary->key = "bnd";
-    boundary->description =
-	"n1 = mn. twist number           n2 = s.d. twist number\n"
-	"\tn3 = mn. omega index            n4 = s.d. omega index";
-    boundary->options = "n1,n2,n3,n4";
-    boundary->type = TYPE_STRING;
-    boundary->multiple = YES;
-    boundary->required = NO;
-
-    perimeter = G_define_option();
-    perimeter->key = "per";
-    perimeter->description =
-	"p1 = sum of perims.\t\tp4 = sum of perims. by gp\n"
-	"\tp2 = mn. per.\t\t\tp5 = mn. per. by gp\n"
-	"\tp3 = s.d. per.\t\t\tp6 = s.d. per. by gp";
-    perimeter->options = "p1,p2,p3,p4,p5,p6";
-    perimeter->type = TYPE_STRING;
-    perimeter->multiple = YES;
-    perimeter->required = NO;
-
-    out = G_define_option();
-    out->key = "out";
-    out->description =
-	"Name of output file for individual patch measures, when sam=w,u,r;\n"
-	"\tif out=head, then column headings will be printed";
-    out->type = TYPE_STRING;
-    out->required = NO;
-
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    /* record the user inputs for map,
-       sam and out parameters */
-
-    strcpy(choice->fn, name->answer);
-
-    choice->wrum = sampling_method->answer[0];
-
-    if (out->answer && choice->wrum != 'm')
-	strcpy(choice->out, out->answer);
-    else if (out->answer && choice->wrum == 'm') {
-	fprintf(stderr, "\n");
-	fprintf(stderr,
-		"   ***************************************************\n");
-	fprintf(stderr,
-		"    You can use the out parameter only when sam=w,u,r \n");
-	fprintf(stderr,
-		"   ***************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-    else
-	strcpy(choice->out, "");
-
-    /* check for unacceptable values for
-       input parameters for sam */
-
-    if (strcmp(sampling_method->answer, "w") &&
-	strcmp(sampling_method->answer, "u") &&
-	strcmp(sampling_method->answer, "m") &&
-	strcmp(sampling_method->answer, "r")) {
-	fprintf(stderr, "\n");
-	fprintf(stderr,
-		"   ***************************************************\n");
-	fprintf(stderr,
-		"    You input an unacceptable value for parameter sam \n");
-	fprintf(stderr,
-		"   ***************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-
-    /* check for unacceptable values for
-       input parameters for sh1 */
-
-    if (shape->answer) {
-	if (strcmp(shape->answer, "m1") &&
-	    strcmp(shape->answer, "m2") && strcmp(shape->answer, "m3")) {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   ***************************************************\n");
-	    fprintf(stderr,
-		    "    You input an unacceptable value for parameter sh1 \n");
-	    fprintf(stderr,
-		    "   ***************************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-    }
-
-    /* check for multiple values for 
-       parameters that accept only 1 */
-
-    if (sampling_method->answer)
-	if (sampling_method->answers[1]) {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   **********************************************\n");
-	    fprintf(stderr,
-		    "    You input multiple values for parameter sam, \n");
-	    fprintf(stderr,
-		    "    but only one is allowed                      \n");
-	    fprintf(stderr,
-		    "   **********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-
-    if (shape->answer)
-	if (shape->answers[1]) {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   **********************************************\n");
-	    fprintf(stderr,
-		    "    You input multiple values for parameter sh1, \n");
-	    fprintf(stderr,
-		    "    but only one is allowed                      \n");
-	    fprintf(stderr,
-		    "   **********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-
-    /* if the core flag -c is specified,
-       then set the choice->coremap flag
-       to 1 */
-
-    choice->coremap = 0;
-    if (!strcmp(sampling_method->answer, "w") && cor->answer)
-	choice->coremap = 1;
-    else if (strcmp(sampling_method->answer, "w") && cor->answer) {
-	fprintf(stderr, "\n");
-	fprintf(stderr,
-		"   ***********************************************\n");
-	fprintf(stderr,
-		"    You requested output of map 'core' with patch \n");
-	fprintf(stderr,
-		"    cores, by using flag -c, but this option      \n");
-	fprintf(stderr,
-		"    is only available when sam=w                  \n");
-	fprintf(stderr,
-		"   ***********************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-    /* if the pat flag -n is specified,
-       then set the choice->coremap flag
-       to 1 */
-
-
-    choice->patchmap = 0;
-    if (!strcmp(sampling_method->answer, "w") && pat->answer)
-	choice->patchmap = 1;
-    else if (strcmp(sampling_method->answer, "w") && pat->answer) {
-	fprintf(stderr, "\n");
-	fprintf(stderr,
-		"   **********************************************\n");
-	fprintf(stderr,
-		"    You requested output of map 'num' with patch \n");
-	fprintf(stderr,
-		"    numbers, by using flag -n, but this option   \n");
-	fprintf(stderr,
-		"    is only available when sam=w                 \n");
-	fprintf(stderr,
-		"   **********************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-
-
-    /* if the 4 neighbor tracing flag -t
-       is specified, then set the
-       choice->trace flag to 0 */
-
-    choice->trace = 1;
-    if (trace->answer)
-	choice->trace = 0;
-
-    /* if the -p flag is specified, then
-       set the choice->perim2 flag to 0 */
-
-    if (bound->answer)
-	choice->perim2 = 0;
-    else
-	choice->perim2 = 1;
-
-    /* if the -u flag is specified, then
-       set the choice->units flag to 1 */
-
-    choice->units = 0;
-    if (!strcmp(sampling_method->answer, "u") && units->answer)
-	choice->units = 1;
-    else if (strcmp(sampling_method->answer, "u") && units->answer) {
-	fprintf(stderr, "\n");
-	fprintf(stderr,
-		"   ***************************************************\n");
-	fprintf(stderr,
-		"    You requested output of map 'units' with sampling \n");
-	fprintf(stderr,
-		"    units, by using flag -u, but this option is only  \n");
-	fprintf(stderr,
-		"    available when sam=u                              \n");
-	fprintf(stderr,
-		"   ***************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-
-    /* if the co1 parameter is specified,
-       then save the value of edge width
-       in choice->edge */
-
-    choice->edge = 0;
-    if (edge->answer) {
-	choice->edge = atoi(edge->answer);
-	if (choice->edge < 0 ||
-	    choice->edge >= Rast_window_rows() ||
-	    choice->edge >= Rast_window_cols()) {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   ***********************************************\n");
-	    fprintf(stderr,
-		    "    You chose values for co1 that are either less \n");
-	    fprintf(stderr,
-		    "    than 0 or too large                           \n");
-	    fprintf(stderr,
-		    "   ***********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-    }
-
-
-    /* if sampling_method is by REGION
-       get region file name.  Check to see
-       that the name was input */
-
-    if (!strcmp(sampling_method->answer, "r")) {
-	if (region->answer)
-	    strcpy(choice->reg, region->answer);
-	else {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   ***********************************************\n");
-	    fprintf(stderr,
-		    "    You requested sampling by region, but did not \n");
-	    fprintf(stderr,
-		    "    input the name of the region using the reg=   \n");
-	    fprintf(stderr,
-		    "    parameter                                     \n");
-	    fprintf(stderr,
-		    "   ***********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-    }
-
-    if (region->answer)
-	if (strcmp(sampling_method->answer, "r")) {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   ***********************************************\n");
-	    fprintf(stderr,
-		    "    You requested sampling by region, by using    \n");
-	    fprintf(stderr,
-		    "    the reg= parameter, but did not input the     \n");
-	    fprintf(stderr,
-		    "    sam=r parameter                               \n");
-	    fprintf(stderr,
-		    "   ***********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-
-    /* initialize flag arrays in choice
-       data structure. */
-
-    for (i = 0; i < 3; i++)
-	choice->Mx[i] = 0;
-    for (i = 0; i < 9; i++)
-	choice->att[i] = 0;
-    for (i = 0; i < 9; i++)
-	choice->size[i] = 0;
-    for (i = 0; i < 11; i++)
-	choice->core[i] = 0;
-    for (i = 0; i < 8; i++)
-	choice->shape[i] = 0;
-    for (i = 0; i < 5; i++)
-	choice->boundary[i] = 0;
-    for (i = 0; i < 8; i++)
-	choice->perim[i] = 0;
-
-
-    if (att->answer) {
-	choice->att[0] = 1;	/* flag for attribute computations. */
-	for (i = 0; att->answers[i] != NULL; i++) {
-	    count++;
-	    if (!strcmp(att->answers[i], "a1"))
-		choice->att[1] = 1;
-	    else if (!strcmp(att->answers[i], "a2"))
-		choice->att[2] = 1;
-	    else if (!strcmp(att->answers[i], "a3"))
-		choice->att[3] = 1;
-	    else if (!strcmp(att->answers[i], "a4"))
-		choice->att[4] = 1;
-	    else if (!strcmp(att->answers[i], "a5"))
-		choice->att[5] = 1;
-	    else if (!strcmp(att->answers[i], "a6"))
-		choice->att[6] = 1;
-	    else if (!strcmp(att->answers[i], "a7"))
-		choice->att[7] = 1;
-	    else if (!strcmp(att->answers[i], "a8"))
-		choice->att[8] = 1;
-	}
-    }
-
-    if (size->answer) {
-	choice->size[0] = 1;	/* flag for size computations. */
-	for (i = 0; size->answers[i] != NULL; i++) {
-	    count++;
-	    if (!strcmp(size->answers[i], "s1"))
-		choice->size[1] = 1;
-	    else if (!strcmp(size->answers[i], "s2"))
-		choice->size[2] = 1;
-	    else if (!strcmp(size->answers[i], "s3"))
-		choice->size[3] = 1;
-	    else if (!strcmp(size->answers[i], "s4"))
-		choice->size[4] = 1;
-	    else if (!strcmp(size->answers[i], "s5"))
-		choice->size[5] = 1;
-	    else if (!strcmp(size->answers[i], "s6")) {
-		choice->size[6] = 1;
-		choice->size2 = 1;
-	    }
-	    else if (!strcmp(size->answers[i], "s7"))
-		choice->size[7] = 1;
-	    else if (!strcmp(size->answers[i], "s8"))
-		choice->size[8] = 1;
-	}
-    }
-
-    if (core->answer || edge->answer || cor->answer) {
-	if (core->answer && edge->answer) {
-	    choice->core[0] = 1;	/* flag for core computations. */
-	    for (i = 0; core->answers[i] != NULL; i++) {
-		count++;
-		if (!strcmp(core->answers[i], "c1"))
-		    choice->core[1] = 1;
-		else if (!strcmp(core->answers[i], "c2"))
-		    choice->core[2] = 1;
-		else if (!strcmp(core->answers[i], "c3"))
-		    choice->core[3] = 1;
-		else if (!strcmp(core->answers[i], "c4"))
-		    choice->core[4] = 1;
-		else if (!strcmp(core->answers[i], "c5"))
-		    choice->core[5] = 1;
-		else if (!strcmp(core->answers[i], "c6"))
-		    choice->core[6] = 1;
-		else if (!strcmp(core->answers[i], "c7"))
-		    choice->core[7] = 1;
-		else if (!strcmp(core->answers[i], "c8"))
-		    choice->core[8] = 1;
-		else if (!strcmp(core->answers[i], "c9"))
-		    choice->core[9] = 1;
-		else if (!strcmp(core->answers[i], "c10")) {
-		    choice->core[10] = 1;
-		    choice->core2 = 1;
-		}
-	    }
-	}
-	else {
-	    if (cor->answer) {
-		fprintf(stderr, "\n");
-		fprintf(stderr,
-			"   ***********************************************\n");
-		fprintf(stderr,
-			"    You requested output of map 'core' with patch \n");
-		fprintf(stderr,
-			"    cores, by using flag -c, but did not input    \n");
-		fprintf(stderr,
-			"    both parameter co1 and co2                    \n");
-		fprintf(stderr,
-			"   ***********************************************\n");
-		exit(EXIT_FAILURE);
-	    }
-	    else {
-		fprintf(stderr, "\n");
-		fprintf(stderr,
-			"   ***********************************************\n");
-		fprintf(stderr,
-			"    You requested core size measures, but did not \n");
-		fprintf(stderr,
-			"    input both parameter co1 and co2              \n");
-		fprintf(stderr,
-			"   ***********************************************\n");
-		exit(EXIT_FAILURE);
-	    }
-	}
-    }
-
-    if (shape->answer || shape_m->answer) {
-	if (shape->answer && shape_m->answer) {
-	    if (!strcmp(shape->answer, "m1"))
-		choice->Mx[1] = 1;
-	    else if (!strcmp(shape->answer, "m2"))
-		choice->Mx[2] = 1;
-	    else if (!strcmp(shape->answer, "m3"))
-		choice->Mx[3] = 1;
-	    choice->shape[0] = 1;	/* flag for shape computations. */
-	    for (i = 0; shape_m->answers[i] != NULL; i++) {
-		count++;
-		if (!strcmp(shape_m->answers[i], "h1"))
-		    choice->shape[1] = 1;
-		else if (!strcmp(shape_m->answers[i], "h2"))
-		    choice->shape[2] = 1;
-		else if (!strcmp(shape_m->answers[i], "h3"))
-		    choice->shape[3] = 1;
-		else if (!strcmp(shape_m->answers[i], "h4"))
-		    choice->shape[4] = 1;
-		else if (!strcmp(shape_m->answers[i], "h5"))
-		    choice->shape[5] = 1;
-		else if (!strcmp(shape_m->answers[i], "h6")) {
-		    choice->shape[6] = 1;
-		    choice->shape2 = 1;
-		}
-	    }
-	}
-	else {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   **********************************************\n");
-	    fprintf(stderr,
-		    "    You requested shape measurement, but did not \n");
-	    fprintf(stderr,
-		    "    input both parameter sh1 and sh2             \n");
-	    fprintf(stderr,
-		    "   **********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-    }
-
-    if (boundary->answer) {
-	choice->boundary[0] = 1;	/* flag for boundary complex. comput. */
-	for (i = 0; boundary->answers[i] != NULL; i++) {
-	    count++;
-	    if (!strcmp(boundary->answers[i], "n1"))
-		choice->boundary[1] = 1;
-	    else if (!strcmp(boundary->answers[i], "n2"))
-		choice->boundary[2] = 1;
-	    else if (!strcmp(boundary->answers[i], "n3"))
-		choice->boundary[3] = 1;
-	    else if (!strcmp(boundary->answers[i], "n4"))
-		choice->boundary[4] = 1;
-	}
-    }
-
-    if (perimeter->answer) {
-	choice->perim[0] = 1;	/* flag for perim. computations. */
-	for (i = 0; perimeter->answers[i] != NULL; i++) {
-	    count++;
-	    if (!strcmp(perimeter->answers[i], "p1"))
-		choice->perim[1] = 1;
-	    else if (!strcmp(perimeter->answers[i], "p2"))
-		choice->perim[2] = 1;
-	    else if (!strcmp(perimeter->answers[i], "p3"))
-		choice->perim[3] = 1;
-	    else if (!strcmp(perimeter->answers[i], "p4"))
-		choice->perim[4] = 1;
-	    else if (!strcmp(perimeter->answers[i], "p5"))
-		choice->perim[5] = 1;
-	    else if (!strcmp(perimeter->answers[i], "p6"))
-		choice->perim[6] = 1;
-	}
-    }
-
-    if (choice->wrum == 'm' && count > 25) {
-	fprintf(stderr, "\n");
-	fprintf(stderr,
-		"   ****************************************************\n");
-	fprintf(stderr,
-		"    You can only choose up to 25 simultaneous measures \n");
-	fprintf(stderr,
-		"    when using sam=m.  Please redo your request.       \n");
-	fprintf(stderr,
-		"   ****************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-    if (!att->answer && !size->answer && !shape->answer && !shape_m->answer
-	&& !boundary->answer && !perimeter->answer && !core->answer) {
-	fprintf(stderr, "\n");
-	fprintf(stderr,
-		"   **************************************************\n");
-	fprintf(stderr,
-		"    You did not select any measures to be calculated \n");
-	fprintf(stderr,
-		"   **************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-    return;
-}

+ 0 - 202
raster/r.le/r.le.patch/main.c

@@ -1,202 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.patch/main.c                                *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To analyze attributes of patches in a landscape *
- *         main.c calls user_input.c to read the user's     *
- *         requests from the screen, then displays those    *
- *         choices on screen and calls patch_fore           *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <grass/gis.h>
-#include <grass/glocale.h>
-
-#include <grass/config.h>
-
-#include "patch.h"
-
-jmp_buf jmp;
-
-struct CHOICE *choice;
-
-
-int main(int argc, char **argv)
-{
-    struct GModule *module;
-
-    /* initialize the GRASS GIS system */
-    G_gisinit(argv[0]);
-
-    /* allocate space for the choice data structure */
-    choice = (struct CHOICE *)G_calloc(1, sizeof(struct CHOICE));
-
-    module = G_define_module();
-    G_add_keyword(_("raster"));
-    module->description =
-	_("Calculates attribute, patch size, core (interior) size, shape, "
-	  "fractal dimension, and perimeter measures for sets of patches "
-	  "in a landscape.");
-
-    /* call user_input to read in the parameters */
-    user_input(argc, argv);
-
-
-    /* display the parameter choices */
-    fprintf(stderr, "\nPARAMETER CHOICES:\n");
-    fprintf(stderr, "\tMAP:\t  %s\n", choice->fn);
-    if (choice->wrum == 'r')
-	fprintf(stderr, "\tREGION:\t  %s\n", choice->reg);
-
-    fprintf(stderr, "\tSAMPLE:");
-    if (choice->wrum == 'w')
-	fprintf(stderr, "\t  whole map    ");
-    if (choice->wrum == 'm')
-	fprintf(stderr, "\t  moving window");
-    if (choice->wrum == 'u')
-	fprintf(stderr, "\t  units        ");
-    if (choice->wrum == 'r')
-	fprintf(stderr, "\t  regions      ");
-
-    fprintf(stderr, "\tTRACING:");
-    if (choice->trace)
-	fprintf(stderr, "  8 neighbor\n");
-    else
-	fprintf(stderr, "  4 neighbor\n");
-
-    if (choice->coremap || choice->patchmap || choice->units)
-	fprintf(stderr, "\tOUTPUT MAPS:\n");
-    if (choice->coremap)
-	fprintf(stderr, "\t\t  interior\n");
-    if (choice->patchmap)
-	fprintf(stderr, "\t\t  num\n");
-    if (choice->units)
-	fprintf(stderr, "\t\t  units_x\n");
-
-    if (choice->att[0])
-	fprintf(stderr, "\tATTRIBUTE MEASURES:\n");
-    if (choice->att[1])
-	fprintf(stderr, "\t\t  mean pixel attribute\n");
-    if (choice->att[2])
-	fprintf(stderr, "\t\t  st. dev. pixel attribute\n");
-    if (choice->att[3])
-	fprintf(stderr, "\t\t  mean patch attribute\n");
-    if (choice->att[4])
-	fprintf(stderr, "\t\t  st. dev. patch attribute\n");
-    if (choice->att[5])
-	fprintf(stderr, "\t\t  cover by gp\n");
-    if (choice->att[6])
-	fprintf(stderr, "\t\t  density by gp\n");
-    if (choice->att[7])
-	fprintf(stderr, "\t\t  total density\n");
-    if (choice->att[8])
-	fprintf(stderr, "\t\t  eff. mesh no.\n");
-
-    if (choice->size[0])
-	fprintf(stderr, "\tSIZE MEASURES:\n");
-    if (choice->size[1])
-	fprintf(stderr, "\t\t  mean patch size\n");
-    if (choice->size[2])
-	fprintf(stderr, "\t\t  st. dev. patch size\n");
-    if (choice->size[3])
-	fprintf(stderr, "\t\t  mean patch size by gp\n");
-    if (choice->size[4])
-	fprintf(stderr, "\t\t  st. dev. patch size by gp\n");
-    if (choice->size[5])
-	fprintf(stderr, "\t\t  no. by size class\n");
-    if (choice->size[6])
-	fprintf(stderr, "\t\t  no. by size class by gp\n");
-    if (choice->size[7])
-	fprintf(stderr, "\t\t  eff. mesh size\n");
-    if (choice->size[8])
-	fprintf(stderr, "\t\t  deg. landsc. division\n");
-
-
-    if (choice->core[0])
-	fprintf(stderr, "\tCORE MEASURES:\n");
-    if (choice->core[1])
-	fprintf(stderr, "\t\t  mean core size\n");
-    if (choice->core[2])
-	fprintf(stderr, "\t\t  st. dev. core size\n");
-    if (choice->core[3])
-	fprintf(stderr, "\t\t  mean edge size\n");
-    if (choice->core[4])
-	fprintf(stderr, "\t\t  st. dev. edge size\n");
-    if (choice->core[5])
-	fprintf(stderr, "\t\t  mean core size by gp\n");
-    if (choice->core[6])
-	fprintf(stderr, "\t\t  st. dev. core size by gp\n");
-    if (choice->core[7])
-	fprintf(stderr, "\t\t  mean edge size by gp \n");
-    if (choice->core[8])
-	fprintf(stderr, "\t\t  st. dev. edge size by gp\n");
-    if (choice->core[9])
-	fprintf(stderr, "\t\t  no. by size class \n");
-    if (choice->core[10])
-	fprintf(stderr, "\t\t  no. by size class by gp\n");
-
-    if (choice->shape[0])
-	fprintf(stderr, "\tSHAPE MEASURES:\n");
-    if (choice->shape[1])
-	fprintf(stderr, "\t\t  mean patch shape\n");
-    if (choice->shape[2])
-	fprintf(stderr, "\t\t  st. dev. patch shape\n");
-    if (choice->shape[3])
-	fprintf(stderr, "\t\t  mean patch shape by gp\n");
-    if (choice->shape[4])
-	fprintf(stderr, "\t\t  st. dev. patch shape by gp\n");
-    if (choice->shape[5])
-	fprintf(stderr, "\t\t  no. by shape class\n");
-    if (choice->shape[6])
-	fprintf(stderr, "\t\t  no. by shape class by gp\n");
-
-    if (choice->boundary[0])
-	fprintf(stderr, "\tBOUNDARY COMPLEXITY MEASURES:\n");
-    if (choice->boundary[1])
-	fprintf(stderr, "\t\t  mean twist number\n");
-    if (choice->boundary[2])
-	fprintf(stderr, "\t\t  st. dev. twist number\n");
-    if (choice->boundary[3])
-	fprintf(stderr, "\t\t  mean omega index\n");
-    if (choice->boundary[4])
-	fprintf(stderr, "\t\t  st. dev. omega index\n");
-
-    if (choice->perim[0])
-	fprintf(stderr, "\tPERIMETER MEASURES:\n");
-    if (choice->perim[1])
-	fprintf(stderr, "\t\t  sum of perims\n");
-    if (choice->perim[2])
-	fprintf(stderr, "\t\t  mean perim.\n");
-    if (choice->perim[3])
-	fprintf(stderr, "\t\t  st. dev. perim.\n");
-    if (choice->perim[4])
-	fprintf(stderr, "\t\t  sum of perims. by gp\n");
-    if (choice->perim[5])
-	fprintf(stderr, "\t\t  mean perim. by gp\n");
-    if (choice->perim[6])
-	fprintf(stderr, "\t\t  st. dev. perim. by gp\n");
-
-    /* if not moving window, setup the
-       r.le.out subdirectory */
-
-    if (choice->wrum != 'm')
-	G_mkdir("r.le.out");
-
-    patch_fore();
-    G_free(choice);
-
-    return (EXIT_SUCCESS);
-}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 2448
raster/r.le/r.le.patch/patch.c


+ 0 - 169
raster/r.le/r.le.patch/patch.h

@@ -1,169 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.patch/patch.h                               *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To analyze attributes of patches in a landscape *
- *         patch.h lists include files, defines the data    *
- *         structures, and lists the modules for r.le.patch *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#ifndef __PATCH_H__
-#define __PATCH_H__
-
-
-#include <grass/config.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <time.h>
-#include <setjmp.h>
-#include <math.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <grass/gis.h>
-
-#define  SML   0.5
-#define  MIN   2
-#define  EQ(a, b)    (a-b < 0.01 && a-b > -0.01 )
-#define  BIG   1000000000.0
-#define  PI    M_PI
-
-extern jmp_buf jmp;
-
-typedef struct __dirdesc
-{
-    int dd_fd;			/* file descriptor */
-    long dd_loc;		/* buf offset of entry from last readddir() */
-    long dd_size;		/* amount of valid data in buffer */
-    long dd_bsize;		/* amount of entries read at a time */
-    long dd_off;		/* Current offset in dir (for telldir) */
-    char *dd_buf;		/* directory data buffer */
-} DIR;
-
-extern DIR *opendir( /* char *dirname */ );
-extern struct dirent *readdir( /* DIR *dirp */ );
-extern int closedir( /* DIR *dirp */ );
-
-
-typedef struct pt
-{
-    int row, col;
-    struct pt *next;
-} PT;
-
-typedef struct patch
-{
-    double att;
-    int num, n, s, e, w, npts;
-    double c_row, c_col;
-    double area, perim, long_axis;
-    double edge, core;
-    int *row;
-    int *col;
-    int twist;
-    float omega;
-    struct patch *next;
-} PATCH;
-
-struct CHOICE
-{
-    char fn[GNAME_MAX], reg[GMAPSET_MAX], out[GNAME_MAX], wrum;
-    int core2, size2, shape2, edge, fb, coremap, units;
-    int perim2, trace, patchmap;
-    int Mx[4];
-    int att[9], size[9], shape[8], boundary[5], perim[8], core[11];
-};
-
-typedef struct reglist
-{
-    int att;
-    int n, s, e, w;
-    struct reglist *next;
-} REGLIST;
-
-
-/** main.c **/
-void user_input();
-
-/** driver.c **/
-void patch_fore();
-void open_files();
-void read_line();
-void read_recl_tb();
-void read_para();
-void get_para();
-void free_para();
-
-void mv_driver();
-void read_mwind();
-void set_colors();
-void get_para_mv();
-int need_gp();
-
-void whole_reg_driver();
-void unit_driver();
-void run_clip(int, int, int, int, int, int, CELL **, int, float);
-
-void meter();
-FILE *fopen0();
-FILE *fopen1();
-FILE *fopen2();
-
-
-/** trace.c **/
-void cell_clip_drv(int, int, int, int, double **, int, float);
-void cell_clip(DCELL **, DCELL **, int, int, int, int, int, float, int *,
-	       int *);
-int is_not_empty_buffer();
-int center_is_not_null();
-void trace();
-PATCH *get_bd();
-void clockwise();
-void counterclockwise();
-int yes_nb();
-
-
-/** patch.c **/
-void df_patch();
-void mv_patch();
-
-double eu_dist();
-double eu_d();
-int in_group();
-int check_order();
-int index_coh();
-int recl_coh();
-
-void m_att();
-void m_core();
-void m_size();
-void m_shape();
-void m_perim();
-void m_boundary();
-
-void df_att();
-void df_core();
-void df_size();
-void df_shape();
-void df_perim();
-void df_boundary();
-
-void save_att();
-void save_core();
-void save_size();
-void save_shape();
-void fit();
-
-
-#endif /* __PATCH_H__ */

+ 0 - 40
raster/r.le/r.le.patch/r.le.patch.html

@@ -1,40 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-The <em>r.le.patch</em> module calculates attribute, patch size, core
-(interior) size, shape, fractal dimension, and perimeter measures for sets
-of patches in a landscape.
-
-
-<h2>NOTES</h2>
-
-Full instructions can be found in the <b>r.le manual</b> (see "REFERENCES"
-section below) and the <em><a href="r.le.setup.html">r.le.setup</a></em>
-help page.
-
-
-<h2>REFERENCES</h2>
-
-Baker, W.L. and Y. Cai. 1992. The r.le programs for multiscale analysis of
-landscape structure using the GRASS geographical information system.
-Landscape Ecology 7(4):291-302.
-<p>
-The <a href="http://grass.osgeo.org/gdp/landscape/r_le_manual5.pdf"><i>r.le</i>
-manual: Quantitative analysis of landscape structures</a> (GRASS 5; 2001)
-
-<h2>SEE ALSO</h2>
-
-<em>
-<!-- <a href="r.le.dist.html">r.le.dist</a>,
-<a href="r.le.null.html">r.le.null</a>, -->
-<a href="r.le.pixel.html">r.le.pixel</a>,
-<!-- <a href="r.le.rename.html">r.le.rename</a>, -->
-<a href="r.le.setup.html">r.le.setup</a>, 
-<a href="r.le.trace.html">r.le.trace</a></em>
-
-<h2>AUTHOR</h2>
-
-William L. Baker Department of Geography and Recreation University of
-Wyoming Laramie, Wyoming 82071 U.S.A.
-
-<p>
-<i>Last changed: $Date$</i>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1828
raster/r.le/r.le.patch/trace.c


+ 0 - 10
raster/r.le/r.le.pixel/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../../..
-
-PGM = r.le.pixel
-
-LIBES = $(GISLIB)
-DEPENDENCIES = $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 490
raster/r.le/r.le.pixel/cellclip.c

@@ -1,490 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.pixel/cellclip.c                            *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To analyze pixel-scale landscape properties     *
- *         cellclip.c clips the area that is being analyzed *
- *         out of the original raster map                   *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <grass/gis.h>
-#include "pixel.h"
-#include <grass/config.h>
-#include <grass/raster.h>
-#include "local_proto.h"
-
-
-extern struct CHOICE *choice;
-extern int finput;
-
-
-					/* CELL CLIP DRIVER */
-
-void cell_clip_drv(int col0, int row0, int ncols, int nrows, double **value,
-		   int index, int cntwhole, float radius)
-{
-
-    register int i, j;
-    int cnt = 0, p;
-    double *rich, *richtmp;
-    char *name, *mapset;
-    DCELL **buf;
-    DCELL **null_buf;
-    RASTER_MAP_TYPE data_type;
-
-    /*
-       col0 = starting column for area to be clipped
-       row0 = starting row for area to be clipped
-       ncols = number of columns in area to be clipped
-       nrows = number of rows in area to be clipped
-       value =
-       index = number of the region to be clipped, if there's a region map
-       buf = pointer to array containing the clipped area, a smaller area
-       than the original raster map to be read from finput                            printf("h2\n");
-
-       pat = pointer to array containing the map of patch numbers
-       cor = pointer to array containing the map of interior area
-     */
-
-    name = choice->fn;
-    mapset = G_mapset();
-    data_type = Rast_map_type(name, mapset);
-
-    /* dynamically allocate storage for the
-       buffer that will hold the contents of
-       the window */
-
-    buf = (DCELL **) G_calloc(nrows + 3, sizeof(DCELL *));
-    for (i = 0; i < nrows + 3; i++) {
-	buf[i] = (DCELL *) G_calloc(ncols + 3, sizeof(DCELL));
-    }
-
-    /* dynamically allocate storage for the
-       buffer that will hold the null values for
-       the clipped area */
-
-    null_buf = (DCELL **) G_calloc(nrows + 3, sizeof(DCELL *));
-    for (i = 0; i < nrows + 3; i++)
-	null_buf[i] = (DCELL *) G_calloc(ncols + 3, sizeof(DCELL));
-
-    /* call the cell_clip routine */
-
-    cell_clip(buf, null_buf, row0, col0, nrows, ncols, index, radius);
-
-    /* dynamically allocate memory for
-       the richness array */
-
-    richtmp = (double *)G_calloc(MAX, sizeof(double));
-
-    /* go through the sampling area
-       pixel by pixel */
-
-    for (i = 1; i < nrows + 1; i++) {
-	for (j = 1; j < ncols + 1; j++) {
-
-	    /* if buf[i][j] is not a null value,
-	       call get_rich to tally up the
-	       number of different attributes
-	       in the sampling area and fill
-	       the richness array with those
-	       attributes */
-
-	    if ((buf[i][j] || buf[i][j] == 0.0) && null_buf[i][j] == 0.0) {
-		/*printf("buf[%d][%d] = %f\n",i,j,buf[i][j]); */
-
-		get_rich(buf[i][j], richtmp, &cnt);
-	    }
-	}
-    }
-
-    if (cnt) {
-
-	rich = (double *)G_calloc(cnt, sizeof(double));
-	for (i = 0; i < cnt; i++) {
-	    rich[i] = richtmp[i];
-	}
-	G_free(richtmp);
-
-	/* call ANSI C runtime library
-	   function qsort to sort the 
-	   richness array into ascending
-	   order */
-
-	qsort(rich, cnt, sizeof(double), compar);
-
-	/* moving window */
-
-	if (choice->wrum == 'm') {
-	    if (is_not_empty_buffer(buf, null_buf, nrows + 1, ncols + 1)) {
-		if (center_is_not_null(buf, null_buf, nrows, ncols))
-		    mv_texture(nrows, ncols, buf, null_buf, value, index,
-			       rich, cnt, cntwhole);
-		else {
-		    for (p = 0; p < 17; p++)
-			*(*(value + index) + p) = -BIG;
-		}
-	    }
-	}
-
-	/* whole map, units, or regions */
-
-	else if (is_not_empty_buffer(buf, null_buf, nrows + 1, ncols + 1))
-	    df_texture(nrows, ncols, buf, null_buf, rich, cnt, cntwhole);
-
-	for (i = 0; i < nrows + 3; i++)
-	    G_free(*(buf + i));
-	G_free(buf);
-
-	/* free memory allocated for null buffer */
-
-	for (i = 0; i < nrows + 3; i++)
-	    G_free(null_buf[i]);
-	G_free(null_buf);
-
-	G_free(rich);
-    }
-    else
-	G_free(richtmp);
-
-    return;
-}
-
-
-
-
-
-
-					/* CHECK BUFFER; RETURN 1 IF BUFFER
-					   IS NOT EMPTY, 0 IF EMPTY */
-
-int is_not_empty_buffer(DCELL ** buf, DCELL ** null_buf, int rows, int cols)
-{
-
-    register int i, j;
-
-    /* if value in raster is positive or 
-       negative, then it is not null; if
-       value in raster is zero, and the 
-       null value is 0.0, then the zero
-       raster value is not null */
-
-    for (i = 1; i < rows + 1; i++)
-	for (j = 1; j < cols + 1; j++) {
-	    if (buf[i][j])
-		return (1);
-	    else if (!buf[i][j] && null_buf[i][j] == 0.0)
-		return (1);
-	}
-    return (0);
-
-}
-
-
-
-				/* CHECK TO SEE IF THE CENTER PIXEL
-				   IN THE BUFFER IS NULL.  RETURN 1
-				   IF IT IS NOT NULL, 0 IF IT IS NULL */
-
-int center_is_not_null(DCELL ** buf, DCELL ** null_buf, int rows, int cols)
-{
-
-    /* if value in raster is positive or 
-       negative, then it is not null; if
-       value in raster is zero, and the 
-       null value is 0.0, then the zero
-       raster value is not null */
-
-    if (buf[(rows / 2) + 1][(cols / 2) + 1] > -BIG) {
-	return (1);
-    }
-    else if (!buf[(rows / 2) + 1][(cols / 2) + 1] &&
-	     null_buf[(rows / 2) + 1][(cols / 2) + 1] == 0.0) {
-	return (1);
-    }
-    return (0);
-
-}
-
-
-
-
-				/* OPEN THE RASTER FILE TO BE CLIPPED,
-				   AND DO THE CLIPPING */
-
-void cell_clip(DCELL ** buf, DCELL ** null_buf, int row0, int col0, int nrows,
-	       int ncols, int index, float radius)
-{
-    CELL *tmp, *tmp1;
-    FCELL *ftmp;
-    DCELL *dtmp;
-    char *tmpname, *nulltmp;
-    int fr;
-    register int i, j;
-    double center_row = 0.0, center_col = 0.0;
-    double dist;
-    RASTER_MAP_TYPE data_type;
-
-    /*
-       Variables:
-       IN:
-       buf        = pointer to array containing only the pixels inside the area 
-       that was specified to be clipped, so a smaller array than the
-       original raster map
-       null_buf   = pointer to array containing the corresponding null values
-       row0       = starting row for the area to be clipped out of the raster map
-       col0       = starting col for the area to be clipped out of the raster map
-       nrows      = total number of rows in the area to be clipped
-       ncols      = total number of cols in the area to be clipped
-       index      = number of the region to be clipped, if there's a region map
-       INTERNAL:
-       tmp        = pointer to a temporary array to store a row of the raster map
-       tmp1       = pointer to a temporary array to store a row of the region map
-       fr         = return value from attempting to open the region map
-       i, j       = indices to rows and cols of the arrays
-     */
-
-    data_type = Rast_map_type(choice->fn, G_mapset());
-
-    /* if sampling by region was chosen, check
-       for the region map and make sure it is
-       an integer (CELL_TYPE) map */
-
-    if (choice->wrum == 'r') {
-	if (0 > (fr = Rast_open_old(choice->reg, G_mapset()))) {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   *******************************************************\n");
-	    fprintf(stderr,
-		    "    You specified sam=r to request sampling by region,    \n");
-	    fprintf(stderr,
-		    "    but the region map specified with the 'reg=' parameter\n");
-	    fprintf(stderr,
-		    "    cannot be found in the current mapset.                \n");
-	    fprintf(stderr,
-		    "   *******************************************************\n");
-	    exit(1);
-	}
-	if (Rast_map_type(choice->reg, G_mapset()) > 0) {
-	    fprintf(stderr, "\n");
-	    fprintf(stderr,
-		    "   *******************************************************\n");
-	    fprintf(stderr,
-		    "    You specified sam=r to request sampling by region,    \n");
-	    fprintf(stderr,
-		    "    but the region map specified with the 'reg=' parameter\n");
-	    fprintf(stderr,
-		    "    must be an integer map, and it is floating point or   \n");
-	    fprintf(stderr,
-		    "    double instead.                                       \n");
-	    fprintf(stderr,
-		    "   *******************************************************\n");
-	    exit(1);
-	}
-	tmp1 = Rast_allocate_buf(CELL_TYPE);
-	Rast_zero_buf(tmp1, CELL_TYPE);
-	fprintf(stderr, "Analyzing region number %d...\n", index);
-    }
-
-    /* allocate memory to store a row of the
-       raster map, depending on the type of
-       input raster map; keep track of the
-       name of the buffer for each raster type */
-
-    switch (data_type) {
-    case CELL_TYPE:
-	tmp = Rast_allocate_buf(CELL_TYPE);
-	tmpname = "tmp";
-	break;
-    case FCELL_TYPE:
-	ftmp = Rast_allocate_buf(FCELL_TYPE);
-	tmpname = "ftmp";
-	break;
-    case DCELL_TYPE:
-	dtmp = Rast_allocate_buf(DCELL_TYPE);
-	tmpname = "dtmp";
-	break;
-    }
-
-    /* allocate memory to store a row of the
-       null values corresponding to the raster
-       map */
-
-    nulltmp = Rast_allocate_null_buf();
-
-    /* if circles are used for sampling, then
-       calculate the center of the area to be
-       clipped, in pixels */
-
-    if ((int)radius) {
-	center_row = ((double)row0 + ((double)nrows - 1) / 2);
-	center_col = ((double)col0 + ((double)ncols - 1) / 2);
-    }
-
-    /* for each row of the area to be clipped */
-
-    for (i = row0; i < row0 + nrows; i++) {
-
-	/* if region, read in the corresponding
-	   map row in the region file */
-
-	if (choice->wrum == 'r')
-	    Rast_get_row_nomask(fr, tmp1, i, CELL_TYPE);
-
-	/* initialize each element of the
-	   row buffer to 0; this row buffer
-	   will hold one row of the clipped
-	   raster map.  Then read row i of the
-	   map and the corresponding null values
-	   into tmp and nulltmp buffers */
-
-	switch (data_type) {
-	case CELL_TYPE:
-	    Rast_zero_buf(tmp, data_type);
-	    Rast_get_row(finput, tmp, i, CELL_TYPE);
-	    break;
-	case FCELL_TYPE:
-	    Rast_zero_buf(ftmp, data_type);
-	    Rast_get_row(finput, ftmp, i, FCELL_TYPE);
-	    break;
-	case DCELL_TYPE:
-	    Rast_zero_buf(dtmp, data_type);
-	    Rast_get_row(finput, dtmp, i, DCELL_TYPE);
-	    break;
-	}
-
-	Rast_get_null_value_row(finput, nulltmp, i);
-
-	/* for all the columns one by one */
-
-	for (j = col0; j < col0 + ncols; j++) {
-
-	    /* if circles are used for sampling */
-
-	    if ((int)radius) {
-		dist = sqrt(((double)i - center_row) *
-			    ((double)i - center_row) +
-			    ((double)j - center_col) *
-			    ((double)j - center_col));
-
-		/* copy the contents of tmp into the
-		   appropriate cell in buf */
-
-		if (dist < radius) {
-		    switch (data_type) {
-		    case CELL_TYPE:
-			*(*(buf + i + 1 - row0) + j + 1 - col0) = *(tmp + j);
-			break;
-		    case FCELL_TYPE:
-			*(*(buf + i + 1 - row0) + j + 1 - col0) = *(ftmp + j);
-			break;
-		    case DCELL_TYPE:
-			*(*(buf + i + 1 - row0) + j + 1 - col0) = *(dtmp + j);
-			break;
-		    }
-		    *(*(null_buf + i + 1 - row0) + j + 1 - col0) =
-			*(nulltmp + j);
-		}
-	    }
-
-	    /* if circles are not used and
-	       if the choice is not "by region" or
-	       if this column is in region "index" */
-
-	    else if (choice->wrum != 'r' || *(tmp1 + j) == index) {
-
-		/* copy the contents of the correct tmp
-		   into the appropriate cell in the buf
-		   and the corresponding null values into
-		   the appropriate cell in null_buf */
-
-		switch (data_type) {
-		case CELL_TYPE:
-		    *(*(buf + i + 1 - row0) + j + 1 - col0) = *(tmp + j);
-		    break;
-		case FCELL_TYPE:
-		    *(*(buf + i + 1 - row0) + j + 1 - col0) = *(ftmp + j);
-		    break;
-		case DCELL_TYPE:
-		    *(*(buf + i + 1 - row0) + j + 1 - col0) = *(dtmp + j);
-		    break;
-		}
-		*(*(null_buf + i + 1 - row0) + j + 1 - col0) = *(nulltmp + j);
-	    }
-	}
-    }
-
-    switch (data_type) {
-    case CELL_TYPE:
-	G_free(tmp);
-	break;
-    case FCELL_TYPE:
-	G_free(ftmp);
-	break;
-    case DCELL_TYPE:
-	G_free(dtmp);
-	break;
-    }
-    if (choice->wrum == 'r') {
-	G_free(tmp1);
-	Rast_close(fr);
-    }
-    G_free(nulltmp);
-    return;
-}
-
-
-
-
-
-					/* FIND UNCOUNTED ATTRIBUTES,
-					   COUNT THEM UP, AND ADD THEM TO
-					   THE RICHNESS ARRAY IN UNSORTED
-					   ORDER */
-
-void get_rich(double att, double rich[], int *cnt)
-{
-    register int i;
-
-    /* if this attribute is already
-       in the richness array, then
-       return */
-
-    for (i = 0; i < *cnt; i++) {
-	if (att == rich[i]) {
-	    break;
-	}
-    }
-    /* if this attribute is not already
-       in the richness array, then make
-       it the "cnt" element of the
-       array, then increment the cnt */
-
-    if (i >= *cnt) {
-	rich[*cnt] = att;
-	/* fprintf(stderr, "cnt=%d i=%d att=%f\n",*cnt,i,att); */
-	++(*cnt);
-    }
-    return;
-}
-
-
-
-
-
-					/* COMPARE */
-
-int compar(int *i, int *j)
-{
-    return (*i - *j);
-}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1851
raster/r.le/r.le.pixel/driver.c


+ 0 - 415
raster/r.le/r.le.pixel/input.c

@@ -1,415 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.pixel/input.c                               *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To analyze pixel-scale landscape properties     *
- *         input.c uses the GRASS parser to get user input  *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * 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 <grass/config.h>
-#include "pixel.h"
-
-
-extern struct CHOICE *choice;
-
-void user_input(int argc, char **argv)
-{
-    int i;
-
-    /* setup the GRASS parsing routine
-       structures to be used to read 
-       in the user's parameter choices */
-    struct Flag *units;
-    struct Flag *zscore;
-    struct Flag *edgemap;
-    struct Option *name;
-    struct Option *sampling_method;
-    struct Option *region;
-    struct Option *att;
-    struct Option *diversity;
-    struct Option *measure_code;
-    struct Option *method_code;
-    struct Option *juxtaposition;
-    struct Option *edge;
-
-
-    /* use the GRASS parsing routines to read in the user's parameter choices */
-
-    edgemap = G_define_flag();
-    edgemap->key = 'e';
-    edgemap->description =
-	"Output map 'edge' of edges given a '1' in r.le.para/edge file";
-
-    units = G_define_flag();
-    units->key = 'u';
-    units->description =
-	"Output maps 'units_x' with sampling units for each scale x ";
-
-    zscore = G_define_flag();
-    zscore->key = 'z';
-    zscore->description = "Output map 'zscores' with standardized scores";
-
-    name = G_define_option();
-    name->key = "map";
-    name->description = "Raster map to be analyzed";
-    name->type = TYPE_STRING;
-    name->gisprompt = "old,cell,raster";
-    name->required = YES;
-
-    sampling_method = G_define_option();
-    sampling_method->answer = "w";
-    sampling_method->key = "sam";
-    sampling_method->description = "Sampling method (choose only 1 method):\n"
-	"\tw = whole map      u = units        m = moving window   r = regions";
-    sampling_method->type = TYPE_STRING;
-    sampling_method->multiple = NO;
-    sampling_method->required = NO;
-
-    region = G_define_option();
-    region->key = "reg";
-    region->description =
-	"Name of regions map, only when sam = r; omit otherwise";
-    region->type = TYPE_STRING;
-    region->gisprompt = "old,cell,raster";
-    region->required = NO;
-
-    att = G_define_option();
-    att->key = "att";
-    att->description =
-	"b1 = mn. pixel att.                 b2 = s.d. pixel att.\n"
-	"\tb3 = min. pixel att.                b4 = max. pixel att.";
-    att->options = "b1,b2,b3,b4";
-    att->type = TYPE_STRING;
-    att->multiple = YES;
-    att->required = NO;
-
-    diversity = G_define_option();
-    diversity->key = "div";
-    diversity->description =
-	"d1 = richness      d2 = Shannon     d3 = dominance     d4 = inv. Simpson";
-    diversity->options = "d1,d2,d3,d4";
-    diversity->type = TYPE_STRING;
-    diversity->multiple = YES;
-    diversity->required = NO;
-
-    method_code = G_define_option();
-    method_code->key = "te1";
-    method_code->description = "Texture method (choose only 1 method):\n"
-	"\tm1 = 2N-H          m2 = 2N-45       m3 = 2N-V          m4 = 2N-135\n"
-	"\tm5 = 4N-HV         m6 = 4N-DIAG     m7 = 8N";
-    method_code->options = "m1,m2,m3,m4,m5,m6,m7";
-    method_code->type = TYPE_STRING;
-    method_code->multiple = NO;
-    method_code->required = NO;
-
-    measure_code = G_define_option();
-    measure_code->key = "te2";
-    measure_code->description =
-	"Texture measures (required if te1 was specified):\n"
-	"\tt1 = contagion           t2 = ang. sec. mom.     t3 = inv. diff. mom.\n"
-	"\tt4 = entropy             t5 = contrast";
-    measure_code->options = "t1,t2,t3,t4,t5";
-    measure_code->type = TYPE_STRING;
-    measure_code->multiple = YES;
-    measure_code->required = NO;
-
-    juxtaposition = G_define_option();
-    juxtaposition->key = "jux";
-    juxtaposition->description =
-	"Juxtaposition measures (weight file in r.le.para needed):\n"
-	"\tj1 = mn. juxtaposition              j2 = s.d. juxtaposition";
-    juxtaposition->options = "j1,j2";
-    juxtaposition->type = TYPE_STRING;
-    juxtaposition->multiple = YES;
-    juxtaposition->required = NO;
-
-    edge = G_define_option();
-    edge->key = "edg";
-    edge->description =
-	"e1 = sum of edges  e2 = sum of edges by type (need edge file: r.le.para)";
-    edge->options = "e1,e2";
-    edge->type = TYPE_STRING;
-    edge->multiple = YES;
-    edge->required = NO;
-
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-    /* record the user inputs for map,
-       sam, run, and out parameters */
-
-    strcpy(choice->fn, name->answer);
-
-    choice->wrum = sampling_method->answer[0];
-
-
-    /* check for unacceptable values for
-       input parameters */
-
-    if (strcmp(sampling_method->answer, "w") &&
-	strcmp(sampling_method->answer, "u") &&
-	strcmp(sampling_method->answer, "m") &&
-	strcmp(sampling_method->answer, "r")) {
-	fprintf(stdout, "\n");
-	fprintf(stdout,
-		"   ***************************************************\n");
-	fprintf(stdout,
-		"    You input an unacceptable value for parameter sam \n");
-	fprintf(stdout,
-		"   ***************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-    /* check for multiple values for te1 */
-
-    if (method_code->answer)
-	if (method_code->answers[1]) {
-	    fprintf(stdout, "\n");
-	    fprintf(stdout,
-		    "   **********************************************\n");
-	    fprintf(stdout,
-		    "    You input multiple values for parameter te1, \n");
-	    fprintf(stdout,
-		    "    but only one is allowed                      \n");
-	    fprintf(stdout,
-		    "   **********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-
-
-    /* if the -u flag is specified, then
-       set the choice->units flag to 1 */
-
-    choice->units = 0;
-    if (!strcmp(sampling_method->answer, "u") && units->answer)
-	choice->units = 1;
-    else if (strcmp(sampling_method->answer, "u") && units->answer) {
-	fprintf(stdout, "\n");
-	fprintf(stdout,
-		"   ***************************************************\n");
-	fprintf(stdout,
-		"    You requested output of map 'units' with sampling \n");
-	fprintf(stdout,
-		"    units, by using flag -u, but this option is only  \n");
-	fprintf(stdout,
-		"    available when sam=u                              \n");
-	fprintf(stdout,
-		"   ***************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-    /* if sampling_method is by REGION
-       get region file name.  Check to see
-       that the name was input */
-
-    if (!strcmp(sampling_method->answer, "r")) {
-	if (region->answer)
-	    strcpy(choice->reg, region->answer);
-	else {
-	    fprintf(stdout, "\n");
-	    fprintf(stdout,
-		    "   ***********************************************\n");
-	    fprintf(stdout,
-		    "    You requested sampling by region, but did not \n");
-	    fprintf(stdout,
-		    "    input the name of the region using the reg=   \n");
-	    fprintf(stdout,
-		    "    parameter                                     \n");
-	    fprintf(stdout,
-		    "   ***********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-    }
-
-    if (region->answer)
-	if (strcmp(sampling_method->answer, "r")) {
-	    fprintf(stdout, "\n");
-	    fprintf(stdout,
-		    "   ***********************************************\n");
-	    fprintf(stdout,
-		    "    You requested sampling by region, by using    \n");
-	    fprintf(stdout,
-		    "    the reg= parameter, but did not input the     \n");
-	    fprintf(stdout,
-		    "    sam=r parameter                               \n");
-	    fprintf(stdout,
-		    "   ***********************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-
-    /* initialize flag arrays in choice
-       data structure. */
-
-    for (i = 0; i < 5; i++)
-	choice->att[i] = 0;
-    for (i = 0; i < 5; i++)
-	choice->div[i] = 0;
-    for (i = 0; i < 6; i++)
-	choice->te2[i] = 0;
-    for (i = 0; i < 3; i++)
-	choice->jux[i] = 0;
-    for (i = 0; i < 3; i++)
-	choice->edg[i] = 0;
-
-    /* fill measure_code and method
-       code arrays */
-
-
-    if (att->answer) {
-	choice->att[0] = 1;
-	for (i = 0; att->answers[i] != NULL; i++) {
-	    if (!strcmp(att->answers[i], "b1"))
-		choice->att[1] = 1;
-	    else if (!strcmp(att->answers[i], "b2"))
-		choice->att[2] = 1;
-	    else if (!strcmp(att->answers[i], "b3"))
-		choice->att[3] = 1;
-	    else if (!strcmp(att->answers[i], "b4"))
-		choice->att[4] = 1;
-	}
-    }
-
-    if (edgemap->answer && choice->wrum == 'w') {
-	choice->edgemap = edgemap->answer;
-	choice->edg[0] = 1;
-	choice->edg[2] = 1;
-    }
-    else if (edgemap->answer && choice->wrum != 'w') {
-	fprintf(stdout, "\n");
-	fprintf(stdout,
-		"   ****************************************************\n");
-	fprintf(stdout,
-		"    An edge map (flag is -e) is not available unless   \n");
-	fprintf(stdout,
-		"    sam=w                                              \n");
-	fprintf(stdout,
-		"   ****************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-    if (zscore->answer && choice->wrum == 'w') {
-	choice->z = zscore->answer;
-	choice->att[0] = 1;
-	choice->att[1] = 1;
-	choice->att[2] = 1;
-    }
-    else if (zscore->answer && choice->wrum != 'w') {
-	fprintf(stdout, "\n");
-	fprintf(stdout,
-		"   ****************************************************\n");
-	fprintf(stdout,
-		"    A zscores map (flag is -z) is not available unless \n");
-	fprintf(stdout,
-		"    sam=w                                              \n");
-	fprintf(stdout,
-		"   ****************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-    if (diversity->answer) {
-	choice->div[0] = 1;
-	for (i = 0; diversity->answers[i] != NULL; i++) {
-	    if (!strcmp(diversity->answers[i], "d1"))
-		choice->div[1] = 1;
-	    else if (!strcmp(diversity->answers[i], "d2"))
-		choice->div[2] = 1;
-	    else if (!strcmp(diversity->answers[i], "d3"))
-		choice->div[3] = 1;
-	    else if (!strcmp(diversity->answers[i], "d4"))
-		choice->div[4] = 1;
-	}
-    }
-
-    choice->tex = 0;
-    if (measure_code->answer || method_code->answer) {
-	if (measure_code->answer && method_code->answer) {
-	    choice->te2[0] = 1;
-	    for (i = 0; measure_code->answers[i] != NULL; i++) {
-		if (!strcmp(measure_code->answers[i], "t1"))
-		    choice->te2[1] = 1;
-		else if (!strcmp(measure_code->answers[i], "t2"))
-		    choice->te2[2] = 1;
-		else if (!strcmp(measure_code->answers[i], "t3"))
-		    choice->te2[3] = 1;
-		else if (!strcmp(measure_code->answers[i], "t4"))
-		    choice->te2[4] = 1;
-		else if (!strcmp(measure_code->answers[i], "t5"))
-		    choice->te2[5] = 1;
-	    }
-	    if (!strcmp(method_code->answer, "m1"))
-		choice->tex = 1;
-	    else if (!strcmp(method_code->answer, "m2"))
-		choice->tex = 2;
-	    else if (!strcmp(method_code->answer, "m3"))
-		choice->tex = 3;
-	    else if (!strcmp(method_code->answer, "m4"))
-		choice->tex = 4;
-	    else if (!strcmp(method_code->answer, "m5"))
-		choice->tex = 5;
-	    else if (!strcmp(method_code->answer, "m6"))
-		choice->tex = 6;
-	    else if (!strcmp(method_code->answer, "m7"))
-		choice->tex = 7;
-	}
-	else {
-	    fprintf(stdout, "\n");
-	    fprintf(stdout,
-		    "   ************************************************\n");
-	    fprintf(stdout,
-		    "    You requested texture measurement, but did not \n");
-	    fprintf(stdout,
-		    "    input both parameter te1 and te2               \n");
-	    fprintf(stdout,
-		    "   ************************************************\n");
-	    exit(EXIT_FAILURE);
-	}
-    }
-
-    if (juxtaposition->answer) {
-	choice->jux[0] = 1;
-	for (i = 0; juxtaposition->answers[i] != NULL; i++) {
-	    if (!strcmp(juxtaposition->answers[i], "j1"))
-		choice->jux[1] = 1;
-	    else if (!strcmp(juxtaposition->answers[i], "j2"))
-		choice->jux[2] = 1;
-	}
-    }
-
-    if (edge->answer) {
-	choice->edg[0] = 1;
-	for (i = 0; edge->answers[i] != NULL; i++) {
-	    if (!strcmp(edge->answers[i], "e1"))
-		choice->edg[1] = 1;
-	    else if (!strcmp(edge->answers[i], "e2"))
-		choice->edg[2] = 1;
-	}
-    }
-
-    if (!att->answer && !diversity->answer && !measure_code->answer &&
-	!juxtaposition->answer && !edge->answer && !zscore->answer &&
-	!edgemap->answer) {
-	fprintf(stdout, "\n");
-	fprintf(stdout,
-		"   **************************************************\n");
-	fprintf(stdout,
-		"    You did not select any measures to be calculated \n");
-	fprintf(stdout,
-		"   **************************************************\n");
-	exit(EXIT_FAILURE);
-    }
-
-    return;
-}

+ 0 - 1
raster/r.le/r.le.pixel/local_proto.h

@@ -1 +0,0 @@
-int center_is_not_null(DCELL **, DCELL **, int, int);

+ 0 - 157
raster/r.le/r.le.pixel/main.c

@@ -1,157 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.pixel/main.c                                *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To analyze pixel-scale landscape properties     *
- *         main.c calls user_input.c, then displays user    *
- *         choices, then calls the appropriate routine      *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <grass/config.h>
-#include <grass/gis.h>
-#include <grass/glocale.h>
-#include "pixel.h"
-
-
-struct CHOICE *choice;
-
-
-int main(int argc, char **argv)
-{
-
-    struct GModule *module;
-
-    /* initialize the GRASS GIS system */
-    G_gisinit(argv[0]);
-
-    /* allocate space for the choice data structure */
-    choice = (struct CHOICE *)G_calloc(1, sizeof(struct CHOICE));
-
-    module = G_define_module();
-    G_add_keyword(_("raster"));
-    module->description =
-	_("Contains a set of measures for attributes, diversity, texture, "
-	  "juxtaposition, and edge.");
-
-    /* call user_input to read in the parameters */
-    user_input(argc, argv);
-
-    /* display the parameter choices */
-    fprintf(stdout, "\nPARAMETER CHOICES:\n");
-    fprintf(stdout, "\tMAP:\t  %s\n", choice->fn);
-    if (choice->wrum == 'r')
-	fprintf(stdout, "\tREGION:\t  %s\n", choice->reg);
-
-    fprintf(stdout, "\tSAMPLE:");
-    if (choice->wrum == 'w')
-	fprintf(stdout, "\t  whole map    \n");
-    if (choice->wrum == 'm')
-	fprintf(stdout, "\t  moving window\n");
-    if (choice->wrum == 'u')
-	fprintf(stdout, "\t  units        \n");
-    if (choice->wrum == 'r')
-	fprintf(stdout, "\t  regions      \n");
-
-    if (choice->edgemap || choice->units || choice->z)
-	fprintf(stdout, "\tOUTPUT MAPS:\n");
-    if (choice->edgemap)
-	fprintf(stdout, "\t\t  edge\n");
-    if (choice->units)
-	fprintf(stdout, "\t\t  units_x\n");
-    if (choice->z)
-	fprintf(stdout, "\t\t  zscores\n");
-
-    if (choice->att[0]) {
-	fprintf(stdout, "\tATTRIBUTE MEASURES:\n");
-	if (choice->att[1])
-	    fprintf(stdout, "\t\t  mean pixel attribute\n");
-	if (choice->att[2])
-	    fprintf(stdout, "\t\t  st. dev. pixel attribute\n");
-	if (choice->att[3])
-	    fprintf(stdout, "\t\t  minimum pixel attribute\n");
-	if (choice->att[4])
-	    fprintf(stdout, "\t\t  maximum pixel attribute\n");
-    }
-
-    if (choice->div[0]) {
-	fprintf(stdout, "\tDIVERSITY MEASURES:\n");
-	if (choice->div[1])
-	    fprintf(stdout, "\t\t  richness\n");
-	if (choice->div[2])
-	    fprintf(stdout, "\t\t  Shannon\n");
-	if (choice->div[3])
-	    fprintf(stdout, "\t\t  dominance\n");
-	if (choice->div[4])
-	    fprintf(stdout, "\t\t  inverse Simpson\n");
-    }
-
-    if (choice->te2[0]) {
-	fprintf(stdout, "\tTEXTURE METHOD:\n");
-	if (choice->tex == 1)
-	    fprintf(stdout, "\t\t  2N-H\n");
-	else if (choice->tex == 2)
-	    fprintf(stdout, "\t\t  2N-45\n");
-	else if (choice->tex == 3)
-	    fprintf(stdout, "\t\t  2N-V\n");
-	else if (choice->tex == 4)
-	    fprintf(stdout, "\t\t  2N-135\n");
-	else if (choice->tex == 5)
-	    fprintf(stdout, "\t\t  4N-HV\n");
-	else if (choice->tex == 6)
-	    fprintf(stdout, "\t\t  4N-DIAG\n");
-	else if (choice->tex == 7)
-	    fprintf(stdout, "\t\t  8N\n");
-	fprintf(stdout, "\tTEXTURE MEASURES:\n");
-	if (choice->te2[1])
-	    fprintf(stdout, "\t\t  contagion\n");
-	if (choice->te2[2])
-	    fprintf(stdout, "\t\t  ang. sec. mom.\n");
-	if (choice->te2[3])
-	    fprintf(stdout, "\t\t  inv. diff. mom.\n");
-	if (choice->te2[4])
-	    fprintf(stdout, "\t\t  entropy\n");
-	if (choice->te2[5])
-	    fprintf(stdout, "\t\t  contrast\n");
-    }
-
-    if (choice->jux[0]) {
-	fprintf(stdout, "\tJUXTAPOSITION MEASURES:\n");
-	if (choice->jux[1])
-	    fprintf(stdout, "\t\t  mean juxtaposition\n");
-	if (choice->jux[2])
-	    fprintf(stdout, "\t\t  standard deviation of juxtaposition\n");
-    }
-
-    if (choice->edg[0]) {
-	fprintf(stdout, "\tEDGE MEASURES:\n");
-	if (choice->edg[1])
-	    fprintf(stdout, "\t\t  sum of edges\n");
-	if (choice->edg[2])
-	    fprintf(stdout, "\t\t  sum of edges by type\n");
-    }
-
-    /* if not moving window, setup the
-       r.le.out subdirectory */
-
-    if (choice->wrum != 'm')
-	G_mkdir("r.le.out");
-
-    texture_fore();
-    G_free(choice);
-
-    return (EXIT_SUCCESS);
-}

+ 0 - 107
raster/r.le/r.le.pixel/pixel.h

@@ -1,107 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.pixel/pixel.h                               *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To analyze pixel-scale landscape properties     *
- *         pixel.h lists include files, defines data        *
- *         structures, and lists modules                    *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <grass/config.h>
-#include <stdio.h>
-#include <time.h>
-#include <math.h>
-#include <ctype.h>
-#include <stdlib.h>
-#include <string.h>
-#include <grass/gis.h>
-
-#define  BIG   1000000000.0
-#define  MAX   800
-
-typedef struct __dirdesc
-{
-    int dd_fd;			/* file descriptor */
-    long dd_loc;		/* buf offset of entry from last readddir() */
-    long dd_size;		/* amount of valid data in buffer */
-    long dd_bsize;		/* amount of entries read at a time */
-    long dd_off;		/* Current offset in dir (for telldir) */
-    char *dd_buf;		/* directory data buffer */
-} DIR;
-
-extern DIR *opendir( /* char *dirname */ );
-extern struct dirent *readdir( /* DIR *dirp */ );
-extern int closedir( /* DIR *dirp */ );
-
-struct CHOICE
-{
-    char fn[30], reg[30], wrum;
-    int edge, tex, fb, units, z, edgemap;
-    int att[5], div[5], te2[6];
-    int jux[3], edg[3];
-};
-
-typedef struct reglist
-{
-    int att;
-    int n, s, e, w;
-    struct reglist *next;
-} REGLIST;
-
-
-/** main.c **/
-void parse_cmd();
-void parse_mv();
-int get_int();
-
-/** driver.c **/
-void texture_fore();
-void mv_driver();
-void set_colors();
-void read_mwind();
-void meter2();
-void unit_driver();
-void run_clip(int, int, int, int, int, int, CELL **, int, int, float);
-void whole_reg_driver();
-FILE *fopen0();
-FILE *fopen1();
-FILE *fopen2();
-FILE *fopen3();
-void get_rich_whole();
-
-
-/** cellclip.c **/
-void cell_clip_drv(int, int, int, int, double **, int, int, float);
-void cell_clip(DCELL **, DCELL **, int, int, int, int, int, float);
-void get_rich();
-int is_not_empty_buffer();
-int center_is_not_zero();
-int compar();
-
-
-/** texture.c **/
-void mv_texture();
-void df_texture();
-void cal_att();
-void cal_divers();
-void cal_tex();
-void cal_edge();
-void read_weight();
-void read_edge();
-int find_loc();
-int find_edge();
-int check_order();
-
-/** input.c **/
-void user_input();

+ 0 - 39
raster/r.le/r.le.pixel/r.le.pixel.html

@@ -1,39 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-The <em>r.le.pixel</em> module contains a set of measures for attributes,
-diversity, texture, juxtaposition, and edge.
-
-
-<h2>NOTES</h2>
-
-Full instructions can be found in the <b>r.le manual</b> (see "REFERENCES"
-section below) and the <em><a href="r.le.setup.html">r.le.setup</a></em>
-help page.
-
-
-<h2>REFERENCES</h2>
-
-Baker, W.L. and Y. Cai. 1992. The r.le programs for multiscale analysis of
-landscape structure using the GRASS geographical information system.
-Landscape Ecology 7(4):291-302.
-<p>
-The <a href="http://grass.osgeo.org/gdp/landscape/r_le_manual5.pdf"><i>r.le</i>
-manual: Quantitative analysis of landscape structures</a> (GRASS 5; 2001)
-
-<h2>SEE ALSO</h2>
-
-<em>
-<!-- <a href="r.le.dist.html">r.le.dist</a>,
-<a href="r.le.null.html">r.le.null</a>, -->
-<a href="r.le.patch.html">r.le.patch</a>,
-<!-- <a href="r.le.rename.html">r.le.rename</a>, -->
-<a href="r.le.setup.html">r.le.setup</a>, 
-<a href="r.le.trace.html">r.le.trace</a></em>
-
-<h2>AUTHOR</h2>
-
-William L. Baker Department of Geography and Recreation University of
-Wyoming Laramie, Wyoming 82071 U.S.A.
-
-<p>
-<i>Last changed: $Date$</i>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1371
raster/r.le/r.le.pixel/texture.c


+ 0 - 14
raster/r.le/r.le.setup/Makefile

@@ -1,14 +0,0 @@
-MODULE_TOPDIR = ../../..
-
-PGM = r.le.setup
-
-LIBES = $(DISPLAYLIB) $(SITESLIB) $(VECTORLIB) $(GISLIB) $(DATETIMELIB)
-DEPENDENCIES = $(DISPLAYDEP) $(SITESDEP) $(VECTORDEP) $(GISDEP) $(DATETIMEDEP)
-EXTRA_INC = $(VECT_INC)
-EXTRA_CFLAGS = $(VECT_CFLAGS)
-CLEAN_SUBDIRS = polytocell
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd
-	$(MAKE) -C polytocell

+ 0 - 366
raster/r.le/r.le.setup/ask_group.c

@@ -1,366 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.setup/ask_group.c                           *
- *         Version 5.0beta            Oct. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To set up sampling areas, which can can then    *
- *         be used to obtain data using the r.le.dist,      *
- *         r.le.patch, and r.le.pixel programs.  The        *
- *         ask_group.c code queries the user for input      *
- *         regarding attribute and index groups             *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include "setup.h"
-#include <grass/config.h>
-#include <grass/vask.h>
-#include <unistd.h>
-#include <grass/gis.h>
-
-
-static void ask_limits(char *name, char *str);
-static void get_index(FILE * fp);
-static void ask_reclass(void);
-static void get_1recl(char *buf, int singles);
-static void ask_fromto(void);
-
-				/* PROMPT THE USER TO SELECT THE GROUP/CLASS
-				   LIMITS */
-
-int ask_group(char **sel)
-{
-
-    /* show the option menu using GRASS VASK
-       library function */
-
-    V_clear();
-    V_intrpt_msg("EXIT PROGRAM");
-
-    V_line(2, "SELECT ATTRIBUTE GROUP OR INDEX CLASS TO SETUP:");
-    V_line(3,
-	   "Type 'x' to select; <CR> to go to the next; <space> over to exclude");
-    V_line(5, "r.le.patch");
-    V_line(6, "   Attribute Groups");
-    V_line(7, "   Size Classes");
-    V_line(8, "   Shape Classes");
-    V_line(9, "      Perim./Area Index");
-    V_line(10, "      Corr. Perim./Area Index");
-    V_line(11, "      Rel. Circum. Circle Index");
-    V_line(13, "r.le.dist");
-    V_line(14, "   Distance Classes");
-    V_line(15, "      Center to Center");
-    V_line(16, "      Center to Edge");
-    V_line(17, "      Edge to Edge");
-    V_line(18, "   From & To Groups for di1=m7, m8, or m9");
-
-    V_ques(sel[0], 's', 6, 50, 1);
-    V_ques(sel[1], 's', 7, 50, 1);
-    V_ques(sel[2], 's', 9, 50, 1);
-    V_ques(sel[3], 's', 10, 50, 1);
-    V_ques(sel[4], 's', 11, 50, 1);
-    V_ques(sel[5], 's', 15, 50, 1);
-    V_ques(sel[6], 's', 16, 50, 1);
-    V_ques(sel[7], 's', 17, 50, 1);
-    V_ques(sel[8], 's', 18, 50, 1);
-
-    V_intrpt_ok();
-    if (!V_call())
-	return (-1);
-    return (1);
-}
-
-
-/* DRIVER TO LOOK FOR OLD VERSION OF GROUP/CLASS FILES, SETUP NEW FILES,
-   AND PRINT A MESSAGE ABOUT THESE FILES */
-
-int get_group_drv(char **sel)
-{
-
-    if (sel[0][0] == 'x') {
-	ask_reclass();
-	fprintf(stderr,
-		"\n    The attribute groups are saved in \"r.le.para/recl_tb\".");
-	G_sleep(2);
-    }
-    if (sel[1][0] == 'x') {
-	ask_limits("size", "    SIZE CLASSES");
-	fprintf(stderr,
-		"\n    The size classes are saved in \"r.le.para/size\".");
-	G_sleep(2);
-    }
-    if (sel[2][0] == 'x') {
-	ask_limits("shape_PA", "    SHAPE CLASSES: PERIMETER/AREA");
-	fprintf(stderr,
-		"\n    The shape (P/A) classes are saved in \"r.le.para/shape_PA\".");
-	G_sleep(2);
-    }
-    if (sel[3][0] == 'x') {
-	ask_limits("shape_CPA",
-		   "    SHAPE CLASSES: CORRECTED PERIMETER/AREA");
-	fprintf(stderr,
-		"\n    The shape (CPA) classes are saved in \"r.le.para/shape_CPA\".");
-	G_sleep(2);
-    }
-    if (sel[4][0] == 'x') {
-	ask_limits("shape_RCC",
-		   "    SHAPE CLASSES: RELATED CIRCUMSCRIBING CIRCLE");
-	fprintf(stderr,
-		"\n    The shape (RCC) classes are saved in \"r.le.para/shape_RCC\".");
-	G_sleep(2);
-    }
-    if (sel[5][0] == 'x') {
-	ask_limits("dist_cc", "    DISTANCE CLASSES: CENTER-CENTER");
-	fprintf(stderr,
-		"\n    The distance (CC) classes are saved in \"r.le.para/dist_cc\".");
-	G_sleep(2);
-    }
-    if (sel[6][0] == 'x') {
-	ask_limits("dist_ce", "    DISTANCE CLASSES: CENTER-EDGE");
-	fprintf(stderr,
-		"\n    The distance (CE) classes are saved in \"r.le.para/dist_ce\".");
-	G_sleep(2);
-    }
-    if (sel[7][0] == 'x') {
-	ask_limits("dist_ee", "    DISTANCE CLASSES: EDGE-EDGE");
-	fprintf(stderr,
-		"\n    The distance (EE) classes are saved in \"r.le.para/dist_ee\".");
-	G_sleep(2);
-    }
-    if (sel[8][0] == 'x') {
-	ask_fromto();
-	fprintf(stderr,
-		"\n    The attribute groups are saved in \"r.le.para/from_to\".");
-	G_sleep(2);
-    }
-    return (0);
-}
-
-
-
-/* GET THE LOWER LIMITS OF THE MEASURE INDEX CLASSES FROM THE SCREEN,
-   AND PUT THEM IN A FILE */
-
-static void ask_limits(char *name, char *str)
-{
-    FILE *fp;
-    char s[30];
-
-    G_system("clear");
-    fprintf(stderr, "\n%s \n", str);
-    sprintf(s, "r.le.para/%s", name);
-    fp = fopen0(s, "w");
-    get_index(fp);
-    fprintf(fp, " -999 - lower limits.\n");
-    fclose(fp);
-    return;
-}
-
-
-
-/* READ IN THE LOWER LIMITS OF THE MEASURE INDEX CLASSES FROM THE SCREEN */
-
-static void get_index(FILE * fp)
-{
-    double low, tmp = -999;
-
-    fprintf(stderr,
-	    "\n    Enter the lower limits in ascending order, -999 to end.\n");
-    fprintf(stderr, "    Example: 0 0.1 10 100 ..., -999.\n");
-    fprintf(stderr, "\n  > ");
-    for (;;) {
-	numtrap(1, &low);
-	if (low == -999)
-	    break;
-	if (low <= tmp) {
-	    fprintf(stderr,
-		    "A number not in ascending order was omitted; you\n");
-	    fprintf(stderr, "may wish to setup these classes again");
-	}
-	else {
-	    tmp = low;
-	    fprintf(fp, " %.2f ", low);
-
-	}
-    }
-    return;
-}
-
-
-
-/* GET THE ATTRIBUTE GROUP LIMITS FROM THE USER AND SAVE THEM IN FILE RECL_TB */
-
-static void ask_reclass(void)
-{
-    char *line, str[5];
-    FILE *fp;
-    register int i, j;
-
-    G_sleep_on_error(0);
-
-    /* display a message on the screen about inputing attribute gps */
-
-    G_system("clear");
-    fprintf(stderr,
-	    "\n\n    Please input attribute groups in table form just like in a");
-    fprintf(stderr,
-	    "\n      GRASS reclass table; Put a space before the = sign. After");
-    fprintf(stderr,
-	    "\n      each line of input, the program will confirm what you typed.");
-    fprintf(stderr, "\n      Maximum number of groups is 25\n");
-    fprintf(stderr, "    Example: 1 4 9  101 thru 120 = 1 forest\n");
-    fprintf(stderr, "             10 thru 100 = 2  prairie\n");
-    fprintf(stderr, "             end\n");
-
-
-  back:
-    fp = fopen0("r.le.para/recl_tb", "w");
-
-    /* there is a max of 25 attribute gps */
-
-    for (j = 0; j < 25; j++) {
-	line = (char *)G_calloc(512, sizeof(char));
-	fprintf(stderr, "  > ");
-
-
-	/* read in 1 line of attribute gp rule */
-
-	get_1recl(line, 0);
-	fputs(line, fp);
-	if (line[0] == 'e' && line[1] == 'n' && line[2] == 'd') {
-	    G_free(line);
-	    break;
-	}
-	G_free(line);
-    }
-
-    fclose(fp);
-    return;
-}
-
-
-
-
-/* READ IN 1 LINE OF THE ATTRIBUTE GP RULE FROM THE SCREEN */
-
-static void get_1recl(char *buf, int singles)
-{
-    register int i = 0;
-    int number = 0;
-    int c;
-
-    while (i < 512) {
-	while ((c = getchar()) != 't' && c != '=' && c != 'e' && !isdigit(c))
-	    getchar();
-	if (c == 't' && getchar() == 'h' && getchar() == 'r' &&
-	    getchar() == 'u') {
-	    buf[i] = 't';
-	    buf[i + 1] = 'h';
-	    buf[i + 2] = 'r';
-	    buf[i + 3] = 'u';
-	    buf[i + 4] = ' ';
-	    getchar();
-	    i += 5;
-	}
-	else if (c == '=' && !singles && number) {
-	    buf[i] = '=';
-	    i++;
-	    buf[i] = ' ';
-	    getchar();
-	    i++;
-	    while ((buf[i] = getchar()) != '\n')
-		i++;
-	    buf[i + 1] = '\0';
-	    break;
-	}
-	else if (c == 'e' && getchar() == 'n' && getchar() == 'd') {
-	    if (!singles)
-		i = 0;
-	    buf[i] = 'e';
-	    buf[i + 1] = 'n';
-	    buf[i + 2] = 'd';
-	    if (!singles) {
-		buf[i + 3] = '\n';
-		buf[i + 4] = '\0';
-		break;
-	    }
-	    buf[i + 3] = ' ';
-	    i += 4;
-	    while ((buf[i] = getchar()) != '\n')
-		i++;
-	    buf[i + 1] = '\0';
-	    break;
-	}
-	else if (isdigit(c)) {
-	    do
-		buf[(i++)] = c;
-	    while (isdigit(c = getchar()));
-	    buf[i] = ' ';
-	    number = 1;
-	    i++;
-	}
-    }
-    fprintf(stderr, "    Attribute group reclass rule is: %s\n", buf);
-
-    return;
-}
-
-
-
-
-/* PUT THE FROM & TO ATTRIBUTE GPS FOR DISTANCE METHOD di2=M7 to M9 INTO THE
-   FILE R.LE.PARA/FROM_TO */
-
-static void ask_fromto(void)
-{
-    register int i;
-    FILE *fp;
-    char *buf;
-
-    G_system("clear");
-    fp = fopen0("r.le.para/from_to", "w");
-    buf = G_malloc(513);
-
-    fprintf(stderr,
-	    "\n\n  Please enter \"FROM\" attribute group followed by \"0 end\"\n");
-    for (i = 0; i < 2; i++) {
-	fprintf(stderr,
-		"    Example: 2 0 end     -- This selects 2 as the group\n");
-	fprintf(stderr, "  > ");
-
-	get_1recl(buf, 1);
-	fputs(buf, fp);
-	if (i == 0)
-	    fprintf(stderr,
-		    "\n\n  Please enter \"TO\" attribute group followed by \"0 end\"\n");
-    }
-    fclose(fp);
-    G_free(buf);
-    return;
-}
-
-
-
-/* FUNCTION TO OPEN A FILE AND DISPLAY AN ERROR MESSAGE IF THE FILE IS NOT FOUND */
-
-FILE *fopen0(char *name, char *flag)
-{
-    FILE *fp;
-
-    if (!(fp = fopen(name, flag))) {
-	fprintf(stderr,
-		"\nCan't open file \"%s\"; use r.le.setup for group/class limits\n",
-		name);
-
-	exit(1);
-    }
-    return fp;
-}

+ 0 - 35
raster/r.le/r.le.setup/colors.h

@@ -1,35 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.setup/colors.h                              *
- *         Version 5.0beta            Oct. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To set up sampling areas, which can can then    *
- *         be used to obtain data using the r.le.dist,      *
- *         r.le.patch, and r.le.pixel programs.  The        *
- *         colors.h file defines the colors                 *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <grass/config.h>
-#define RED		1
-#define ORANGE		2
-#define YELLOW		3
-#define GREEN		4
-#define BLUE		5
-#define INDIGO		6
-#define VIOLET		7
-#define WHITE		8
-#define BLACK		9
-#define GRAY		10
-#define BROWN		11
-#define MAGENTA		12
-#define AQUA		13

+ 0 - 139
raster/r.le/r.le.setup/main.c

@@ -1,139 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.setup/main.c                                *
- *         Version 5.0beta            Oct. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To set up sampling areas, which can can then    *
- *         be used to obtain data using the r.le.dist,      *
- *         r.le.patch, and r.le.pixel programs.  The        *
- *         main.c code queries the user for the name of     *
- *         maps to be used during the setup operation       *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <dirent.h>
-
-#include <grass/config.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include <grass/glocale.h>
-#include "setup.h"
-
-
-static void get_pwd(void);
-
-jmp_buf jmp;
-
-				/* MAIN PROGRAM */
-
-int main(int argc, char *argv[])
-{
-
-    struct GModule *module;
-    struct Option *input, *vect;
-
-    struct Cell_head window;
-    int bot, right, t0, b0, l0, r0, clear = 0;
-    double Rw_l, Rscr_wl;
-    char *map_name = NULL, *v_name = NULL, *s_name = NULL;
-
-    /* Initialize the GIS calls */
-    G_gisinit(argv[0]);
-
-    module = G_define_module();
-    G_add_keyword(_("raster"));
-    module->description =
-	_("Interactive tool used to setup the sampling and analysis framework "
-	 "that will be used by the other r.le programs.");
-
-    input = G_define_standard_option(G_OPT_R_MAP);
-    input->description = _("Raster map to use to setup sampling");
-
-    vect = G_define_standard_option(G_OPT_V_INPUT);
-    vect->key = "vect";
-    vect->description = _("Vector map to overlay");
-    vect->required = NO;
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-
-    setbuf(stdout, NULL);	/* unbuffered */
-    setbuf(stderr, NULL);
-
-    G_sleep_on_error(1);	/* error messages get lost on clear screen */
-
-
-    map_name = input->answer;
-    v_name = vect->answer;
-    s_name = NULL;		/* sites not used in GRASS 6 */
-
-    /* setup the r.le.para directory */
-    get_pwd();
-
-    /* query for the map to be setup */
-    if (R_open_driver() != 0)
-	G_fatal_error("No graphics device selected");
-
-    /* setup the current window for display & clear screen */
-    D_setup(1);
-
-    Rw_l = (double)Rast_window_cols() / Rast_window_rows();
-    /*R_open_driver(); */
-    /* R_font("romant"); */
-    G_get_set_window(&window);
-    t0 = R_screen_top();
-    b0 = R_screen_bot();
-    l0 = R_screen_left();
-    r0 = R_screen_rite();
-    Rscr_wl = (double)(r0 - l0) / (b0 - t0);
-
-    if (Rscr_wl > Rw_l) {
-	bot = b0;
-	right = l0 + (b0 - t0) * Rw_l;
-    }
-
-    else {
-	right = r0;
-	bot = t0 + (r0 - l0) / Rw_l;
-    }
-    D_new_window("a", t0, bot, l0, right);
-    D_set_cur_wind("a");
-    D_show_window(D_translate_color("green"));
-    D_setup(clear);
-    R_close_driver();
-
-    /* invoke the setup modules */
-    set_map(map_name, v_name, s_name, window, t0, bot, l0, right);
-
-    return (EXIT_SUCCESS);
-}
-
-
-
-
-/* SETUP THE R.LE.PARA DIRECTORY */
-static void get_pwd(void)
-{
-    DIR *dp;
-
-    if (!(dp = opendir("r.le.para")))
-	G_mkdir("r.le.para");
-    else
-	closedir(dp);
-    return;
-
-}

+ 0 - 372
raster/r.le/r.le.setup/mv_wind.c

@@ -1,372 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.setup/mv_wind.c                             *
- *         Version 5.0beta            Oct. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To set up sampling areas, which can can then    *
- *         be used to obtain data using the r.le.dist,      *
- *         r.le.patch, and r.le.pixel programs.  The        *
- *         mv_wind.c code queries the user for information  *
- *         needed to setup the moving window                *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <grass/display.h>
-#include "setup.h"
-#include <grass/config.h>
-
-
-
-				/* SETUP THE PARAMETERS FOR THE 
-				   MOVING WINDOW */
-
-void mov_wind(int t, int b, int l, int r, char *n1, char *n2, char *n3,
-	      double *mx)
-{
-
-    int xp = 0, yp = 0, x1, y1, btn = 0, s, l0, t0, xpl, ypt,
-	u_w = 0, u_l = 0, u_w0, u_l0, w_w = 0, w_l = 0, initl = 0,
-	initt = 0, d, fmask, j, circle = 0;
-    register int i;
-    double tmp[2], tmp1, radius = 0.0;
-    FILE *fp;
-
-    /*
-       mx[0]        =       cols of region/width of screen
-       mx[1]        =       rows of region/height of screen
-       t    =       top row of sampling frame
-       b    =       bottom row of sampling frame
-       l    =       left col of sampling frame
-       r    =       right col of sampling frame
-     */
-
-    /* open the moving window parameter file */
-
-    fp = fopen0("r.le.para/move_wind", "w");
-    G_sleep_on_error(0);
-
-    initl = l;
-    initt = t;
-
-    l = (int)((double)(l * mx[0]) + 0.5);
-    r = (int)((double)(r * mx[0]) + 0.5);
-    t = (int)((double)(t * mx[1]) + 0.5);
-    b = (int)((double)(b * mx[1]) + 0.5);
-
-    /* display sampling frame */
-
-    R_open_driver();
-    R_standard_color(D_translate_color("grey"));
-    draw_box((int)(l / mx[0] + 0.5), (int)(t / mx[1] + 0.5),
-	     (int)(r / mx[0] + 0.5), (int)(b / mx[1] + 0.5), 1);
-    R_close_driver();
-
-    /* determine whether the user will use
-       the keyboard or mouse to setup the 
-       moving window */
-
-  keyboard:
-    fprintf(stderr, "\n\n    HOW WILL YOU SPECIFY THE MOVING WINDOW?\n");
-    fprintf(stderr,
-	    "\n       Use keyboard to enter moving window dimensions   1");
-    fprintf(stderr,
-	    "\n       Use mouse to draw moving window                  2\n");
-    fprintf(stderr,
-	    "\n                                            Which Number?  ");
-
-    numtrap(1, &tmp1);
-    d = (int)(tmp1);
-    if (d < 1 || d > 2) {
-	fprintf(stderr, "     You did not enter a 1 or 2, try again\n");
-
-	goto keyboard;
-    }
-
-    if (d == 1 || d == 2) {
-	/* return a value > 0 to fmask if there is
-	   a MASK present */
-
-	fprintf(stderr,
-		"\n    If a MASK is not present (see r.mask) a beep may sound\n");
-	fprintf(stderr,
-		"    and a WARNING may be printed that can be ignored.\n");
-	fprintf(stderr,
-		"    If a MASK is present there will be no warning.\n");
-
-	fmask = Rast_open_old("MASK", G_mapset());
-	fprintf(stderr, "\n");
-
-
-	/* setup the moving window using keyboard */
-
-	if (d == 1) {
-	    /* if sampling using circles */
-
-	    fprintf(stderr, "\n    Do you want to sample using rectangles");
-
-	    if (!G_yes
-		("\n       (including squares) (y) or circles (n)?   ", 1)) {
-		fprintf(stderr,
-			"\n    What radius do you want for the circles?  Radius");
-		fprintf(stderr,
-			"\n       is in pixels; add 0.5 pixels, for the center");
-		fprintf(stderr,
-			"\n       pixel, to the number of pixels outside the");
-		fprintf(stderr,
-			"\n       center pixel.  Type a real number with one");
-		fprintf(stderr,
-			"\n       decimal place ending in .5 (e.g., 4.5):        ");
-
-		numtrap(1, &radius);
-		u_w = (int)(2 * radius);
-		u_l = (int)(2 * radius);
-		u_w0 = u_w / mx[0];
-		u_l0 = u_l / mx[1];
-	    }
-
-	    /* if sampling using rectangles/squares */
-
-	    else {
-	      back:
-		fprintf(stderr,
-			"\n    Enter number of COLUMNS & ROWS for the dimensions of");
-		fprintf(stderr,
-			"\n       the moving window (e.g., 10 10):  ");
-
-		numtrap(2, tmp);
-		u_w = fabs(tmp[0]);
-		u_l = fabs(tmp[1]);
-		u_w0 = fabs(tmp[0]) / mx[0];
-		u_l0 = fabs(tmp[1]) / mx[1];
-
-		/* trap possible errors in dimensions */
-
-		if (!u_w0 || !u_l0) {
-		    fprintf(stderr,
-			    "\n    You entered a dimension as 0; enter dimensions again\n");
-
-		    goto back;
-		}
-		else if (u_w == 1 && u_l == 1) {
-		    fprintf(stderr,
-			    "\n    You entered dimensions as 1 1; This will not produce");
-		    fprintf(stderr,
-			    "\n       meaningful results; enter larger dimensions\n");
-
-		    goto back;
-		}
-		else if (u_w >= r || u_l >= b) {
-		    fprintf(stderr,
-			    "\n    Window size you chose allows < 2 windows across each row;");
-		    fprintf(stderr,
-			    "\n       please make window dimensions smaller\n");
-
-		    goto back;
-		}
-	    }
-
-	    /* display the user-defined moving
-	       window on the map */
-
-	    R_open_driver();
-	    R_standard_color(D_translate_color("red"));
-	    if (radius) {
-		draw_circle(initl, initt, initl + u_w0, initt + u_l0, 3);
-	    }
-	    else {
-		draw_box(initl, initt, initl + u_w0, initt + u_l0, 1);
-	    }
-	    R_close_driver();
-
-	    /* if all is OK, then set window dimensions */
-
-	    fprintf(stderr,
-		    "\n    Is the displayed moving window as you wanted it (y) or");
-
-	    if (G_yes("\n       do you want to redo it? (n)     ", 1)) {
-		xp = (int)(u_w0);
-		yp = (int)(u_l0);
-	    }
-	    else {
-		paint_map(n1, n2, n3);
-		R_open_driver();
-		R_standard_color(D_translate_color("grey"));
-		draw_box((int)(l / mx[0] + 0.5), (int)(t / mx[1] + 0.5),
-			 (int)(r / mx[0] + 0.5), (int)(b / mx[1] + 0.5), 1);
-		R_close_driver();
-		radius = 0.0;
-		goto keyboard;
-	    }
-	}
-
-	/* setup the moving window using the mouse */
-
-	else if (d == 2) {
-	    G_system("clear");
-
-	    /* if sampling using circles */
-
-	    fprintf(stderr,
-		    "\n\n    Do you want to use a rectangular (including squares) (y)");
-
-	    if (!G_yes("\n       or circular (n) moving window?   ", 1)) {
-		circle = 1;
-		fprintf(stderr,
-			"\n    Draw a rectangular area to contain a circular moving window.");
-		fprintf(stderr,
-			"\n    First select upper left corner, then lower right:\n");
-		fprintf(stderr, "       Left button:     Check unit size\n");
-		fprintf(stderr,
-			"       Middle button:   Upper left corner of area here\n");
-		fprintf(stderr,
-			"       Right button:    Lower right corner of area here\n");
-
-	    }
-	    else {
-		circle = 0;
-		fprintf(stderr,
-			"\n    Draw a rectangular (or square) moving window");
-		fprintf(stderr,
-			"\n    First select upper left corner, then lower right:\n");
-		fprintf(stderr,
-			"       Left button:     Check moving window size\n");
-		fprintf(stderr,
-			"       Middle button:   Upper left corner of window here\n");
-		fprintf(stderr,
-			"       Right: button:   Lower right corner of window here\n");
-
-	    }
-	    R_open_driver();
-	    while (btn != 3) {
-	      back1:
-		R_get_location_with_box(l, t, &xp, &yp, &btn);
-		u_w = (int)((double)(xp - l) * mx[0] + 0.5);
-		u_l = (int)((double)(yp - t) * mx[1] + 0.5);
-
-		if (btn == 1) {	/** show the size and ratio **/
-		    fprintf(stderr,
-			    "    Window would be %d columns wide by %d rows long\n",
-			    u_w, u_l);
-		    fprintf(stderr,
-			    "    Width/length would be %5.2f and area %d pixels\n",
-			    (float)u_w / u_l, u_w * u_l);
-
-		    for (i = 0; i < 120; i++)
-			fprintf(stderr, "\b");
-
-		}
-
-		else if (btn == 2) {
-		    R_move_abs(xp, yp);
-		    l0 = l;
-		    t0 = t;
-		    l = xp;
-		    t = yp;
-		}
-
-		else if (btn == 3) {
-		    xpl =
-			(int)((double)((int)((double)(xp - l) * mx[0] + 0.5))
-			      / mx[0]);
-		    ypt =
-			(int)((double)((int)((double)(yp - t) * mx[1] + 0.5))
-			      / mx[1]);
-		    if (xpl < 0 || ypt < 0) {
-			fprintf(stderr,
-				"\n    You did not put lower right corner below and to the");
-			fprintf(stderr,
-				"\n       of upper left corner. Please select lower right");
-			fprintf(stderr, "\n       corner again");
-
-			goto back1;
-		    }
-		    else if (xpl == 0 || ypt == 0) {
-			fprintf(stderr,
-				"\n\n    Window would have 0 rows and/or 0 columns;");
-			fprintf(stderr, "       try again\n");
-
-			goto back1;
-		    }
-		    else if (xpl > 0 && ypt > 0) {
-			R_standard_color(D_translate_color("red"));
-			if (circle) {
-			    if (xpl > ypt)
-				xpl = ypt;
-			    else if (ypt > xpl)
-				ypt = xpl;
-			    u_w = (int)((double)xpl * mx[0] + 0.5);
-			    u_l = (int)((double)ypt * mx[1] + 0.5);
-			    draw_circle(initl, initt, initl + xpl,
-					initt + ypt, 3);
-			}
-			else
-			    draw_box(initl, initt, initl + xpl, initt + ypt,
-				     1);
-
-			G_system("clear");
-			if (circle) {
-			    radius = (float)u_w / 2.0;
-			    fprintf(stderr,
-				    "\n\n    Circular moving window has radius = %5.2f pixels\n",
-				    radius);
-
-			}
-			else {
-			    fprintf(stderr,
-				    "\n    Rectangular moving window has %d columns and %d rows",
-				    u_w, u_l);
-			    fprintf(stderr,
-				    "\n    with width/length ratio of %5.2f and area of %d pixels\n",
-				    (float)u_w / u_l, u_w * u_l);
-
-			}
-		    }
-		}
-	    }
-	    R_close_driver();
-	    l = l0;
-	    t = t0;
-	}
-
-	Rast_close(fmask);
-    }
-
-    /* if neither, then exit */
-
-    else
-	exit(0);
-    /* write the moving window parameters
-       into the r.le.para/move_wind file */
-
-    fprintf(fp, "%8d%8d  u_w u_l: CELL\n", u_w, u_l);
-
-
-    w_w = r - l;
-    w_l = b - t;
-
-    /* write the radius of circles, if a
-       circular moving window is to be used */
-
-    fprintf(fp, "%8.1f          radius of circular moving window\n", radius);
-
-
-    /* write the search area in the
-       r.le.para/move_wind file */
-
-    fprintf(fp, "%8d%8d  w_w w_l\n", w_w, w_l);
-    fprintf(fp, "%8d%8d  x0, y0\n", (int)((double)(initl) * mx[0] + 0.5),
-	    (int)((double)(initt) * mx[1] + 0.5));
-
-
-    fclose(fp);
-    return;
-}

+ 0 - 24
raster/r.le/r.le.setup/polytocell/Makefile

@@ -1,24 +0,0 @@
-MODULE_TOPDIR = ../../../..
-
-OBJS = \
-	$(OBJDIR)/do_dots.o\
-	$(OBJDIR)/do_line.o\
-	$(OBJDIR)/find_area.o\
-	$(OBJDIR)/ply_t_bmif.o\
-	$(OBJDIR)/save_area.o\
-	$(OBJDIR)/wrte_recrd.o\
-	$(OBJDIR)/yadjust.o
-
-LIBES = $(GISLIB)
-DEPENDENCIES= $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: $(ETC)/bmif_to_cell $(ETC)/poly_to_bmif
-
-$(ETC)/bmif_to_cell: $(OBJDIR)/bmf_to_cll.o $(DEPENDENCIES)
-	$(CC) $(LDFLAGS) -o $@ $< $(FMODE_OBJ) $(LIBES) $(MATHLIB)
-
-$(ETC)/poly_to_bmif: $(OBJS)
-	$(CC) $(LDFLAGS) -o $@ $^ $(FMODE_OBJ)
-

+ 0 - 1
raster/r.le/r.le.setup/polytocell/README

@@ -1 +0,0 @@
-polytocell code

+ 0 - 110
raster/r.le/r.le.setup/polytocell/bmf.b

@@ -1,110 +0,0 @@
-
-#include "ply_to_cll.h"
-#include "gis.h"
-#include <stdio.h>
-#define ROW_SHIFT	-1
-
-char *gets() ;
-
-#define MAXLINE	 90
-#define FGET	    gets(buffer)
-#define READLINE	if (FGET==NULL) quit() ;\
-					sscanf (buffer,"%d%d%d%d",\
-					&cur_row, &col_b, &col_e, &cat) 
-
-main(argc, argv)
-	int argc;
-	char *argv[] ;
-{
-	struct Cell_head wind ;
-	char buffer[MAXLINE] ;
-	CELL *record ;
-	CELL *col_ptr ;
-	int cat ;
-	int cur_row, col_b, col_e ;
-	int num_rows, num_cols ;
-	int atrow, atcol ;
-	int newmap ;
-
-	if (argc != 2)
-		exit(-1) ;
-
-	G_gisinit("bmif_to_cell") ;
-
-	READLINE ;
-	num_rows = col_b ;
-	num_cols = col_e ;
-
-	if ((num_rows*num_cols) <= 0)
-	{
-		fprintf(stderr,
-		  "    READ ERROR:  bmif_to_cell receiving bad header info\n") ;
-		quit() ;
-	}
-
-	G_get_window(&wind) ;
-	wind.rows = num_rows ;
-	wind.cols = num_cols ;
-	wind.ew_res= 1.0 ;
-	wind.ns_res= 1.0 ;
-	wind.north = (double)wind.rows ;
-	wind.south = 0.0 ;
-	wind.east  = (double)wind.cols ;
-	wind.west  = 0.0 ;
-	G_set_window(&wind) ;
-
-	record = G_allocate_cell_buf() ;
-
-	if ( (newmap = G_open_cell_new(argv[1],"") ) == -1)
-	{
-	    fprintf("bmif_to_cell error: can't open raster map %s\n", argv[1]) ;
-	    quit() ;
-	}
-
-	READLINE ;
-
-	/* Loop for all data rows */
-	for(atrow=0; atrow<num_rows; atrow++)
-	{
-	/* zero the output buffer array */
-		col_ptr = record ;
-		for(atcol=0; atcol<num_cols; atcol++)
-			*(col_ptr++) = 0 ;
-		
-	/* If we've hit the end of the file, write out some zero rows and quit */
-		if (cur_row > num_rows)
-		{
-			while (atrow < num_rows)
-			{
-				G_put_map_row(newmap, record) ; 
-				atrow++ ;
-			}
-			G_close_cell(newmap) ;
-			exit(0) ;
-		}
-
-	/* write out enough rows to get to current row */
-		while (atrow < cur_row + ROW_SHIFT)
-		{
-			G_put_map_row(newmap, record) ; 
-			atrow++ ;
-		}
-
-		do
-		{
-			col_ptr = record + col_b ;
-			for(atcol=col_b; atcol<=col_e; atcol++)
-				*(col_ptr++) = (CELL)cat ;
-			READLINE ;
-		} while (cur_row == (atrow - ROW_SHIFT)) ;
-
-		G_put_map_row(newmap, record) ; 
-	}
-	fprintf(stderr, "Close: %d\n", G_close_cell(newmap)) ;
-}
-
-quit()
-{
-	fprintf(stderr,"    You drew a region outside the mask; restart REGIONS setup\n") ;
-	exit(-1) ;
-}

+ 0 - 138
raster/r.le/r.le.setup/polytocell/bmf_to_cll.c

@@ -1,138 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "ply_to_cll.h"
-#include <grass/gis.h>
-#define ROW_SHIFT	-1
-
-char *gets();
-
-#define MAXLINE	 500
-#define FGET	    gets(buffer)
-#define READLINE	if (FGET==NULL) quit() ;\
-					sscanf (buffer,"%d %*d:%d:%d:%ld",\
-					&cur_row, &col_b, &col_e, &cat)
-#define CONVERT	col_b = col_b / 100; col_e =  num_cols - (col_e / 100)
-
-int quit();
-
-/*
- *  sort cannot handle multiply numeric fields, negative numbers or decimals.
- *  get around these limitations by multipling by 100, sorting and then dividing
- *  by 100;  this gives us two decimal accuracy.  
- *  columns we want to sort in descending order.
- */
-
-int main(argc, argv)
-     int argc;
-     char *argv[];
-{
-    struct Cell_head wind;
-    struct Categories cats;
-    char buffer[MAXLINE];
-    CELL *record;
-    CELL *col_ptr;
-    long cat;
-    int cur_row, col_b, col_e;
-    int num_rows, num_cols;
-    int atrow, atcol;
-    int newmap;
-    int stat;
-    char *mapset;
-
-    if (argc != 2)
-	exit(EXIT_FAILURE);
-
-    G_gisinit("bmif_to_cell");
-
-    READLINE;
-    num_rows = col_b;
-    num_cols = col_e;
-
-    if (Rast_get_cellhd(argv[1], mapset = G_mapset(), &wind)) {
-	fprintf(stderr, "ERROR bmif_to_cell: can't read cellhd file for %s\n",
-		argv[1]);
-	quit();
-    }
-
-    if (num_rows != wind.rows || num_cols != wind.cols) {
-	fprintf(stderr,
-		"ERROR: bmif and cellhd rows and cols do not match\n");
-	fprintf(stderr, "   bmif_to_cell:        rows: %d   cols: %d\n",
-		num_rows, num_cols);
-	fprintf(stderr, "   Cellhd for <%s>: rows: %d   cols: %d\n", argv[1],
-		wind.rows, wind.cols);
-	quit();
-    }
-
-    Rast_set_window(&wind);
-
-    record = Rast_allocate_c_buf();
-
-    if ((newmap = Rast_open_c_new(argv[1])) == -1) {
-	fprintf(stderr, "ERROR bmif_to_cell: can't open raster map %s\n",
-		argv[1]);
-	quit();
-    }
-
-    READLINE;
-    CONVERT;
-
-    /* Loop for all data rows */
-    for (atrow = 0; atrow < num_rows; atrow++) {
-
-	/* zero the output buffer array */
-
-	col_ptr = record;
-	for (atcol = 0; atcol < num_cols; atcol++)
-	    *(col_ptr++) = 0;
-
-	/* If we've hit the end of the file, 
-	   write out some zero rows and quit */
-
-	if (cur_row > num_rows) {
-	    while (atrow < num_rows) {
-		Rast_put_c_row(newmap, record);
-		atrow++;
-	    }
-	    Rast_close(newmap);
-	    goto finish;
-	}
-
-	/* write out enough rows to get to current row */
-
-	while (atrow < cur_row + ROW_SHIFT) {
-	    Rast_put_c_row(newmap, record);
-	    atrow++;
-	}
-
-	do {
-	    col_ptr = record + col_b;
-	    for (atcol = col_b; atcol <= col_e; atcol++)
-		*(col_ptr++) = (CELL) cat;
-	    READLINE;
-	    CONVERT;
-	}
-	while (cur_row == (atrow - ROW_SHIFT));
-
-	Rast_put_c_row(newmap, record);
-    }
-    fprintf(stderr, "Close: %d\n", Rast_close(newmap));
-
-  finish:
-    G_suppress_warnings(1);
-    stat = Rast_read_vector_cats(argv[1], mapset, &cats);
-    G_suppress_warnings(0);
-    if (stat >= 0) {		/* if cats file existed */
-	printf("Copying vector category file\n");
-	stat = Rast_write_cats(argv[1], &cats);
-    }
-    exit(0);
-}
-
-
-int quit(void)
-{
-    fprintf(stderr,
-	    "    You drew a region outside the mask; restart REGIONS setup\n");
-    exit(EXIT_FAILURE);
-}

+ 0 - 12
raster/r.le/r.le.setup/polytocell/do_dots.c

@@ -1,12 +0,0 @@
-/* @(#)do_dots.c        2.1   6/26/87 */
-#include "ply_to_cll.h"
-
-void do_dots(double *xarray, double *yarray, int num_verticies, int category)
-{
-    int node;
-
-    for (node = 0; node < num_verticies; node++) {
-	write_record((int)(yarray[node] + .5),
-		     (float)xarray[node], (float)xarray[node], category);
-    }
-}

+ 0 - 159
raster/r.le/r.le.setup/polytocell/do_line.c

@@ -1,159 +0,0 @@
-/* @(#)do_line.c        2.2   8/31/87 */
-#include "ply_to_cll.h"
-
-void do_line(double *xarray, double *yarray, int num_verticies, int category)
-{
-    int node;
-
-    num_verticies--;
-
-    line_initialize();
-    for (node = 0; node < num_verticies; node++) {
-	line(category,
-	     (int)(xarray[node]),
-	     (int)(yarray[node] + .5),
-	     (int)(xarray[node + 1]), (int)(yarray[node + 1] + .5));
-    }
-    line_flush();
-}
-
-void line(int cat, int x0, int y0, int x1, int y1)
-{
-    int dx, dy;
-    int xinc, yinc;
-    int res1;
-    int res2;
-
-#ifdef DEBUG
-    fprintf(stderr, "Line %d %d %d %d\n", x0, y0, x1, y1);
-#endif
-
-    xinc = 1;
-    yinc = 1;
-    if ((dx = x1 - x0) < 0) {
-	xinc = -1;
-	dx = -dx;
-    }
-    if ((dy = y1 - y0) < 0) {
-	yinc = -1;
-	dy = -dy;
-    }
-
-    if (dy == 0) {		/* If dy is zero, dispatch immediately  */
-	if (xinc < 0)
-	    save_line(y0, x1, x0, 0, cat);
-	else
-	    save_line(y0, x0, x1, 0, cat);
-#ifdef DEBUG
-	fprintf(stderr, " dy==0 save %d %d %d\n", y0, x0, x1);
-#endif
-    }
-    else {
-	res1 = 0;
-	if (dx > dy) {
-	    res2 = dx;
-	    while (x0 != x1) {	/* for dx < dy  */
-		save_line(y0, x0, x0, 0, cat);
-#ifdef DEBUG
-		fprintf(stderr, " dx>dy save %d %d %d\n", y0, x0, x0);
-#endif
-		if (res1 > res2) {
-		    res2 += dx - res1;
-		    res1 = 0;
-		    y0 += yinc;
-		}
-		res1 += dy;
-		x0 += xinc;
-	    }
-	    save_line(y0, x0, x0, 0, cat);
-	}
-	else if (dx < dy) {
-	    res2 = dy;
-	    while (y0 != y1) {	/* for dx < dy  */
-		save_line(y0, x0, x0, 0, cat);
-#ifdef DEBUG
-		fprintf(stderr, " dx<dy save %d %d %d\n", y0, x0, x0);
-#endif
-		if (res1 > res2) {
-		    res2 += dy - res1;
-		    res1 = 0;
-		    x0 += xinc;
-		}
-		res1 += dx;
-		y0 += yinc;
-	    }
-	    save_line(y0, x0, x0, 0, cat);
-	}
-	else {
-	    while (x0 != x1) {	/* For dx == dy */
-		save_line(y0, x0, x0, 0, cat);
-#ifdef DEBUG
-		fprintf(stderr, " dx<dy save %d %d %d\n", y0, x0, x0);
-#endif
-		y0 += yinc;
-		x0 += xinc;
-	    }
-	    save_line(y0, x0, x0, 0, cat);
-	}
-	/*
-	   if (x0 > x1)
-	   save_line(y0, x1, x0, 0, cat ) ;
-	   else if (x1 > x0)
-	   save_line(y0, x0, x1, 0, cat ) ;
-	 */
-#ifdef DEBUG
-	fprintf(stderr, " END   save %d %d %d\n", y0, x0, x0);
-#endif
-    }
-}
-
-static int l_row, l_col1, l_col2, l_dum, l_cat;
-static int have_first = 0;
-
-void line_initialize(void)
-{
-    l_row = 0;
-    l_col1 = 0;
-    l_col2 = 0;
-    l_cat = 0;
-    l_dum = 0;
-    have_first = 0;
-}
-
-void line_flush(void)
-{
-    if (have_first)
-	write_record(l_row, (float)l_col1, (float)l_col2, l_cat);
-}
-
-void save_line(int row, int col1, int col2, int dum, int cat)
-{
-    have_first = 1;
-    if ((row != l_row) || (col1 != l_col1) ||
-	(col2 != l_col2) || (cat != l_cat)) {
-	if ((row != l_row) || (cat != l_cat)) {
-	    write_record(l_row, (float)l_col1, (float)l_col2, l_cat);
-	    l_row = row;
-	    l_col1 = col1;
-	    l_col2 = col2;
-	    l_cat = cat;
-	    l_dum = dum;
-	}
-	else {
-	    if ((col1 >= l_col2) && (col1 - l_col2 < 2))
-		l_col2 = col2;
-	    else {
-		if ((l_col1 >= col2) && (l_col1 - col2 < 2))
-		    l_col1 = col1;
-		else {
-		    write_record(l_row, (float)l_col1, (float)l_col2, l_cat);
-		    l_row = row;
-		    l_col1 = col1;
-		    l_col2 = col2;
-		    l_cat = cat;
-		    l_dum = dum;
-		}
-	    }
-	}
-    }
-}

+ 0 - 105
raster/r.le/r.le.setup/polytocell/find_area.c

@@ -1,105 +0,0 @@
-/* @(#)find_area.c      2.1   6/26/87 */
-#include <stdlib.h>
-#include "ply_to_cll.h"
-
-static int compare(const void *, const void *);
-
-void find_area(double *xarray, double *yarray, int num_verticies,
-	       struct element *xy, int *num_points)
-{
-    int node;
-    int row;
-    double A, B;
-    double delta_x, delta_y;
-    int first_row, last_row;
-
-    /* adjust Y grid coordinates to Y array coordinates */
-    yadjust(yarray, num_verticies);
-
-    *num_points = 0;
-
-    for (node = 0; node < num_verticies; node++) {
-#ifdef DEBUG
-	fprintf(stderr, "(x,y) %.2f:%.2f %.2f:%.2f  ",
-		xarray[node], yarray[node], xarray[node + 1],
-		yarray[node + 1]);
-#endif
-	/*  generate equation  */
-	delta_y = yarray[node + 1] - yarray[node];
-	delta_x = xarray[node + 1] - xarray[node];
-	if (delta_y == 0.0) ;
-	else {
-	    B = delta_x / delta_y;
-	    A = xarray[node] - B * yarray[node];
-	}
-#ifdef DEBUG
-	fprintf(stderr, "A = %f  B = %f\n", A, B);
-#endif
-
-	/*  determine first and last row involved */
-	if (yarray[node + 1] > yarray[node]) {
-	    if (yarray[node] > 0.0)
-		first_row = yarray[node] + 1.;
-	    else
-		first_row = yarray[node];
-	    if (yarray[node + 1] > 0.0)
-		last_row = yarray[node + 1];
-	    else
-		last_row = yarray[node + 1] - 1.;
-	}
-	else if (yarray[node + 1] < yarray[node]) {
-	    if (yarray[node + 1] > 0.0)
-		first_row = yarray[node + 1] + 1.;
-	    else
-		first_row = yarray[node + 1];
-	    if (yarray[node] > 0.0)
-		last_row = yarray[node];
-	    else
-		last_row = yarray[node] - 1.;
-	}
-
-#ifdef DEBUG
-	fprintf(stderr, "first: %6d  last: %6d\n", first_row, last_row);
-#endif
-
-	if (first_row > last_row)
-	    continue;
-
-	if (delta_y == 0.0)
-	    continue;
-
-	for (row = first_row; row <= last_row; row++) {
-	    xy[*num_points].row = row;
-	    xy[*num_points].col = A + B * row;
-#ifdef DEBUG
-	    fprintf(stderr, "%2d %2d %6.2f\n",
-		    *num_points, xy[*num_points].row, xy[*num_points].col);
-#endif
-	    (*num_points)++;
-	}
-    }
-
-    qsort(xy, *num_points, sizeof(struct element), compare);
-
-#ifdef DEBUG
-    fprintf(stderr, "\n");
-    for (row = 0; row < *num_points; row++)
-	fprintf(stderr, "%2d %2d %6.2f\n", row, xy[row].row, xy[row].col);
-#endif
-}
-
-static int compare(const void *e1, const void *e2)
-{
-    const struct element *element1 = e1;
-    const struct element *element2 = e2;
-
-    if (element1->row < element2->row)
-	return (-1);
-    if (element1->row > element2->row)
-	return (1);
-    if (element1->col < element2->col)
-	return (-1);
-    if (element1->col > element2->col)
-	return (1);
-    return (0);
-}

+ 0 - 142
raster/r.le/r.le.setup/polytocell/ply_t_bmif.c

@@ -1,142 +0,0 @@
-/* @(#)ply_t_bmif.c     2.1   6/26/87 */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "ply_to_cll.h"
-
-#define A(x)	fprintf(stderr,"%d\n", x)
-
-#define MAXLINE	 90
-#define FGET	    fgets(buff,MAXLINE,stdin)
-#define READLINE	if (FGET==NULL) exit(EXIT_FAILURE) ;\
-					sscanf (buff,"%1c %lf %lf %d\n", &type, &U_y, &U_x, &code)
-#define XADJ(x)	 (x * U_to_A_xconv + U_to_A_xadd) ;
-#define YADJ(y)	 (y * U_to_A_yconv + U_to_A_yadd) ;
-
-struct element xy[MAX_VERTICIES];
-
-int main(void)
-{
-    static double x[MAX_VERTICIES];
-    static double y[MAX_VERTICIES];
-    int num_verticies;
-    int num_points;
-    int num_pkgs;
-    int code, this_code;
-    char type, this_type;
-
-    double U_to_A_yadd;
-    double U_to_A_xadd;
-    double U_to_A_yconv;
-    double U_to_A_xconv;
-    double U_x, U_y;
-    double x_size, y_size, west, south;
-    int incr, numrows, numcols;
-    char buff[MAXLINE];
-    char word[80];
-
-    /* read through Grips Header to pick up coordinate conversion factors */
-    do {
-	if (FGET == NULL)
-	    exit(EXIT_FAILURE);
-	sscanf(buff, "%s\n", word);
-	incr = strcmp("ENDT\0", word);
-    }
-    while (incr != 0);
-
-    for (;;) {
-	if (FGET == NULL)
-	    return 1;
-	if (!strncmp("SIZE", buff, 4)) {
-	    sscanf(buff, "SIZE %d %d\n", &numrows, &numcols);
-	}
-	else if (!strncmp("CONVER", buff, 4)) {
-	    sscanf(buff, "CONVER%lf%lf%lf%lf",
-		   &U_to_A_yconv, &U_to_A_xconv, &U_to_A_yadd, &U_to_A_xadd);
-	}
-	else if (!strncmp("BOUND", buff, 4)) {
-	    sscanf(buff, "BOUND%lf%lf%lf%lf",
-		   &y_size, &x_size, &south, &west);
-	    U_to_A_yconv = 1.0 / y_size;
-	    U_to_A_xconv = 1.0 / x_size;
-	    U_to_A_yadd = -(south / y_size);
-	    U_to_A_xadd = -(west / x_size);
-	}
-	else
-	    break;
-    }
-
-    U_to_A_yconv *= -1;
-    U_to_A_yadd = (double)numrows - U_to_A_yadd;
-
-#ifdef DEBUG
-    fprintf(stderr, "NUMBER OF ROWS: %d    NUMBER OF COLUMNS: %d\n",
-	    numrows, numcols);
-    fprintf(stderr, "UtA_xconv %f UtA_yconv %f UtA_xadd %f UtA_yadd %f\n",
-	    U_to_A_xconv, U_to_A_yconv, U_to_A_xadd, U_to_A_yadd);
-#endif
-
-    /* begin cycling through the coordinates */
-
-    set_limits(numrows, numcols);
-
-    READLINE;
-    if (type == '(')
-	READLINE;
-
-    num_verticies = 0;
-    num_pkgs = 0;
-
-    while (type != 'E') {
-	num_verticies = 0;
-	this_type = type;
-	this_code = code;
-
-	x[num_verticies] = XADJ(U_x);
-	y[num_verticies++] = YADJ(U_y);
-
-	READLINE;
-	while (type == ' ') {
-	    x[num_verticies] = XADJ(U_x);
-	    y[num_verticies++] = YADJ(U_y);
-	    if (num_verticies > MAX_VERTICIES) {
-		while (type == ' ') {
-		    num_verticies++;
-		    READLINE;
-		}
-		fprintf(stderr, "MAXIMUM NUMBER OF VERTICIES EXCEEDED\n");
-		fprintf(stderr,
-			"  number of vertices read: %d   allowed: %d\n",
-			num_verticies, MAX_VERTICIES);
-		fprintf(stderr, "ABORTING\n");
-		exit(EXIT_FAILURE);
-	    }
-	    READLINE;
-	}
-
-	x[num_verticies] = x[0];
-	y[num_verticies] = y[0];
-
-	switch (this_type) {	/* switch to A(rea), L(ine), or D(ot) */
-	case 'A':
-	case 'a':
-	    find_area(x, y, num_verticies, xy, &num_points);
-	    save_area(xy, num_points, this_code);
-	    break;
-	case 'L':
-	case 'l':
-	    do_line(x, y, num_verticies, this_code);
-	    break;
-	case 'D':
-	case 'd':
-	    do_dots(x, y, num_verticies, this_code);
-	    break;
-	default:
-	    break;
-	}
-	num_pkgs++;
-    }
-    write_end_record(numrows + 1, numrows, numcols, 0);
-    write_end_record(0, numrows, numcols, 0);
-    exit(0);
-}

+ 0 - 32
raster/r.le/r.le.setup/polytocell/ply_to_cll.h

@@ -1,32 +0,0 @@
-/*@(#)ply_to_cll.h      2.1   6/26/87 */
-#include <stdio.h>
-
-#define POSITIVE	1
-#define NEGATIVE	-1
-#define ZERO		0
-#define INFINITE	2
-#define AREA	0
-#define LINE	1
-#define DOTS	2
-
-#define MAX_VERTICIES	12288
-
-struct element
-{
-    int row;
-    float col;
-};
-
-/* quick and dirty declaration - module will be discontinued if nobody supports it */
-void do_dots(double *, double *, int, int);
-void write_record(int, float, float, int);
-void line(int, int, int, int, int);
-void line_initialize(void);
-void line_flush(void);
-void yadjust(double *, int);
-void save_line(int, int, int, int, int);
-void set_limits(int, int);
-void find_area(double *, double *, int, struct element *, int *);
-void save_area(struct element *, int, int);
-void do_line(double *, double *, int, int);
-void write_end_record(int, int, int, int);

+ 0 - 32
raster/r.le/r.le.setup/polytocell/save_area.c

@@ -1,32 +0,0 @@
-/* %W%  %G%  */
-#include "ply_to_cll.h"
-#define START_ROW	xy[incr].row
-#define STOP_ROW	xy[incr+1].row
-#define START_COL	xy[incr].col
-#define STOP_COL	xy[incr+1].col
-
-void save_area(struct element *xy, int num_points, int category)
-{
-    int incr;
-    float first_cell, last_cell;
-
-    for (incr = 0; incr < num_points;) {
-
-	if (START_ROW != STOP_ROW) {
-	    fprintf(stderr, "ERROR: start and end row not same\n");
-	    for (incr = 0; incr < num_points; incr += 2) {
-		fprintf(stderr, "%d: %d %f %d %f\n",
-			incr, xy[incr].row, xy[incr].col,
-			xy[incr + 1].row, xy[incr + 1].col);
-	    }
-	    incr++;
-	    continue;
-	}
-
-	first_cell = START_COL + 1.;
-	last_cell = STOP_COL;
-	if (last_cell >= first_cell)
-	    write_record(START_ROW, first_cell, last_cell, category);
-	incr += 2;
-    }
-}

+ 0 - 48
raster/r.le/r.le.setup/polytocell/wrte_recrd.c

@@ -1,48 +0,0 @@
-#include <stdio.h>
-static int rec_num = 1;
-static int maxrow, minrow;
-static float maxcol, mincol;
-
-void set_limits(int numrows, int numcols)
-{
-    maxrow = numrows;
-    maxcol = (float)(numcols - 1);
-    minrow = 1;
-    mincol = 0.0;
-}
-
-static int check_limits(int *row, float *first_cell, float *last_cell)
-{
-    if (*row < minrow)
-	return (0);
-    if (*row > maxrow)
-	return (0);
-    if (*first_cell > maxcol)
-	return (0);
-    if (*last_cell < mincol)
-	return (0);
-    if (*first_cell < mincol)
-	*first_cell = mincol;
-    if (*last_cell > maxcol)
-	*last_cell = maxcol;
-    *last_cell = maxcol - *last_cell;
-    return (1);
-}
-
-void write_record(int row, float first_cell, float last_cell, int category)
-{
-    float fc, lc;
-
-    fc = first_cell;
-    lc = last_cell;
-
-    if (check_limits(&row, &fc, &lc))
-	printf("%d %8d:%d:%d:%d\n",
-	       row, rec_num++, (int)(100. * fc), (int)(100. * lc), category);
-}
-
-void write_end_record(int row, int first_cell, int last_cell, int category)
-{
-    printf("%d %8d:%d:%d:%d\n",
-	   row, rec_num++, first_cell, last_cell, category);
-}

+ 0 - 20
raster/r.le/r.le.setup/polytocell/yadjust.c

@@ -1,20 +0,0 @@
-/* @(#)yadjust.c        2.1   6/26/87 */
-#include <stdio.h>
-/* FIRST  change all Y grid coordinates to array coordinates.
- *        (add .5 to all Y grid coordinates)
- *        X array coordinates are simply (int)(GRID_X)
- * THEN   add .0001 to all integer y values 
- *        This takes care of all sorts of evils and time later on  
- */
-void yadjust(double *yarray, int num_verticies)
-{
-    int row, incr;
-    double *pointer;
-
-    for (pointer = yarray, incr = 0; incr <= num_verticies; incr++, pointer++) {
-	*pointer += .5;
-	row = *pointer;
-	if (*pointer == (double)row)
-	    *pointer += .0001;
-    }
-}

+ 0 - 471
raster/r.le/r.le.setup/r.le.setup.html

@@ -1,471 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-<em>r.le.setup</em> program is used to set
-up the sampling and analysis framework that will be used by the other
-<em>r.le</em> programs.
-
-<h2>NOTES</h2>
-
-<i>Full instructions can be found in the <b>r.le manual</b> (see "REFERENCES"
-section below).</i>
-<p>
-
-The first menu allows the user to define a rectangular sampling frame, 
-select how sampling will be done (regions, sampling units, moving window), 
-setup the limits for groups and classes, and change the color table.  
-Use the left mouse button to make your choice.
-
-<p>
-
-Information about the structure of the landscape is obtained by overlaying 
-a set of sampling areas on top of a specified part (the sampling frame of 
-a map layer, and then calculating specific structural measures for the part 
-of the map layer that corresponds to the area in each sampling area.  
-
-<p>
-
-To setup a <em><b>sampling frame</b></em> click on SAMPLING FRAME in the 
-main menu.  The program will ask "Will the sampling frame (total area 
-within which sampling units are distributed) be the whole map? (y/n)  [y]"  
-Just hit a carriage return to accept the default, which is to use the 
-whole map.  You do not need to setup a sampling frame if you want to use 
-the whole map, as this is the default.  To setup a different sampling 
-frame type "n" in response to this question.  Then use the mouse and a 
-rubber band box to outline a rectangular sampling frame on screen.  
-This box will be moved to the nearest row and column of the map.  
-You will be asked last whether you want to "Refresh the screen before
-choosing more setup?"  If you don't like the sampling frame you just setup, 
-answer yes to this question, then click on SAMPLING FRAME again to redo 
-this part of the setup.  This sampling frame will be used in all subsequent 
-setup procedures unless you change it.  You can change it at any time by 
-simply clicking on SAMPLING FRAME again.  
-
-<p>
-
-A <em><b>sampling area</b></em> may be one of four things.  First, it is 
-possible to treat the entire map layer as the one (and only) sampling area.  
-Second, if the map layer can be divided into meaningful geographical regions, 
-then it is possible to treat the regions themselves as sampling areas.  
-The third option is that the sampling areas may be sampling units of 
-fixed shape and size (also called scale) that are placed within the map 
-layer as a whole.  The fourth and final option is that the sampling area 
-may be moved systematically across the map as a moving window. 
-
-<p>
-
-If regions are to be used as the sampling areas , then the user can use 
-<em>r.le.setup</em> to draw regions or any existing map of regions can 
-simply be used directly.  To draw regions and create a new regions map 
-in <em>r.le.setup</em> select "REGIONS" from the first <em>r.le.setup</em> 
-menu, and the user is asked to do the following:
-
-<dl>
-<pre>
-1.  "ENTER THE NEW REGION MAP NAME:". Only a new raster map name is 
-acceptable. The user can type LIST to find out the existing raster map 
-names in this location and mapset.
-
-2. "PLEASE OUTLINE REGION # 1". The user should move the mouse cursor 
-into the graphic monitor window and use the mouse buttons as instructed:
-Left button: where am I.to display the current coordinates of the cursor.
-Middle button: Mark start (next) point. to enter a vertex of the region 
-boundary.
-Right button: Finish region-connect to 1st point to close the region 
-boundary by setting the last vertex to be equal to the first one.
-
-3. A "REGION OPTIONS:" menu is displayed and the user should use the mouse 
-to select one of
-   the options:<br>
-"DRAW MORE": repeat the above process and setup another region.
-"START OVER": abandon the previous setup and start all over again.
-"DONE-SAVE": save the regions outlined so far and exit this procedure.
-"QUIT-NO SAVE": quit the procedure without saving the regions.
-</pre>
-</dl>
-
-Once the "DONE-SAVE" option is selected, the new raster map of the sampling 
-regions is generated. It is displayed on the monitor window for several 
-seconds, the monitor window is refreshed, the main menu is displayed again, 
-and the program is ready for other setup work.  Note that you cannot draw 
-regions in areas outside the mask, if a mask is present (see <em>r.mask</em> 
-command).
-
-<p>
-
-The user can also use the GRASS <em><a href="wxGUI.vdigit.html">wxGUI vector digitizer</a></em> 
-to digitize circular or polygonal regions and to create a 
-sampling regions map without using <em>r.le.setup</em>.  Or, as mentioned
-above, an existing raster map can be used as a regions map.
-
-<p>
-
-If sampling units are to be used as the sampling areas (Fig. 2), then 
-choose "SAMPLING UNITS" from the first <em>r.le.setup</em> menu.  
-The program checks the <em>r.le.para</em> subdirectory for an existing 
-"units" file from a previous setup session and allows the user to rename 
-this file (to save it) before proceeding.  The r.le.setup program will 
-otherwise overwrite the "units" file.  Then the following choice is 
-displayed followed by a series of other choices:
-
-<dl>
-<dd>
-<pre>
-	Which do you want to do?
-	   (1) Use the keyboard to enter sampling unit parameters
-	   (2) Draw the sampling units with the mouse
-							Enter 1 or 2:
-
-</pre>
-</dl>
-
-When sampling units are defined using the keyboard, the user inputs the 
-shape and size (scale) of the sampling units by specifying dimensions 
-in pixels using the keyboard.  When sampling units are drawn with the 
-mouse, the user clicks the mouse to define the sampling units in the 
-GRASS monitor window, and then actually places the sampling units for 
-each scale onto the map.  By placing the units with the mouse the user 
-can directly determine the method of sampling unit distribution as well 
-as the shape, size, and number of sampling units.
-
-<p>
-
-If the choice is made to define sampling units using the keyboard, the 
-following series of questions must be answered:
-
-<dl>
-<dd>
-<pre>
-	How many different SCALES do you want (1-15)?
-</pre>
-</dl>
-
-The user is asked to specify the number of scales that will be used.  
-The <em>r.le</em> programs allow the user to simultaneously sample the 
-same map with the same measures using sampling areas of different sizes.  
-Currently there can be between 1 and 15 scales that can be sampled 
-simultaneously. Substantial output can be produced if many scales are used.
-
-<p>
-
-Sampling units must be placed spatially into the landscape.  There are 
-five options for doing this : 
-
-<p>
-
-<em>Random nonoverlapping</em><br>
-Sampling units are placed in the landscape by randomly choosing numbers 
-that specify the location of the upper left corner of each sampling unit, 
-subject to the constraint that successive sampling units not overlap other 
-sampling units or the edge of the landscape, and that they must be entirely 
-within the area defined by the mask (see <em>r.mask</em> command) if one 
-exists.
-
-<p>
-
-<em>Systematic contiguous</em><br>
-Sampling units are placed side by side across the rows.  The user will 
-be able to enter a row and column to indicate where the upper left corner 
-of the systematic contiguous framework should be placed.  Rows are numbered 
-from the top down beginning with row 1 of the sampling frame.  Columns are 
-numbered from left to right, beginning with column 1 of the sampling frame.  
-A random starting location can be obtained by using a standard random 
-number table to choose the starting row and column.  The <em>r.le.setup</em> 
-program does not avoid placing the set of sampling units over areas 
-outside the mask.  The user will have to make sure that sampling units do 
-not extend outside the mask by choosing a particular starting row and 
-column or by drawing a sampling frame before placing the set of sampling 
-units.
-
-<p>
-
-<em>Systematic noncontiguous</em><br>
-The user must specify the starting row and column as in #2 above and the 
-amount of spacing (in pixels) between sampling units.  Horizontal and 
-vertical spacing are identical.  Sampling units are again placed side by 
-side (but spaced) across the rows.  As in #2 the program does not avoid 
-placing sampling units outside the masked area; the user will have to 
-position the set of units to avoid areas outside the mask.
-
-<p>
-
-<em>Stratified random</em><br>
-The strata are rectangular areas within which single sampling units 
-are randomly located.  The user must first specify the starting row 
-and column as in #2 above.  Then the user must specify the number of 
-strata in the horizontal and vertical directions.   As in #2 the program 
-does not avoid placing sampling units outside the masked area; the user 
-will have to position the set of units to avoid areas outside the mask.
-
-<p>
-
-<em>Centered over sites</em><br>
-The user must specify the name of a sitefile containing point locations.  
-A single sampling unit is placed with its center over each site in the site 
-file.  This is a useful approach for determining the landscape structure 
-around points, such as around the location of wildlife observations.
-
-<p>
-
-The user is prompted to enter a ratio that defines the shape of the 
-sampling units.  Sampling units may have any rectangular shape, 
-including square as a special case of rectangular.  Rectangular shapes 
-are specified by entering the ratio of columns/rows (horizontal 
-dimension/vertical dimension) as a real number.  For example, to obtain 
-a sampling unit 10 columns wide by 4 rows long specify the ratio as 2.5 
-(10/4).
-<dl>
-<dd>
-<pre>
-	Recommended maximum SIZE is m in x cell total area. <br>
-	What size (in cells) for each sampling unit of scale n?
-</pre>
-</dl>
-
-The user is then given the recommended maximum possible size for a 
-sampling unit (in pixels) and asked to input the size of sampling units 
-at each scale.  Sampling units can be of any size, but the maximum size 
-is the size of the landscape as a whole.  All the sampling units, that 
-make up a single sampling scale, are the same size.  After specifying 
-the size, the program determines the nearest actual number of rows and 
-columns, and hence size, that is closest to the requested size, given 
-the shape requested earlier.
-<dl>
-<dd>
-<pre>
-	The nearest size is x cells wide X y cells high = xy cells
-	Is this size OK?  (y/n)  [y]
-
-	Maximum NUMBER of units in scale n is p?
-	What NUMBER of sampling units do you want to try to use?
-</pre>
-</dl>
-
-The maximum number of units that can be placed over the map, given the 
-shape and size of the units, is then given.  The user can then choose 
-the number of sampling units to be used in the map layer.  It may not 
-always be possible to choose the maximum number, depending upon the 
-shape of the sampling units.  In the case of systematic contiguous and 
-noncontiguous, the program will indicate how many units will fit across 
-the columns and down the rows.  The user can then specify a particular 
-layout (e.g., 6 units could be placed as 2 rows of 3 per row or as 3 
-rows of 2 per row).
-<dl>
-<dd>
-<pre>
-	Is this set of sampling units OK?  (y/n)  [y]
-</pre>
-</dl>
-
-Finally, the set of sampling units is displayed on the screen (e.g., Fig. 1) 
-and the user is asked whether it is acceptable.  If the answer is no, then 
-the user is asked if the screen should be refreshed before redisplaying 
-the menu for "Methods of sampling unit distribution" so that the user can 
-try the sampling unit setup again.
-
-<p>
-
-The choice is made to define sampling units using the mouse, then the 
-following menu for use with the mouse is displayed:
-<dl>
-<dd>
-<pre>
-	Outline the standard sampling unit of scale n.
-	   Left button:	Check unit size
-	   Middle button:	Move cursor
-	   Right button:	Lower right corner of unit here
-</pre>
-</dl>
-
-The user can then use the mouse and the rubber band box to outline the 
-standard sampling unit.  Once it has been outlined, the number of columns 
-and rows in the unit, the ratio of width/length and the size of the unit, 
-in cells, will be displayed.  After this first unit is outlined, then a 
-new menu is displayed:
-<dl>
-<dd>
-<pre>
-	Outline more sampling units of scale n?
-	   Left button:	Exit
-	   Middle button:	Check unit position
-	   Right button:	Lower right corner of next unit here
-</pre>
-</dl>
-
-The user can then place more units identical to the standard unit by 
-simply clicking the right mouse button where the lower right corner of 
-the unit should be placed.  The rest of the rubber band box can be 
-ignored while placing additional units.  The program is set up so that 
-units cannot be placed so they overlap one another, so they overlap the 
-area outside the mask, or so they overlap the edge of the sampling frame.  
-Warning messages are issued for all three of these errors and a sampling 
-unit is simply not placed.
-
-<p>
-
-Using this procedure a rectangular "window" or single sampling area is 
-moved systematically across the map to produce a new map (Fig. 2,3).  
-This sampling procedure can only be used with the measures that produce 
-a single value or with a single class or group when measures produce 
-distributions of values (Table 1).  The first class or group specified 
-when defining class or group limits (section 2.3.2.) is used if 
-distributional measures are chosen with the moving window sampling 
-method.  In this case, the user should manually edit the 
-<em>r.le.para/recl_tb</em> file so that the desired group is listed as 
-the first group in this file. 
-
-<p>
-
-Sampling begins with the upper left corner of the window placed over 
-the upper left corner of the sampling frame.  It is strongly recommended 
-that the user read the section on the GRASS mask (section 2.2.2) prior 
-to setting up the moving window, as this mask can be used to speed up 
-the moving window operation.  The value of the chosen measure is 
-calculated for the window area.  This value is assigned to the location 
-on the new map layer corresponding to the center pixel in the window if 
-the window has odd (e.g. 3 X 3) dimensions.  The value is assigned to 
-the location on the new map layer corresponding to the first pixel below 
-and to the right of the center if the window has even dimensions 
-(e.g. 6 X 10).  If this pixel has the value "0," which means "no data" in 
-GRASS, then this pixel is skipped and a value of "0" is assigned to the 
-corresponding location in the new map.  The window is then moved to the 
-right (across the row) by one pixel, and the process is repeated. 
-At the end of the row, the window is moved down one pixel, and then back 
-across the row.  This option produces a new map layer, whose dimensions 
-are smaller by approximately (m-1)/2 rows and columns, where m is the 
-number of rows or columns in the window.  
-
-<p>
-
-If the "MOVE-WINDOW" option in the main menu is selected, first the 
-program checks for an existing "move_wind" file, in the r.le.para 
-subdirectory, containing moving window specifications from a previous 
-session.  The user is given the option to avoid overwriting this file 
-by entering a new file name for the old "move_wind" file.  Users should 
-be aware that moving window analyses are very slow, because a large 
-number of sampling units are, in effect, used.  See the appendix on 
-"Time needed to complete analyses with the r.le programs" for some 
-ideas about how moving window size and sampling frame area affect 
-the needed time to complete the analyses.
-
-<p>
-
-The <em>r.le</em> programs <em>r.le.dist</em> and <em>r.le.patch</em> 
-allow the attribute categories in the input map to be reclassed into 
-several attribute groups, and reports the analysis results by each of 
-these attribute groups.  It is necessary to setup group limits for 
-all measures that say "by gp" when typing "<em>r.le.dist help</em>" 
-or "<em>r.le.patch help</em>" at the GRASS prompt.  The same reclassing 
-can be done with the measurement indices (e.g., size), except that each 
-"cohort" (class) of the reclassed indices is called an index class 
-instead of a group.  It is also necessary to setup class limits for 
-all measures that say "by class" when typing "<em>r.le.dist help</em>" 
-or "<em>r.le.patch help</em>" at the GRASS prompt.  
-
-<p>
-
-Group/class limits are setup by choosing "GROUP/CLASS LIMITS" from the 
-main menu upon starting <em>r.le.setup</em>, or you can create the files 
-manually using a text editor.  The program checks for existing group/class 
-limit files in subdirectory <em>r.le.para</em> and allows the user to 
-rename these files prior to continuing.  If the files are not renamed 
-the program will overwrite them.  The files are named recl_tb (attribute 
-group limits), size (size class limits), shape_PA (shape index class 
-limits for perimeter/area index), shape_CPA (shape index class limits 
-for corrected perimeter/area index), shape_RCC (shape index class limits 
-for related circumscribing circle index), and from_to (for the 
-<em>r.le.dist</em> program distance methods m7-m9). 
-
-<p>
-
-Attribute groups and index classes are defined in a different way.  
-In the <em>r.le</em> programs attribute groups are defined as in the 
-following example:
-<dl>
-<dd>
-<pre>
-	1, 3, 5, 7, 9 <b>thru</b> 21 = 1 (comment)
-	31 <b>thru</b> 50 = 2 (comment)
-	<b>end</b>
-</pre>
-</dl>
-
-In this example, the existing categories 1, 3, 5, 7, {9, 10, ... 20, 21} 
-are included in the new group 1, while {31, 32, 33, ..., 49, 50} are 
-included in the new group 2.  The characters in bold are the "key words" 
-that are required in the definition.  Each line is called one "reclass rule".
-
-<p>
-
-The GRASS reclass convention is adopted here with a little modification 
-(see "<em>r.reclass</em>" command in the GRASS User's Manual).  
-The difference is that r.le only allows one rule for each group while the 
-GRASS <em>r.reclass</em> command allows more than one. The definition of 
-"from" and "to" groups is simply the extension of the GRASS reclass rule.  
-The advantage of using the GRASS reclass convention is that the user can
-generate a permanent reclassed map, using GRASS programs, directly from the 
-<em>r.le</em> setup results.
-
-<p>
-
-The <em>r.le</em> measurement index classes are defined by the lower 
-limits of the classes, as in the following example:
-<dl>
-<dd>
-<pre>
-	0.0, 10.0, 50.0, 200.0, <b>-999</b>
-</pre>
-</dl>
-
-This means: 
-<dl>
-<dd>
-<pre>
-	if v &gt;= 0.0 and v &lt; 10.0 then  v belongs to index class 1;
-	if v &gt;= 10.0 and v &lt; 50.0 then  v belongs to index class 2;
-	if v &gt;= 50.0 and v &lt; 200.0 then v belongs to index class 3;
-	if v &gt;= 200.0 then v belongs to index class 4;
-</pre>
-</dl>
-
-where v is the calculated index value and <b>-999</b> marks the end of 
-the index class definition. The measurement index can be the size index, 
-one of the three shape indices, or one of the three distance indices.  
-The program is currently designed to allow no more than 25 attribute 
-groups, 25 size classes, 25 shape index classes, and 25 distance index 
-classes.  As an alternative, the user may want to permanently group 
-certain attributes prior to entering the <em>r.le</em> programs.  
-For example, the user may want to group attributes 1-10, in a map whose 
-attributes are ages, into a single attribute representing young patches.  
-The user can do this using the GRASS <em>r.reclass</em> and 
-<em>r.resample</em> commands, which will create a new map layer that can 
-then be analyzed directly (without setting up group limits) with the 
-<em>r.le</em> programs.
-
-
-<h2>REFERENCES</h2>
-
-Baker, W.L. and Y. Cai. 1992. The r.le programs for multiscale analysis of
-landscape structure using the GRASS geographical information system.
-Landscape Ecology 7(4):291-302.
-<p>
-The <a href="http://grass.osgeo.org/gdp/landscape/r_le_manual5.pdf"><i>r.le</i>
-manual: Quantitative analysis of landscape structures</a> (GRASS 5; 2001)
-
-
-<h2>SEE ALSO</h2>
-
-<em>
-<!-- <a href="r.le.dist.html">r.le.dist</a>,
-<a href="r.le.null.html">r.le.null</a>, -->
-<a href="r.le.patch.html">r.le.patch</a>,
-<a href="r.le.pixel.html">r.le.pixel</a>,
-<!-- <a href="r.le.rename.html">r.le.rename</a>, -->
-<a href="r.le.trace.html">r.le.trace</a></em>
-
-<h2>AUTHOR</h2>
-
-William L. Baker Department of Geography and Recreation University of
-Wyoming Laramie, Wyoming 82071 U.S.A.
-
-<p>
-<i>Last changed: $Date$</i>

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1762
raster/r.le/r.le.setup/sample.c


+ 0 - 814
raster/r.le/r.le.setup/setup.c

@@ -1,814 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.setup/setup.c                               *
- *         Version 5.0beta            Oct. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To set up sampling areas, which can can then    *
- *         be used to obtain data using the r.le.dist,      *
- *         r.le.patch, and r.le.pixel programs.  The        *
- *         setup.c code displays menus on the screen and    *
- *         asks for user input                              *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <grass/gis.h>
-#include <grass/display.h>
-#include "setup.h"
-#include <grass/config.h>
-
-struct Colors *colors_old;
-
-static void change_draw(void);
-static void set_rgn(double *msc, char *name, char *name1, char *name2);
-static void set_frame(double *msc, int *t, int *b, int *l, int *r);
-static void ppoint(double *m, int x, int y, int num);
-static void pbutton(int opt);
-static void save_rgn(char *name, char *tempfile, FILE * tmp, int *x, int *y,
-		     int pts, int class, int opt);
-static void print_hd(FILE * mapfile, struct Cell_head *universe);
-static void scr_cell(struct Cell_head *wind, int top, int bot, int left,
-		     int right, double *m);
-static void change_color(char *name, char *name1, char *name2);
-
-static void change_draw(void)
-{
-
-    int method;
-    double dtmp;
-
-    G_system("clear");
-    fprintf(stderr, "\n\n    CHOOSE THE COLOR FOR DRAWING:\n\n");
-    fprintf(stderr, "       Red             1\n");
-    fprintf(stderr, "       Orange          2\n");
-    fprintf(stderr, "       Yellow          3\n");
-    fprintf(stderr, "       Green           4\n");
-    fprintf(stderr, "       Blue            5\n");
-    fprintf(stderr, "       Indigo          6\n");
-    fprintf(stderr, "       White           7\n");
-    fprintf(stderr, "       Black           8\n");
-    fprintf(stderr, "       Brown           9\n");
-    fprintf(stderr, "       Magenta        10\n");
-    fprintf(stderr, "       Aqua           11\n");
-    fprintf(stderr, "       Gray           12\n\n");
-
-    do {
-	fprintf(stderr, "\n                             Which Number?   ");
-	numtrap(1, &dtmp);
-	if ((method = fabs(dtmp)) > 12 || method < 1) {
-	    fprintf(stderr, "\n    Choice must between 1-12; try again");
-	}
-    }
-    while (method > 12 || method < 1);
-
-    if (method == 1)
-	R_standard_color(D_translate_color("red"));
-    else if (method == 2)
-	R_standard_color(D_translate_color("orange"));
-    else if (method == 3)
-	R_standard_color(D_translate_color("yellow"));
-    else if (method == 4)
-	R_standard_color(D_translate_color("green"));
-    else if (method == 5)
-	R_standard_color(D_translate_color("blue"));
-    else if (method == 6)
-	R_standard_color(D_translate_color("indigo"));
-    else if (method == 7)
-	R_standard_color(D_translate_color("white"));
-    else if (method == 8)
-	R_standard_color(D_translate_color("black"));
-    else if (method == 9)
-	R_standard_color(D_translate_color("brown"));
-    else if (method == 10)
-	R_standard_color(D_translate_color("magenta"));
-    else if (method == 11)
-	R_standard_color(D_translate_color("aqua"));
-    else if (method == 12)
-	R_standard_color(D_translate_color("gray"));
-
-    return;
-
-}
-
-
-				/* SHOW MAIN MENU AND INVOKE THE SETUP
-				   ROUTINES */
-
-void set_map(char *name, char *name1, char *name2, struct Cell_head window,
-	     int top, int bot, int left, int right)
-{
-    char cmd[30], cmd1[30], cmd2[30], **sel;
-    int i, j, btn, d, class, top0, bot0, right0, left0, paint = 0, method;
-    double msc[2], dtmp;
-
-
-    /* VARIABLES
-       IN:
-       name = raster map name to be set up
-       name1 = overlay vector map name
-       name2 = overlay site map name
-     */
-
-    colors_old = (struct Colors *)G_malloc(1 * sizeof(struct Colors));
-    Rast_init_colors(colors_old);
-    Rast_read_colors(name, G_mapset(), colors_old);
-
-    G_system("clear");
-    paint_map(name, name1, name2);
-    paint = 1;
-
-    /* setup the screen to raster map 
-       coordinate conversion system */
-
-    scr_cell(&window, top, bot, left, right, msc);
-
-    top0 = top;
-    bot0 = bot;
-    left0 = left;
-    right0 = right;
-
-    /* display the menu and instructions */
-  again:
-    if (!paint) {
-	if (G_yes
-	    ("\n    Refresh the screen before choosing more setup?  ", 1))
-	    paint_map(name, name1, name2);
-    }
-    else
-	G_system("clear");
-
-    fprintf(stderr, "\n\n    CHOOSE THE SETUP OPTION:\n\n");
-    fprintf(stderr, "       Draw sampling regions                1\n");
-    fprintf(stderr, "       Setup a sampling frame               2\n");
-    fprintf(stderr, "       Setup sampling units                 3\n");
-    fprintf(stderr, "       Setup a moving window                4\n");
-    fprintf(stderr, "       Setup group or class limits          5\n");
-    fprintf(stderr, "       Change the raster map color table    6\n");
-    fprintf(stderr, "       Exit and save setup                  7\n");
-
-    do {
-	fprintf(stderr, "\n                                Which Number?   ");
-	dtmp = 5.0;
-	numtrap(1, &dtmp);
-	if ((method = fabs(dtmp)) > 7 || method < 1) {
-	    fprintf(stderr, "\n    Choice must between 1-7; try again");
-	}
-    }
-    while (method > 7 || method < 1);
-
-    /* setup regions */
-    if (method == 1)
-	set_rgn(msc, name, name1, name2);
-
-    /* setup the sampling frame */
-    else if (method == 2) {
-	top = top0;
-	bot = bot0;
-	right = right0;
-	left = left0;
-	set_frame(msc, &top, &bot, &left, &right);
-    }
-
-    /* setup sampling units */
-
-    else if (method == 3) {
-	sample(top, bot, left, right, name, name1, name2, msc);
-    }
-
-    /* setup the moving window */
-
-    else if (method == 4) {
-	mov_wind(top, bot, left, right, name, name1, name2, msc);
-    }
-
-    /* setup group/class limits */
-
-    else if (method == 5) {
-
-	/* setup the buffer to store the user's input */
-
-	sel = (char **)G_malloc(10 * sizeof(char *));
-	for (i = 0; i < 9; i++)
-	    sel[i] = (char *)G_calloc(2, sizeof(char));
-
-      back:
-	ask_group(sel);
-
-	/* check for no input */
-
-	if (sel[0][0] != 'x' && sel[1][0] != 'x' && sel[2][0] != 'x' &&
-	    sel[3][0] != 'x' && sel[4][0] != 'x' && sel[5][0] != 'x' &&
-	    sel[6][0] != 'x' && sel[7][0] != 'x' && sel[8][0] != 'x') {
-	    G_system("clear");
-	    fprintf(stderr,
-		    "    Did you mean to not make any attribute group");
-	    if (!G_yes("\n    or index class setup choices?   ", 1))
-		goto back;
-	}
-
-	/* if there is input, then invoke the
-	   group/class setup module and then free
-	   the memory allocated for selections */
-
-	else {
-	    get_group_drv(sel);
-	    for (i = 0; i < 9; i++)
-		G_free(sel[i]);
-	    G_free(sel);
-	}
-    }
-
-    /* change color tables */
-
-    else if (method == 6)
-	change_color(name, name1, name2);
-
-    /* reset the colortable and exit */
-
-    else if (method == 7) {
-	Rast_write_colors(name, G_mapset(), colors_old);
-	Rast_free_colors(colors_old);
-	/*     R_close_driver(); */
-	G_system("d.frame -e");
-	exit(0);
-    }
-    paint = 0;
-    goto again;
-    return;
-}
-
-
-
-
-				/* REDISPLAY THE RASTER MAP AND THE
-				   OVERLAYS */
-
-void paint_map(char *n1, char *n2, char *n3)
-{
-    char *cmd;
-
-    cmd = G_malloc(120);
-
-    G_system("clear");
-    sprintf(cmd, "d.rast %s", n1);
-    G_system("d.erase");
-    G_system(cmd);
-    if (n2) {
-	sprintf(cmd, "d.vect %s color=black", n2);
-	G_system(cmd);
-    }
-    if (n3) {
-	sprintf(cmd, "d.vect %s color=black", n3);
-	G_system(cmd);
-    }
-    G_free(cmd);
-    return;
-}
-
-
-
-
-
-
-				/* SETUP REGIONS */
-
-static void set_rgn(double *msc, char *name, char *name1, char *name2)
-{
-    char reg_name[20];
-    int x0, y0, xp, yp, *x, *y, xstart, ystart, btn, d, method, meth;
-    static int pts, rgn_cnt = 0;
-    double dtmp, etmp;
-    FILE *tmp;
-    char *tempfile;
-
-    /* get the name of the regions map */
-
-    if (!G_ask_cell_new("    ENTER THE NEW REGION MAP NAME:", reg_name))
-	return;
-
-    /* allocate memory for storing the
-       points along the boundary of each
-       region */
-
-    x = (int *)G_malloc(100 * sizeof(int));
-    y = (int *)G_malloc(100 * sizeof(int));
-
-    tempfile = G_tempfile();
-    tmp = fopen(tempfile, "w");
-
-  back2:
-    G_system("clear");
-    fprintf(stderr, "\n\n    CHOOSE AN OPTION:\n\n");
-    fprintf(stderr, "       Draw a region                     1\n");
-    fprintf(stderr, "       Quit drawing regions and return");
-    fprintf(stderr, "\n          to setup options menu          2\n");
-    fprintf(stderr, "       Change the color for drawing      3\n\n");
-
-    do {
-	fprintf(stderr, "                             Which Number?   ");
-	numtrap(1, &etmp);
-	if ((meth = fabs(etmp)) > 3 || meth < 1) {
-	    fprintf(stderr, "\n    Choice must between 1-3; try again");
-	}
-    }
-    while (meth > 3 || meth < 1);
-
-    if (meth == 2)
-	return;
-    if (meth == 3) {
-	R_open_driver();
-	change_draw();
-    }
-    if (meth == 1) {
-	R_open_driver();
-	rgn_cnt = 0;
-    }
-
-    /* ask the user to outline a region */
-
-  back:
-    G_system("clear");
-    ppoint(NULL, 0, 0, -1);
-    fprintf(stderr, "\n    PLEASE OUTLINE REGION # %d\n", (++rgn_cnt));
-    pbutton(0);
-    pts = 0;
-    x0 = 0;
-    y0 = 0;
-
-    /* get the points along the boundary
-       of the region as they are drawn */
-
-    do {
-	btn = 0;
-	R_get_location_with_line(x0, y0, &xp, &yp, &btn);
-	if (btn == 1)
-	    ppoint(msc, xp, yp, 0);
-	else if (btn == 2) {
-	    if (!pts) {
-		pbutton(1);
-		R_move_abs(xp, yp);
-		xstart = xp;
-		ystart = yp;
-	    }
-	    x[pts] = xp * msc[0];
-	    y[pts] = yp * msc[1];
-	    ppoint(msc, xp, yp, (++pts));
-	    x0 = xp;
-	    y0 = yp;
-	    R_cont_abs(x0, y0);
-	}
-	else if (btn == 3 && pts < 3) {
-	    fprintf(stderr,
-		    "\n\n    Please digitize more than 2 boundary points\n\n");
-	}
-    }
-    while (btn != 3 || pts < 3);
-
-    R_cont_abs(xstart, ystart);
-    R_close_driver();
-    R_open_driver();
-    x[pts] = x[0];
-    y[pts] = y[0];
-    pts++;
-
-    /* redisplay the menu and find out what
-       to do next */
-  back1:
-    G_system("clear");
-    fprintf(stderr, "\n\n    CHOOSE AN OPTION:\n\n");
-    fprintf(stderr,
-	    "       Draw another region                          1\n");
-    fprintf(stderr,
-	    "       Start over drawing regions                   2\n");
-    fprintf(stderr,
-	    "       Quit drawing and save the region map         3\n");
-    fprintf(stderr,
-	    "       Quit drawing and don't save the region map   4\n");
-    fprintf(stderr,
-	    "       Change the color for drawing                 5\n\n");
-    do {
-	fprintf(stderr,
-		"                                        Which Number?  ");
-	numtrap(1, &dtmp);
-	if ((method = fabs(dtmp)) > 5 || method < 1) {
-	    fprintf(stderr, "\n    Choice must between 1-5; try again");
-	}
-    }
-    while (method > 5 || method < 1);
-
-
-    /* save the region and draw another */
-
-    if (method == 1) {
-	save_rgn(reg_name, tempfile, tmp, x, y, pts, rgn_cnt, 1);
-	goto back;
-    }
-
-    /* start over */
-
-    else if (method == 2) {
-	fclose(tmp);
-	if (!(tmp = fopen(tempfile, "w")))
-	    G_fatal_error
-		("Can't open temporary file for storing region info\n");
-	rgn_cnt = 0;
-	R_close_driver();
-	paint_map(name, name1, name2);
-	goto back2;
-    }
-
-    /* save the region and exit */
-
-    else if (method == 3)
-	save_rgn(reg_name, tempfile, tmp, x, y, pts, rgn_cnt, 2);
-
-
-    /* change the color for drawing */
-
-    else if (method == 5) {
-	change_draw();
-	goto back1;
-    }
-
-    R_close_driver();
-    G_free(x);
-    G_free(y);
-    unlink(tempfile);
-    return;
-
-}
-
-
-
-
-				/* SETUP THE SAMPLING FRAME */
-
-static void set_frame(double *msc, int *t, int *b, int *l, int *r)
-{
-    int t0, b0, l0, r0, btn;
-
-    /* record the initial boundaries of the map */
-
-    t0 = *t;
-    b0 = *b;
-    l0 = *l;
-    r0 = *r;
-
-    /* if the total area to be sampled will be the
-       whole map */
-
-    G_system("clear");
-
-    if (G_yes
-	("\n    Will the sampling frame (total area within which sampling\n      units are distributed) be the whole map?   ",
-	 1)) {
-	R_open_driver();
-	R_standard_color(D_translate_color("grey"));
-	draw_box(*l, *t, *r, *b, 1);
-	R_close_driver();
-	fprintf(stderr, "\n    Sampling frame set to whole map");
-    }
-
-    /* if the total area to be sampled is not the
-       whole map, then have the user draw the
-       area */
-
-    else {
-      back:
-	G_system("clear");
-	fprintf(stderr, " \n    OUTLINE SAMPLING FRAME:\n");
-	R_open_driver();
-	fprintf(stderr,
-		"\n    Please move cursor to the UPPER-LEFT corner of\n");
-	fprintf(stderr,
-		"       the sampling frame and click any mouse button\n");
-	R_get_location_with_line(0, 0, l, t, &btn);
-
-	fprintf(stderr,
-		"\n    Please move cursor to the LOWER-RIGHT corner of\n");
-	fprintf(stderr,
-		"       the sampling frame and click any mouse button again\n");
-      back2:
-	R_get_location_with_box(*l, *t, r, b, &btn);
-
-	/* check that sampling frame is in map */
-
-	if (*l < l0 || *r > r0 || *t < t0 || *b > b0) {
-	    fprintf(stderr,
-		    "\n    The cursor is outside of the map, try again\n");
-	    goto back;
-	}
-
-	/* check that cursor is below & to right */
-
-	if (*r <= *l || *b <= *t) {
-	    fprintf(stderr,
-		    "\n    Please put the lower right corner below and to the");
-	    fprintf(stderr, "\n    right of the upper left corner\n");
-	    goto back2;
-	}
-
-	R_standard_color(D_translate_color("grey"));
-	*l = (int)((double)((int)(*l * msc[0] + 0.5)) / msc[0]);
-	*r = (int)((double)((int)(*r * msc[0] + 0.5)) / msc[0]);
-	*t = (int)((double)((int)(*t * msc[1] + 0.5)) / msc[1]);
-	*b = (int)((double)((int)(*b * msc[1] + 0.5)) / msc[1]);
-	draw_box(*l, *t, *r, *b, 1);
-	R_close_driver();
-	fprintf(stderr,
-		"\n    Sampling frame is set to the area you just drew");
-    }
-    return;
-}
-
-
-
-
-
-				/* SHOW THE CURSOR COORDINATES TO
-				   THE USER */
-
-static void ppoint(double *m, int x, int y, int num)
-{
-    register int i;
-
-    if (num < 0) {
-	for (i = 0; i < 80; i++)
-	    fprintf(stderr, " ");
-    }
-
-    else {
-	if (num > 0) {
-	    fprintf(stderr, "    Point %d is at Row %5d and Col %5d",
-		    num, (int)(y * m[1]), (int)(x * m[0]));
-	}
-	else if (num == 0) {
-	    fprintf(stderr, "    Point is at Row %5d and Col %5d",
-		    (int)(y * m[1]), (int)(x * m[0]));
-	}
-
-	for (i = 0; i < 80; i++) {
-	    fprintf(stderr, "\b");
-	}
-    }
-    return;
-}
-
-
-
-
-				/* PRINT THE INSTRUCTIONS FOR USING THE
-				   MOUSE BUTTONS */
-
-static void pbutton(int opt)
-{
-    static char *str[2] = { "start", "next" };
-    fprintf(stderr, "\n    Use the mouse to outline the region\n");
-    fprintf(stderr,
-	    "       Left button:     What are row & column coordinates at this point?\n");
-    fprintf(stderr, "       Middle button:   Mark %s point\n", str[opt]);
-    fprintf(stderr,
-	    "       Right  button:   Finish region-connect to first point\n\n");
-    return;
-}
-
-
-
-
-
-/* SAVE THE REGION */
-static void save_rgn(char *name, char *tempfile, FILE * tmp, int *x, int *y,
-		     int pts, int class, int opt)
-{
-    char *cmd;
-    struct Cell_head wind;
-    struct Colors colors;
-    static double rx, ry, ofy, ofx;
-    register int i;
-
-    /* setup the temporary file to save
-       the region boundary pts */
-
-    if (class == 1) {
-	G_get_set_window(&wind);
-	print_hd(tmp, &wind);
-	ofy = wind.north;
-	ofx = wind.west;
-	ry = (wind.north - wind.south) / wind.rows;
-	rx = (wind.east - wind.west) / wind.cols;
-    }
-    fprintf(tmp, "A %10.2f %10.2f %10d\n", (ofy - *y * ry), (*x * rx + ofx),
-	    class);
-    for (i = 0; i < pts; i++)
-	fprintf(tmp, "  %10.2f %10.2f\n", (ofy - *(y + i) * ry),
-		(*(x + i) * rx + ofx));
-
-    /* if the choice was made to draw more
-       regions, then return */
-
-    if (opt != 2)
-	return;
-
-    fprintf(tmp, "E\n");
-    fclose(tmp);
-    G_get_set_window(&wind);
-    Rast_put_cellhd(name, &wind);
-
-    /* make a GRASS raster map from the
-       region boundary pts, using the
-       poly_to_bmif and bmif_to_cell
-       programs */
-
-    cmd = G_malloc(200);
-    sprintf(cmd,
-	    "%s/etc/poly_to_bmif < %s | sort -t: +0n -1 | %s/etc/bmif_to_cell %s",
-	    G_gisbase(), tempfile, G_gisbase(), name);
-    fprintf(stderr, "    Generating '%s' file... %20c\n\n", name, ' ');
-    G_system(cmd);
-    G_free(cmd);
-
-    /* set the color table for the regions
-       file to color wave */
-
-    Rast_init_colors(&colors);
-    Rast_make_wave_colors(&colors, 1, class);
-    Rast_write_colors(name, G_mapset(), &colors);
-
-    /* overlay the region file on the
-       screen */
-
-    if (!(cmd = G_malloc(20)))
-	G_fatal_error("Can't allocate enough memory\n");
-    R_close_driver();
-    sprintf(cmd, "d.rast -o  %s", name);
-    G_system(cmd);
-    G_free(cmd);
-    G_sleep(4);			/* hold the screen for 4 seconds */
-    R_open_driver();
-    return;
-}
-
-
-
-
-
-
-				/* SETUP THE HEADER FOR THE REGION
-				   FILE */
-
-static void print_hd(FILE * mapfile, struct Cell_head *universe)
-{
-    fprintf(mapfile, "TITLE:\n");
-    fprintf(mapfile, "	User created region.\n");
-    fprintf(mapfile, "ENDT\n");
-    fprintf(mapfile, "SIZE      %10d %10d\n", universe->rows, universe->cols);
-    fprintf(mapfile, "BOUND     %10.2f %10.2f %10.2f %10.2f\n",
-	    universe->ns_res, universe->ew_res,
-	    universe->south, universe->west);
-    fprintf(mapfile, "VERTI\n");
-    return;
-}
-
-
-
-
-
-				/* SETUP THE CONVERSION BETWEEN SCREEN
-				   AND RASTER COORDINATES */
-
-static void scr_cell(struct Cell_head *wind, int top, int bot, int left,
-		     int right, double *m)
-{
-    m[0] = (double)wind->cols / (right - left);
-    m[1] = (double)wind->rows / (bot - top);
-    return;
-}
-
-
-
-
-
-				/* CHANGE THE COLORTABLE OF THE RASTER
-				   MAP */
-
-static void change_color(char *name, char *name1, char *name2)
-{
-    struct Colors colors;
-    struct Range range;
-    int d, min, max;
-    double etmp;
-
-
-    Rast_read_range(name, G_mapset(), &range);
-    Rast_get_range_min_max(&range, &min, &max);
-    G_system("clear");
-
-  again:
-    fprintf(stderr, "\n\n    SELECT NEW COLOR TABLE FOR RASTER MAP:\n\n");
-    fprintf(stderr, "       Aspect                           1\n");
-    fprintf(stderr, "       Color ramp                       2\n");
-    fprintf(stderr, "       Color wave                       3\n");
-    fprintf(stderr, "       Linear grey scale                4\n");
-    fprintf(stderr, "       Rainbow colors                   5\n");
-    fprintf(stderr, "       Random colors                    6\n");
-    fprintf(stderr, "       Red-Yellow-Green Sequence        7\n");
-    fprintf(stderr, "       Green-Yellow-Red Sequence        8\n");
-    fprintf(stderr, "       Set original color table         9\n");
-    fprintf(stderr, "       Return to setup options menu    10\n");
-
-    do {
-	fprintf(stderr, "\n                             Which Number?  ");
-	numtrap(1, &etmp);
-	if ((d = fabs(etmp)) > 10 || d < 1) {
-	    fprintf(stderr, "\n    Choice must between 1-10; try again");
-	}
-    }
-    while (d > 10 || d < 1);
-
-    if (d == 1) {
-	Rast_make_aspect_colors(&colors, min, max);
-	Rast_write_colors(name, G_mapset(), &colors);
-    }
-    else if (d == 2) {
-	Rast_make_ramp_colors(&colors, min, max);
-	Rast_write_colors(name, G_mapset(), &colors);
-    }
-    else if (d == 3) {
-	Rast_make_wave_colors(&colors, min, max);
-	Rast_write_colors(name, G_mapset(), &colors);
-    }
-    else if (d == 4) {
-	Rast_make_grey_scale_colors(&colors, min, max);
-	Rast_write_colors(name, G_mapset(), &colors);
-    }
-    else if (d == 5) {
-	Rast_make_rainbow_colors(&colors, min, max);
-	Rast_write_colors(name, G_mapset(), &colors);
-    }
-    else if (d == 6) {
-	Rast_make_random_colors(&colors, min, max);
-	Rast_write_colors(name, G_mapset(), &colors);
-    }
-    else if (d == 7) {
-	Rast_make_ryg_colors(&colors, min, max);
-	Rast_write_colors(name, G_mapset(), &colors);
-    }
-    else if (d == 8) {
-	Rast_make_gyr_colors(&colors, min, max);
-	Rast_write_colors(name, G_mapset(), &colors);
-    }
-    else if (d == 9) {
-	Rast_write_colors(name, G_mapset(), colors_old);
-    }
-    else if (d == 10) {
-	return;
-    }
-
-    paint_map(name, name1, name2);
-
-    fprintf(stderr, "\n    CHOOSE NEXT OPTION:\n\n");
-    fprintf(stderr, "       Don't save color table just chosen:");
-    fprintf(stderr, "\n         Return to color table menu            1\n");
-    fprintf(stderr, "         Return to setup option menu           2\n");
-    fprintf(stderr, "         Exit r.le.setup                       3\n\n");
-    fprintf(stderr, "       Do save color table just chosen:");
-    fprintf(stderr, "\n         Return to setup options menu          4\n");
-    fprintf(stderr, "         Exit r.le.setup                       5\n");
-
-    do {
-	fprintf(stderr,
-		"\n                                   Which Number?  ");
-	numtrap(1, &etmp);
-	if ((d = fabs(etmp)) > 5 || d < 1) {
-	    fprintf(stderr, "\n    Choice must between 1-5; try again");
-	}
-    }
-    while (d > 5 || d < 1);
-
-    if (d == 1)
-	goto again;
-    else if (d == 2)
-	return;
-    else if (d == 3) {
-	Rast_write_colors(name, G_mapset(), colors_old);
-	Rast_free_colors(colors_old);
-    }
-    else if (d == 4)
-	*colors_old = colors;
-    if (d == 3 || d == 5) {
-	G_system("d.frame -e");
-	exit(0);
-    }
-    return;
-}

+ 0 - 67
raster/r.le/r.le.setup/setup.h

@@ -1,67 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.setup/setup.h                               *
- *         Version 5.0beta            Oct. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To set up sampling areas, which can can then    *
- *         be used to obtain data using the r.le.dist,      *
- *         r.le.patch, and r.le.pixel programs.  The        *
- *         setup.h code contains structure definitions      *
- *         and lists of modules in r.le.setup               *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include "stdio.h"
-#include "math.h"
-#include "signal.h"
-#include "setjmp.h"
-#include "ctype.h"
-#include "stdlib.h"
-#include "string.h"
-#include <grass/gis.h>
-#include "sys/types.h"
-
-
-/* #include "dig_defines.h" */
-/* #include "dig_structs.h" */
-/* #include "dig_head.h" */
-
-
-
-#define  SML   0.5
-#define EQ(a, b)    (a-b < 0.01 && a-b > -0.01 )
-#define BIG   1000000000.0
-
-extern jmp_buf jmp;
-
-/** sample.c **/
-extern void sample(int t0, int b0, int l0, int r0, char *name, char *name1,
-		   char *name2, double *msc);
-extern void draw_box(int x0, int y0, int xp, int yp, int thick);
-extern void draw_circle(int x0, int y0, int xp, int yp, int thick);
-extern void numtrap(int n, double *a);
-
-/** mv_wind.c **/
-extern void mov_wind(int t, int b, int l, int r, char *n1, char *n2, char *n3,
-		     double *mx);
-
-/** ask_group.c **/
-extern int ask_group(char **sel);
-extern int get_group_drv(char **sel);
-extern FILE *fopen0(char *name, char *flag);
-
-/** setup.c **/
-
-extern void set_map(char *name, char *name1, char *name2,
-		    struct Cell_head window, int top, int bot, int left,
-		    int right);
-extern void paint_map(char *n1, char *n2, char *n3);

+ 0 - 10
raster/r.le/r.le.trace/Makefile

@@ -1,10 +0,0 @@
-MODULE_TOPDIR = ../../..
-
-PGM = r.le.trace
-
-LIBES = $(DISPLAYLIB) $(GISLIB)
-DEPENDENCIES = $(DISPLAYDEP) $(GISDEP)
-
-include $(MODULE_TOPDIR)/include/Make/Module.make
-
-default: cmd

+ 0 - 1
raster/r.le/r.le.trace/local_proto.h

@@ -1 +0,0 @@
-int user_input(int, char **);

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 0 - 1645
raster/r.le/r.le.trace/main.c


+ 0 - 75
raster/r.le/r.le.trace/r.le.trace.h

@@ -1,75 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.patch/r.le.trace.h                          *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To analyze attributes of patches in a landscape *
- *         r.le.trace.h lists include files, defines the    *
- *         data structures, and lists the modules for       *
- *         r.le.trace                                       *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <grass/config.h>
-#include "stdio.h"
-#include "math.h"
-#include "ctype.h"
-#include "stdlib.h"
-#include "string.h"
-#include <grass/gis.h>
-
-#define EQ(a, b)    (a-b < 0.01 && a-b > -0.01 )
-#define BIG   500000000.0
-#define MIN   5
-#define NULLPTR (PATCH *) 0
-
-typedef struct pt
-{
-    int row, col;
-    struct pt *next;
-} PT;
-
-typedef struct patch
-{
-    double att;
-    int num, n, s, e, w, npts;
-    double c_row, c_col;
-    double area, perim, long_axis;
-    double edge, core;
-    int *row;
-    int *col;
-    int twist;
-    float omega;
-    struct patch *next;
-} PATCH;
-
-struct CHOICE
-{
-    char fn[30], out[30];
-    int patchmap, trace, perim2;
-    int all;
-    int boundary[5];
-};
-
-void set_map();
-void show_patch();
-void patch_attr();
-void draw_patch();
-void scr_cell();
-void cell_clip_drv();
-void cell_clip();
-int is_not_empty_buffer();
-int center_is_not_zero();
-void trace();
-PATCH *get_bd();
-int yes_nb();
-void clockwise();

+ 0 - 43
raster/r.le/r.le.trace/r.le.trace.html

@@ -1,43 +0,0 @@
-<h2>DESCRIPTION</h2>
-
-The <em>r.le.trace</em> module can be used to display the boundary of each
-<b>r.le</b> patch and show how the boundary is traced, display the attribute,
-size, perimeter, and shape indices for each patch, and save the data in an
-output file.
-
-
-<h2>NOTES</h2>
-
-Full instructions can be found in the <b>r.le manual</b> (see "REFERENCES"
-section below) and the <em><a href="r.le.setup.html">r.le.setup</a></em>
-help page.
-
-
-<h2>REFERENCES</h2>
-
-Baker, W.L. and Y. Cai. 1992. The r.le programs for multiscale analysis of
-landscape structure using the GRASS geographical information system.
-Landscape Ecology 7(4):291-302.
-<p>
-The <a href="http://grass.osgeo.org/gdp/landscape/r_le_manual5.pdf"><i>r.le</i>
-manual: Quantitative analysis of landscape structures</a> (GRASS 5; 2001)
-
-
-<h2>SEE ALSO</h2>
-
-<em>
-<!--<a href="r.le.dist.html">r.le.dist</a>,
-<a href="r.le.null.html">r.le.null</a>, -->
-<a href="r.le.patch.html">r.le.patch</a>,
-<a href="r.le.pixel.html">r.le.pixel</a>,
-<!-- <a href="r.le.rename.html">r.le.rename</a>, -->
-<a href="r.le.setup.html">r.le.setup</a> 
-</em>
-
-<h2>AUTHOR</h2>
-
-William L. Baker Department of Geography and Recreation University of
-Wyoming Laramie, Wyoming 82071 U.S.A.
-
-<p>
-<i>Last changed: $Date$</i>

+ 0 - 75
raster/r.le/r.le.trace/user_input.c

@@ -1,75 +0,0 @@
-/*
- ************************************************************
- * MODULE: r.le.trace/user_input.c                          *
- *         Version 5.0                Nov. 1, 2001          *
- *                                                         *
- * AUTHOR: W.L. Baker, University of Wyoming                *
- *         BAKERWL@UWYO.EDU                                 *
- *                                                          *
- * PURPOSE: To obtain information from the user about what  *
- *          information is desired                          *
- *                                                         *
- * COPYRIGHT: (C) 2001 by W.L. Baker                        *
- *                                                          *
- * This program is free software under the GNU General      *
- * Public License(>=v2).  Read the file COPYING that comes  *
- * with GRASS for details                                   *
- *                                                         *
- ************************************************************/
-
-#include <grass/config.h>
-#include <grass/glocale.h>
-#include "r.le.trace.h"
-
-extern struct CHOICE *choice;
-
-void user_input(int argc, char **argv)
-{
-    struct Flag *bound;
-    struct Flag *trace;
-    struct Option *name;
-    struct Option *out;
-
-    bound = G_define_flag();
-    bound->key = 'p';
-    bound->description = _("Include sampling area boundary as perimeter");
-
-    trace = G_define_flag();
-    trace->key = 't';
-    trace->description = _("Use 4 neighbor tracing instead of 8 neighbor");
-
-    name = G_define_standard_option(G_OPT_R_MAP);
-    name->description = _("Raster map to be analyzed");
-
-    out = G_define_standard_option(G_OPT_F_OUTPUT);
-    out->description = _("Name of output file to store patch data");
-    out->required = NO;
-
-    if (G_parser(argc, argv))
-	exit(EXIT_FAILURE);
-
-
-    strcpy(choice->fn, name->answer);
-
-    if (out->answer)
-	strcpy(choice->out, out->answer);
-    else
-	strcpy(choice->out, "");
-
-    /* if the 4 neighbor tracing flag -t
-       is specified, then set the 
-       choice->trace flag to 1 */
-
-    choice->trace = 1;
-    if (trace->answer)
-	choice->trace = 0;
-
-    /* if the -p flag is specified, then
-       set the choice->perim2 flag to 0 */
-
-    if (bound->answer)
-	choice->perim2 = 0;
-    else
-	choice->perim2 = 1;
-
-}

+ 7 - 8
raster/r.li/r.li.html

@@ -1,13 +1,10 @@
 <!-- meta page description: Landscape structure analysis package overview -->
 <h2>DESCRIPTION</h2>
 
-The <em>r.li</em> suite is a toolset for multiscale analysis of landscape structure.
-<!-- rephrase reference to r.le which is long time ago ...
-It aims at replacing the <em>r.le</em> suite of modules through a client-server,
-multiprocess implementation.
--->
-It aims at implementing metrics as found in external software for quantitative
-measures of landscape structure like FRAGSTATS (McGarigal and Marks 1995).
+The <em>r.li</em> suite is a toolset for multiscale analysis of 
+landscape structure. It aims at implementing metrics as found in 
+external software for quantitative measures of landscape structure like 
+FRAGSTATS (McGarigal and Marks 1995).
 <p>
 The <em>r.li</em> suite offers a set of patch and diversity indices.
 It supports analysis of landscapes composed of a mosaic of
@@ -188,7 +185,9 @@ Gen. Tech. Rep. PNW-351
 
 Claudio Porta and Lucio Davide Spano, students of Computer Science,
 University of Pisa (Italy).<br>
-Commission from Faunalia Pontedera (PI)<br>
+Commission from Faunalia Pontedera (PI)
+<p>
+Partially rewritten by Markus Metz
 
 <p>
 <i>Last changed: $Date$</i>