.TH r.grow.distance 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBr.grow.distance\fR\fR - Generates a raster map containing distances to nearest raster features. .SH KEYWORDS raster, geometry .SH SYNOPSIS \fBr.grow.distance\fR .br \fBr.grow.distance help\fR .br \fBr.grow.distance\fR [\-\fBm\fR] \fBinput\fR=\fIname\fR [\fBdistance\fR=\fIname\fR] [\fBvalue\fR=\fIname\fR] [\fBmetric\fR=\fIstring\fR] [\-\-\fBoverwrite\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-m\fR" 4m .br Output distances in meters instead of map units .IP "\fB\-\-overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB\-\-verbose\fR" 4m .br Verbose module output .IP "\fB\-\-quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBinput\fR=\fIname\fR" 4m .br Name of input raster map .IP "\fBdistance\fR=\fIname\fR" 4m .br Name for distance output map .IP "\fBvalue\fR=\fIname\fR" 4m .br Name for value output map .IP "\fBmetric\fR=\fIstring\fR" 4m .br Metric .br Options: \fIeuclidean,squared,maximum,manhattan,geodesic\fR .br Default: \fIeuclidean\fR .PP .SH DESCRIPTION \fIr.grow.distance\fR generates raster maps representing the distance to the nearest non-null cell in the input map and/or the value of the nearest non-null cell. .SH NOTES The user has the option of specifying five different metrics which control the geometry in which grown cells are created, (controlled by the \fBmetric\fR parameter): \fIEuclidean\fR, \fISquared\fR, \fIManhattan\fR, \fIMaximum\fR, and \fIGeodesic\fR. .PP The \fIEuclidean distance\fR or \fIEuclidean metric\fR is the "ordinary" distance between two points that one would measure with a ruler, which can be proven by repeated application of the Pythagorean theorem. The formula is given by: \fC .DS .br d(dx,dy) = sqrt(dx^2 + dy^2) .br .DE \fR Cells grown using this metric would form isolines of distance that are circular from a given point, with the distance given by the \fBradius\fR. .PP The \fISquared\fR metric is the \fIEuclidean\fR distance squared, i.e. it simply omits the square-root calculation. This may be faster, and is sufficient if only relative values are required. .PP The \fIManhattan metric\fR, or \fITaxicab geometry\fR, is a form of geometry in which the usual metric of Euclidean geometry is replaced by a new metric in which the distance between two points is the sum of the (absolute) differences of their coordinates. The name alludes to the grid layout of most streets on the island of Manhattan, which causes the shortest path a car could take between two points in the city to have length equal to the points' distance in taxicab geometry. The formula is given by: \fC .DS .br d(dx,dy) = abs(dx) + abs(dy) .br .DE \fR where cells grown using this metric would form isolines of distance that are rhombus-shaped from a given point. .PP The \fIMaximum metric\fR is given by the formula \fC .DS .br d(dx,dy) = max(abs(dx),abs(dy)) .br .DE \fR where the isolines of distance from a point are squares. .PP The \fIGeodesic metric\fR is calculated as geodesic distance, to be used only in latitude-longitude locations. It is recommended to use it along with the \fI-m\fR flag in order to output distances in meters instead of map units. .SH EXAMPLE Distance from the streams network (North Carolina sample dataset): \fC .DS .br g.region rast=streams_derived \-p .br r.grow.distance input=streams_derived distance=dist_from_streams .br .DE \fR .PP Distance from sea in meters in latitude-longitude location: \fC .DS .br g.region rast=sea \-p .br r.grow.distance \-m input=sea distance=dist_from_sea_geodetic metric=geodesic .br .DE \fR .SH SEE ALSO \fI r.grow, r.distance, r.buffer, r.cost, r.patch \fR .PP \fI Wikipedia Entry: Euclidean Metric .br Wikipedia Entry: Manhattan Metric \fR .SH AUTHORS Glynn Clements .PP \fILast changed: $Date: 2014-02-01 22:56:18 +0100 (Sat, 01 Feb 2014) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team