1r.patch(1)                    Grass User's Manual                   r.patch(1)
2
3
4

NAME

6       r.patch  - Creates a composite raster map layer by using known category
7       values from one (or more) map layer(s) to fill in areas of "no data" in
8       another map layer.
9

KEYWORDS

11       raster
12

SYNOPSIS

14       r.patch
15       r.patch help
16       r.patch [-qz] input=string[,string,...] output=string  [--overwrite]
17
18   Flags:
19       -q  Quiet
20
21       -z  Use zero (0) for transparency instead of NULL
22
23       --overwrite
24
25   Parameters:
26       input=string[,string,...]
27           Name of raster maps to be patched together
28
29       output=string
30           Name of the resultant map
31

DESCRIPTION

33       The GRASS program r.patch allows the user to build a new raster map the
34       size and resolution of the current region by assigning known data  val‐
35       ues  from  input raster maps to the cells in this region.  This is done
36       by filling in "no data" cells, those that do not yet contain data, con‐
37       tain  NULL  data, or, optionally contain 0 data, with the data from the
38       first input map.  Once this is done the remaining holes are  filled  in
39       by  the next input map, and so on.  This program is useful for making a
40       composite raster map layer from two or more adjacent  map  layers,  for
41       filling  in "holes" in a raster map layer's data (e.g., in digital ele‐
42       vation data), or for updating an older map layer with more recent data.
43       The   current  geographic  region  definition  and  mask  settings  are
44       respected.
45
46       The first name listed in the string input=name,name,name,  ...  is  the
47       name  of  the  first  map whose data values will be used to fill in "no
48       data" cells in the current region. The second through 200  (max)  input
49       name  maps  will  be  used, in order, to supply data values for for the
50       remaining "no data" cells.
51

EXAMPLE

53       Below, the raster map layer on the far left is patched with the  middle
54       (patching)  raster map layer, to produce the composite raster map layer
55       on the right.
56         1 1 1 0 2 2 0 0    0 0 1 1 0 0 0 0    1 1 1 1 2 2 0 0
57         1 1 0 2 2 2 0 0    0 0 1 1 0 0 0 0    1 1 1 2 2 2 0 0
58         3 3 3 3 2 2 0 0    0 0 0 0 0 0 0 0    3 3 3 3 2 2 0 0
59         3 3 3 3 0 0 0 0    4 4 4 4 4 4 4 4    3 3 3 3 4 4 4 4
60         3 3 3 0 0 0 0 0    4 4 4 4 4 4 4 4    3 3 3 4 4 4 4 4
61         0 0 0 0 0 0 0 0    4 4 4 4 4 4 4 4    4 4 4 4 4 4 4 4
62        Switching the patched and the patching raster map layers produces  the
63       following results:
64         0 0 1 1 0 0 0 0    1 1 1 0 2 2 0 0    1 1 1 1 2 2 0 0
65         0 0 1 1 0 0 0 0    1 1 0 2 2 2 0 0    1 1 1 1 2 2 0 0
66         0 0 0 0 0 0 0 0    3 3 3 3 2 2 0 0    3 3 3 3 2 2 0 0
67         4 4 4 4 4 4 4 4    3 3 3 3 0 0 0 0    4 4 4 4 4 4 4 4
68         4 4 4 4 4 4 4 4    3 3 3 0 0 0 0 0    4 4 4 4 4 4 4 4
69         4 4 4 4 4 4 4 4    0 0 0 0 0 0 0 0    4 4 4 4 4 4 4 4
70
71

NOTES

73       Frequently,  this program is used to patch together adjacent map layers
74       which have been digitized separately.  The program v.mkgrid can be used
75       to make adjacent maps align neatly.
76
77       The  user  should  check  the current geographic region settings before
78       running r.patch, to ensure that the region boundaries encompass all  of
79       the data desired to be included in the composite map and to ensure that
80       the region resolution is the resolution of the desired data. To set the
81       geographic  region settings to one or several raster maps, the g.region
82       program can be used:
83       g.region rast=map1[,map2[,...]]
84
85
86       Use of r.patch is generally followed  by  use  of  the  GRASS  programs
87       g.remove  and  g.rename;  g.remove  is used to remove the original (un-
88       patched) raster map layers, while g.rename is used to  then  assign  to
89       the  newly-created composite (patched) raster map layer the name of the
90       original raster map layer.
91
92       r.patch creates support files for the patched, composite output map.
93

EXAMPLE

95       Create a list of maps matching a pattern, extend the region to  include
96       them  all, and patch them together to create a mosaic. Overlapping maps
97       will be used in the order listed.
98       MAPS=`g.mlist type=rast sep=, pat="map_*"`
99       g.region rast=$MAPS
100       r.patch in=$MAPS out=mosaic
101
102

SEE ALSO

104       g.region, g.remove, g.rename, r.mapcalc, r.support, v.mkgrid
105

AUTHOR

107       Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
108       -z flag by Huidae Cho
109
110       Last changed: $Date: 2006/05/15 02:02:12 $
111
112       Full index
113
114
115
116GRASS 6.2.2                                                         r.patch(1)
Impressum