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       [--verbose]  [--quiet]
18
19   Flags:
20       -q
21           Quiet
22
23       -z
24           Use zero (0) for transparency instead of NULL
25
26       --overwrite
27           Allow output files to overwrite existing files
28
29       --verbose
30           Verbose module output
31
32       --quiet
33           Quiet module output
34
35   Parameters:
36       input=string[,string,...]
37           Name of raster maps to be patched together
38
39       output=string
40           Name of the resultant map
41

DESCRIPTION

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

EXAMPLE

63       Below,  the raster map layer on the far left is patched with the middle
64       (patching) raster map layer, to produce the composite raster map  layer
65       on the right.
66         1 1 1 0 2 2 0 0    0 0 1 1 0 0 0 0    1 1 1 1 2 2 0 0
67         1 1 0 2 2 2 0 0    0 0 1 1 0 0 0 0    1 1 1 2 2 2 0 0
68         3 3 3 3 2 2 0 0    0 0 0 0 0 0 0 0    3 3 3 3 2 2 0 0
69         3 3 3 3 0 0 0 0    4 4 4 4 4 4 4 4    3 3 3 3 4 4 4 4
70         3 3 3 0 0 0 0 0    4 4 4 4 4 4 4 4    3 3 3 4 4 4 4 4
71         0 0 0 0 0 0 0 0    4 4 4 4 4 4 4 4    4 4 4 4 4 4 4 4
72         Switching the patched and the patching raster map layers produces the
73       following results:
74         0 0 1 1 0 0 0 0    1 1 1 0 2 2 0 0    1 1 1 1 2 2 0 0
75         0 0 1 1 0 0 0 0    1 1 0 2 2 2 0 0    1 1 1 1 2 2 0 0
76         0 0 0 0 0 0 0 0    3 3 3 3 2 2 0 0    3 3 3 3 2 2 0 0
77         4 4 4 4 4 4 4 4    3 3 3 3 0 0 0 0    4 4 4 4 4 4 4 4
78         4 4 4 4 4 4 4 4    3 3 3 0 0 0 0 0    4 4 4 4 4 4 4 4
79         4 4 4 4 4 4 4 4    0 0 0 0 0 0 0 0    4 4 4 4 4 4 4 4
80
81

NOTES

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

EXAMPLE

105       Create  a list of maps matching a pattern, extend the region to include
106       them all, and patch them together to create a mosaic. Overlapping  maps
107       will be used in the order listed.
108       MAPS=`g.mlist type=rast sep=, pat="map_*"`
109       g.region rast=$MAPS
110       r.patch in=$MAPS out=mosaic
111
112

SEE ALSO

114       g.region, g.remove, g.rename, r.mapcalc, r.support, v.mkgrid
115

AUTHOR

117       Michael Shapiro, U.S. Army Construction Engineering Research Laboratory
118       -z flag by Huidae Cho
119
120       Last changed: $Date: 2006-05-15 04:02:12 +0200 (Mon, 15 May 2006) $
121
122       Full index
123
124       © 2003-2008 GRASS Development Team
125
126
127
128GRASS 6.3.0                                                         r.patch(1)
Impressum