NAME

s.to.poly.sh - create coarse-grained area vectors from a site file
(GRASS Shell Script)

SYNOPSIS

s.to.poly.sh input=sitefile output=vectormap    [ filter=filterfile    |    filter=none ] [ maxpoly=n ] [ maxiter=n ]

DESCRIPTION

s.to.poly.sh is a UNIX Bourne shell to create coarse-grained polygons that surround site data. s.to.poly.sh differs from convex hull operations available in s.geom in that s.to.poly.sh allows site data to clump into several polygons, rather than a single polygon surrounding around all sites.

s.to.poly.sh first converts site data into an intermediate raster map, and the filters the raster using r.mfilter to remove isolated points. See the notes section for the default filter used. Any other filter may be used by specifing the filter= option, or no filtering by specifing filter=none.

Next, the raster data is converted into area vectors with r.poly and the number of unique polygons are counted. If the number of polygons is greater than the number specified with maxpoly=n, the raster is grown using r.grow. Processing continues until either the number of polygons is less than or equal to the number requested in maxpoly=n, or until the maximum number of iterations has been reached, specified with maxiter=n.

OPTIONS

Parameters:

input=sitefile
The name a site file.
output=vectormap
The name of the resulting vector map. The new vector map is created in the currently selected mapset and database.

Optional parameters:

filter=filterfile or filter=none
The name of a filter (r.mfilter format) to preprocess site data after conversion into an intermediate raster map. Specify none to skip filtering. The default filter is listed in the notes section.
maxpoly=n
The number of desired polygons in the resulting vector map. The default is 99999.
maxiter=n
The number of iterations of converting the site data to area vectors. The default is 5.

NOTES

Environment variables GISBASE , GISDBASE , LOCATION_NAME and MAPSET are used to specify the GRASS database, location, and mapset.

The default filter used to smooth site data is:

MATRIX 11
1 1 1 1 1 1 1 1 1 1 1
1 1 1 2 2 2 2 2 1 1 1
1 1 2 2 3 3 3 2 2 1 1
1 2 2 3 3 3 3 3 2 2 1
1 2 3 3 0 0 0 3 3 2 1
1 2 3 3 0 0 0 3 3 2 1
1 2 3 3 0 0 0 3 3 2 1
1 2 2 3 3 3 3 3 2 2 1
1 1 2 2 3 3 3 2 2 1 1
1 1 1 2 2 2 2 2 1 1 1
1 1 1 1 1 1 1 1 1 1 1
DIVISOR 50
TYPE P
EOF

Several intermediate raster maps are created and removed during processing.

FILES

SEE ALSO

s.to.rast
r.mfilter
r.grow
r.poly
r.mapcalc
s.geom

AUTHOR

Tom Poindexter, February, 2000
tpoindex@nyx.net