r.le.setup.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473
  1. <h2>DESCRIPTION</h2>
  2. <em>r.le.setup</em> program is used to set
  3. up the sampling and analysis framework that will be used by the other
  4. <em>r.le</em> programs.
  5. <h2>NOTES</h2>
  6. <i>Full instructions can be found in the <b>r.le manual</b> (see "REFERENCES"
  7. section below).</i>
  8. <p>
  9. The first menu allows the user to define a rectangular sampling frame,
  10. select how sampling will be done (regions, sampling units, moving window),
  11. setup the limits for groups and classes, and change the color table.
  12. Use the left mouse button to make your choice.
  13. <p>
  14. Information about the structure of the landscape is obtained by overlaying
  15. a set of sampling areas on top of a specified part (the sampling frame of
  16. a map layer, and then calculating specific structural measures for the part
  17. of the map layer that corresponds to the area in each sampling area.
  18. <p>
  19. To setup a <em><b>sampling frame</b></em> click on SAMPLING FRAME in the
  20. main menu. The program will ask "Will the sampling frame (total area
  21. within which sampling units are distributed) be the whole map? (y/n) [y]"
  22. Just hit a carriage return to accept the default, which is to use the
  23. whole map. You do not need to setup a sampling frame if you want to use
  24. the whole map, as this is the default. To setup a different sampling
  25. frame type "n" in response to this question. Then use the mouse and a
  26. rubber band box to outline a rectangular sampling frame on screen.
  27. This box will be moved to the nearest row and column of the map.
  28. You will be asked last whether you want to "Refresh the screen before
  29. choosing more setup?" If you don't like the sampling frame you just setup,
  30. answer yes to this question, then click on SAMPLING FRAME again to redo
  31. this part of the setup. This sampling frame will be used in all subsequent
  32. setup procedures unless you change it. You can change it at any time by
  33. simply clicking on SAMPLING FRAME again.
  34. <p>
  35. A <em><b>sampling area</b></em> may be one of four things. First, it is
  36. possible to treat the entire map layer as the one (and only) sampling area.
  37. Second, if the map layer can be divided into meaningful geographical regions,
  38. then it is possible to treat the regions themselves as sampling areas.
  39. The third option is that the sampling areas may be sampling units of
  40. fixed shape and size (also called scale) that are placed within the map
  41. layer as a whole. The fourth and final option is that the sampling area
  42. may be moved systematically across the map as a moving window.
  43. <p>
  44. If regions are to be used as the sampling areas , then the user can use
  45. <em>r.le.setup</em> to draw regions or any existing map of regions can
  46. simply be used directly. To draw regions and create a new regions map
  47. in <em>r.le.setup</em> select "REGIONS" from the first <em>r.le.setup</em>
  48. menu, and the user is asked to do the following:
  49. <dl>
  50. <pre>
  51. 1. "ENTER THE NEW REGION MAP NAME:". Only a new raster map name is
  52. acceptable. The user can type LIST to find out the existing raster map
  53. names in this location and mapset.
  54. 2. "PLEASE OUTLINE REGION # 1". The user should move the mouse cursor
  55. into the graphic monitor window and use the mouse buttons as instructed:
  56. Left button: where am I.to display the current coordinates of the cursor.
  57. Middle button: Mark start (next) point. to enter a vertex of the region
  58. boundary.
  59. Right button: Finish region-connect to 1st point to close the region
  60. boundary by setting the last vertex to be equal to the first one.
  61. 3. A "REGION OPTIONS:" menu is displayed and the user should use the mouse
  62. to select one of
  63. the options:<br>
  64. "DRAW MORE": repeat the above process and setup another region.
  65. "START OVER": abandon the previous setup and start all over again.
  66. "DONE-SAVE": save the regions outlined so far and exit this procedure.
  67. "QUIT-NO SAVE": quit the procedure without saving the regions.
  68. </pre>
  69. </dl>
  70. Once the "DONE-SAVE" option is selected, the new raster map of the sampling
  71. regions is generated. It is displayed on the monitor window for several
  72. seconds, the monitor window is refreshed, the main menu is displayed again,
  73. and the program is ready for other setup work. Note that you cannot draw
  74. regions in areas outside the mask, if a mask is present (see <em>r.mask</em>
  75. command).
  76. <p>
  77. The user can also use the GRASS <em>r.digit</em> or <em><a href="wxGUI.Vector_Digitizer.html">wxGUI vector digitizer</a></em>
  78. programs to digitize circular or polygonal regions and to create a
  79. sampling regions map without using <em>r.le.setup</em>. Or, as mention
  80. above, an existing raster map can be used as a regions map.
  81. <p>
  82. If sampling units are to be used as the sampling areas (Fig. 2), then
  83. choose "SAMPLING UNITS" from the first <em>r.le.setup</em> menu.
  84. The program checks the <em>r.le.para</em> subdirectory for an existing
  85. "units" file from a previous setup session and allows the user to rename
  86. this file (to save it) before proceeding. The r.le.setup program will
  87. otherwise overwrite the "units" file. Then the following choice is
  88. displayed followed by a series of other choices:
  89. <dl>
  90. <dd>
  91. <pre>
  92. Which do you want to do?
  93. (1) Use the keyboard to enter sampling unit parameters
  94. (2) Draw the sampling units with the mouse
  95. Enter 1 or 2:
  96. </pre>
  97. </dl>
  98. When sampling units are defined using the keyboard, the user inputs the
  99. shape and size (scale) of the sampling units by specifying dimensions
  100. in pixels using the keyboard. When sampling units are drawn with the
  101. mouse, the user clicks the mouse to define the sampling units in the
  102. GRASS monitor window, and then actually places the sampling units for
  103. each scale onto the map. By placing the units with the mouse the user
  104. can directly determine the method of sampling unit distribution as well
  105. as the shape, size, and number of sampling units.
  106. <p>
  107. If the choice is made to define sampling units using the keyboard, the
  108. following series of questions must be answered:
  109. <dl>
  110. <dd>
  111. <pre>
  112. How many different SCALES do you want (1-15)?
  113. </pre>
  114. </dl>
  115. The user is asked to specify the number of scales that will be used.
  116. The <em>r.le</em> programs allow the user to simultaneously sample the
  117. same map with the same measures using sampling areas of different sizes.
  118. Currently there can be between 1 and 15 scales that can be sampled
  119. simultaneously. Substantial output can be produced if many scales are used.
  120. <p>
  121. Sampling units must be placed spatially into the landscape. There are
  122. five options for doing this :
  123. <p>
  124. <em>Random nonoverlapping</em><br>
  125. Sampling units are placed in the landscape by randomly choosing numbers
  126. that specify the location of the upper left corner of each sampling unit,
  127. subject to the constraint that successive sampling units not overlap other
  128. sampling units or the edge of the landscape, and that they must be entirely
  129. within the area defined by the mask (see <em>r.mask</em> command) if one
  130. exists.
  131. <p>
  132. <em>Systematic contiguous</em><br>
  133. Sampling units are placed side by side across the rows. The user will
  134. be able to enter a row and column to indicate where the upper left corner
  135. of the systematic contiguous framework should be placed. Rows are numbered
  136. from the top down beginning with row 1 of the sampling frame. Columns are
  137. numbered from left to right, beginning with column 1 of the sampling frame.
  138. A random starting location can be obtained by using a standard random
  139. number table to choose the starting row and column. The <em>r.le.setup</em>
  140. program does not avoid placing the set of sampling units over areas
  141. outside the mask. The user will have to make sure that sampling units do
  142. not extend outside the mask by choosing a particular starting row and
  143. column or by drawing a sampling frame before placing the set of sampling
  144. units.
  145. <p>
  146. <em>Systematic noncontiguous</em><br>
  147. The user must specify the starting row and column as in #2 above and the
  148. amount of spacing (in pixels) between sampling units. Horizontal and
  149. vertical spacing are identical. Sampling units are again placed side by
  150. side (but spaced) across the rows. As in #2 the program does not avoid
  151. placing sampling units outside the masked area; the user will have to
  152. position the set of units to avoid areas outside the mask.
  153. <p>
  154. <em>Stratified random</em><br>
  155. The strata are rectangular areas within which single sampling units
  156. are randomly located. The user must first specify the starting row
  157. and column as in #2 above. Then the user must specify the number of
  158. strata in the horizontal and vertical directions. As in #2 the program
  159. does not avoid placing sampling units outside the masked area; the user
  160. will have to position the set of units to avoid areas outside the mask.
  161. <p>
  162. <em>Centered over sites</em><br>
  163. The user must specify the name of a sitefile containing point locations.
  164. A single sampling unit is placed with its center over each site in the site
  165. file. This is a useful approach for determining the landscape structure
  166. around points, such as around the location of wildlife observations.
  167. <p>
  168. The user is prompted to enter a ratio that defines the shape of the
  169. sampling units. Sampling units may have any rectangular shape,
  170. including square as a special case of rectangular. Rectangular shapes
  171. are specified by entering the ratio of columns/rows (horizontal
  172. dimension/vertical dimension) as a real number. For example, to obtain
  173. a sampling unit 10 columns wide by 4 rows long specify the ratio as 2.5
  174. (10/4).
  175. <dl>
  176. <dd>
  177. <pre>
  178. Recommended maximum SIZE is m in x cell total area. <br>
  179. What size (in cells) for each sampling unit of scale n?
  180. </pre>
  181. </dl>
  182. The user is then given the recommended maximum possible size for a
  183. sampling unit (in pixels) and asked to input the size of sampling units
  184. at each scale. Sampling units can be of any size, but the maximum size
  185. is the size of the landscape as a whole. All the sampling units, that
  186. make up a single sampling scale, are the same size. After specifying
  187. the size, the program determines the nearest actual number of rows and
  188. columns, and hence size, that is closest to the requested size, given
  189. the shape requested earlier.
  190. <dl>
  191. <dd>
  192. <pre>
  193. The nearest size is x cells wide X y cells high = xy cells
  194. Is this size OK? (y/n) [y]
  195. Maximum NUMBER of units in scale n is p?
  196. What NUMBER of sampling units do you want to try to use?
  197. </pre>
  198. </dl>
  199. The maximum number of units that can be placed over the map, given the
  200. shape and size of the units, is then given. The user can then choose
  201. the number of sampling units to be used in the map layer. It may not
  202. always be possible to choose the maximum number, depending upon the
  203. shape of the sampling units. In the case of systematic contiguous and
  204. noncontiguous, the program will indicate how many units will fit across
  205. the columns and down the rows. The user can then specify a particular
  206. layout (e.g., 6 units could be placed as 2 rows of 3 per row or as 3
  207. rows of 2 per row).
  208. <dl>
  209. <dd>
  210. <pre>
  211. Is this set of sampling units OK? (y/n) [y]
  212. </pre>
  213. </dl>
  214. Finally, the set of sampling units is displayed on the screen (e.g., Fig. 1)
  215. and the user is asked whether it is acceptable. If the answer is no, then
  216. the user is asked if the screen should be refreshed before redisplaying
  217. the menu for "Methods of sampling unit distribution" so that the user can
  218. try the sampling unit setup again.
  219. <p>
  220. The choice is made to define sampling units using the mouse, then the
  221. following menu for use with the mouse is displayed:
  222. <dl>
  223. <dd>
  224. <pre>
  225. Outline the standard sampling unit of scale n.
  226. Left button: Check unit size
  227. Middle button: Move cursor
  228. Right button: Lower right corner of unit here
  229. </pre>
  230. </dl>
  231. The user can then use the mouse and the rubber band box to outline the
  232. standard sampling unit. Once it has been outlined, the number of columns
  233. and rows in the unit, the ratio of width/length and the size of the unit,
  234. in cells, will be displayed. After this first unit is outlined, then a
  235. new menu is displayed:
  236. <dl>
  237. <dd>
  238. <pre>
  239. Outline more sampling units of scale n?
  240. Left button: Exit
  241. Middle button: Check unit position
  242. Right button: Lower right corner of next unit here
  243. </pre>
  244. </dl>
  245. The user can then place more units identical to the standard unit by
  246. simply clicking the right mouse button where the lower right corner of
  247. the unit should be placed. The rest of the rubber band box can be
  248. ignored while placing additional units. The program is set up so that
  249. units cannot be placed so they overlap one another, so they overlap the
  250. area outside the mask, or so they overlap the edge of the sampling frame.
  251. Warning messages are issued for all three of these errors and a sampling
  252. unit is simply not placed.
  253. <p>
  254. Using this procedure a rectangular "window" or single sampling area is
  255. moved systematically across the map to produce a new map (Fig. 2,3).
  256. This sampling procedure can only be used with the measures that produce
  257. a single value or with a single class or group when measures produce
  258. distributions of values (Table 1). The first class or group specified
  259. when defining class or group limits (section 2.3.2.) is used if
  260. distributional measures are chosen with the moving window sampling
  261. method. In this case, the user should manually edit the
  262. <em>r.le.para/recl_tb</em> file so that the desired group is listed as
  263. the first group in this file.
  264. <p>
  265. Sampling begins with the upper left corner of the window placed over
  266. the upper left corner of the sampling frame. It is strongly recommended
  267. that the user read the section on the GRASS mask (section 2.2.2) prior
  268. to setting up the moving window, as this mask can be used to speed up
  269. the moving window operation. The value of the chosen measure is
  270. calculated for the window area. This value is assigned to the location
  271. on the new map layer corresponding to the center pixel in the window if
  272. the window has odd (e.g. 3 X 3) dimensions. The value is assigned to
  273. the location on the new map layer corresponding to the first pixel below
  274. and to the right of the center if the window has even dimensions
  275. (e.g. 6 X 10). If this pixel has the value "0," which means "no data" in
  276. GRASS, then this pixel is skipped and a value of "0" is assigned to the
  277. corresponding location in the new map. The window is then moved to the
  278. right (across the row) by one pixel, and the process is repeated.
  279. At the end of the row, the window is moved down one pixel, and then back
  280. across the row. This option produces a new map layer, whose dimensions
  281. are smaller by approximately (m-1)/2 rows and columns, where m is the
  282. number of rows or columns in the window.
  283. <p>
  284. If the "MOVE-WINDOW" option in the main menu is selected, first the
  285. program checks for an existing "move_wind" file, in the r.le.para
  286. subdirectory, containing moving window specifications from a previous
  287. session. The user is given the option to avoid overwriting this file
  288. by entering a new file name for the old "move_wind" file. Users should
  289. be aware that moving window analyses are very slow, because a large
  290. number of sampling units are, in effect, used. See the appendix on
  291. "Time needed to complete analyses with the r.le programs" for some
  292. ideas about how moving window size and sampling frame area affect
  293. the needed time to complete the analyses.
  294. <p>
  295. The <em>r.le</em> programs <em>r.le.dist</em> and <em>r.le.patch</em>
  296. allow the attribute categories in the input map to be reclassed into
  297. several attribute groups, and reports the analysis results by each of
  298. these attribute groups. It is necessary to setup group limits for
  299. all measures that say "by gp" when typing "<em>r.le.dist help</em>"
  300. or "<em>r.le.patch help</em>" at the GRASS prompt. The same reclassing
  301. can be done with the measurement indices (e.g., size), except that each
  302. "cohort" (class) of the reclassed indices is called an index class
  303. instead of a group. It is also necessary to setup class limits for
  304. all measures that say "by class" when typing "<em>r.le.dist help</em>"
  305. or "<em>r.le.patch help</em>" at the GRASS prompt.
  306. <p>
  307. Group/class limits are setup by choosing "GROUP/CLASS LIMITS" from the
  308. main menu upon starting <em>r.le.setup</em>, or you can create the files
  309. manually using a text editor. The program checks for existing group/class
  310. limit files in subdirectory <em>r.le.para</em> and allows the user to
  311. rename these files prior to continuing. If the files are not renamed
  312. the program will overwrite them. The files are named recl_tb (attribute
  313. group limits), size (size class limits), shape_PA (shape index class
  314. limits for perimeter/area index), shape_CPA (shape index class limits
  315. for corrected perimeter/area index), shape_RCC (shape index class limits
  316. for related circumscribing circle index), and from_to (for the
  317. <em>r.le.dist</em> program distance methods m7-m9).
  318. <p>
  319. Attribute groups and index classes are defined in a different way.
  320. In the <em>r.le</em> programs attribute groups are defined as in the
  321. following example:
  322. <dl>
  323. <dd>
  324. <pre>
  325. 1, 3, 5, 7, 9 <b>thru</b> 21 = 1 (comment)
  326. 31 <b>thru</b> 50 = 2 (comment)
  327. <b>end</b>
  328. </pre>
  329. </dl>
  330. In this example, the existing categories 1, 3, 5, 7, {9, 10, ... 20, 21}
  331. are included in the new group 1, while {31, 32, 33, ..., 49, 50} are
  332. included in the new group 2. The characters in bold are the "key words"
  333. that are required in the definition. Each line is called one "reclass rule".
  334. <p>
  335. The GRASS reclass convention is adopted here with a little modification
  336. (see "<em>r.reclass</em>" command in the GRASS User's Manual).
  337. The difference is that r.le only allows one rule for each group while the
  338. GRASS <em>r.reclass</em> command allows more than one. The definition of
  339. "from" and "to" groups is simply the extension of the GRASS reclass rule.
  340. The advantage of using the GRASS reclass convention is that the user can
  341. generate a permanent reclassed map, using GRASS programs, directly from the
  342. <em>r.le</em> setup results.
  343. <p>
  344. The <em>r.le</em> measurement index classes are defined by the lower
  345. limits of the classes, as in the following example:
  346. <dl>
  347. <dd>
  348. <pre>
  349. 0.0, 10.0, 50.0, 200.0, <b>-999</b>
  350. </pre>
  351. </dl>
  352. This means:
  353. <dl>
  354. <dd>
  355. <pre>
  356. if v &gt;= 0.0 and v &lt; 10.0 then v belongs to index class 1;
  357. if v &gt;= 10.0 and v &lt; 50.0 then v belongs to index class 2;
  358. if v &gt;= 50.0 and v &lt; 200.0 then v belongs to index class 3;
  359. if v &gt;= 200.0 then v belongs to index class 4;
  360. </pre>
  361. </dl>
  362. where v is the calculated index value and <b>-999</b> marks the end of
  363. the index class definition. The measurement index can be the size index,
  364. one of the three shape indices, or one of the three distance indices.
  365. The program is currently designed to allow no more than 25 attribute
  366. groups, 25 size classes, 25 shape index classes, and 25 distance index
  367. classes. As an alternative, the user may want to permanently group
  368. certain attributes prior to entering the <em>r.le</em> programs.
  369. For example, the user may want to group attributes 1-10, in a map whose
  370. attributes are ages, into a single attribute representing young patches.
  371. The user can do this using the GRASS <em>r.reclass</em> and
  372. <em>r.resample</em> commands, which will create a new map layer that can
  373. then be analyzed directly (without setting up group limits) with the
  374. <em>r.le</em> programs.
  375. <h2>REFERENCES</h2>
  376. Baker, W.L. and Y. Cai. 1992. The r.le programs for multiscale analysis of
  377. landscape structure using the GRASS geographical information system.
  378. Landscape Ecology 7(4):291-302.
  379. <p>
  380. The <a href="http://grass.osgeo.org/gdp/landscape/r_le_manual5.pdf"><i>r.le</i>
  381. manual: Quantitative analysis of landscape structures</a> (GRASS 5; 2001)
  382. <h2>SEE ALSO</h2>
  383. <em>
  384. <!-- <a href="r.le.dist.html">r.le.dist</a>,
  385. <a href="r.le.null.html">r.le.null</a>, -->
  386. <a href="r.le.patch.html">r.le.patch</a>,
  387. <a href="r.le.pixel.html">r.le.pixel</a>,
  388. <!-- <a href="r.le.rename.html">r.le.rename</a>, -->
  389. <a href="r.le.trace.html">r.le.trace</a></em>
  390. <h2>AUTHOR</h2>
  391. William L. Baker Department of Geography and Recreation University of
  392. Wyoming Laramie, Wyoming 82071 U.S.A.
  393. <p>
  394. <i>Last changed: $Date$</i>