.TH v.overlay 1grass "" "GRASS 6.4.4" "Grass User's Manual" .SH NAME \fI\fBv.overlay\fR\fR - Overlays two vector maps. .SH KEYWORDS vector, geometry .SH SYNOPSIS \fBv.overlay\fR .br \fBv.overlay help\fR .br \fBv.overlay\fR [\-\fBt\fR] \fBainput\fR=\fIname\fR [\fBatype\fR=\fIstring\fR[,\fIstring\fR,...]] [\fBalayer\fR=\fIinteger\fR] \fBbinput\fR=\fIname\fR [\fBbtype\fR=\fIstring\fR[,\fIstring\fR,...]] [\fBblayer\fR=\fIinteger\fR] \fBoutput\fR=\fIname\fR [\fBoperator\fR=\fIstring\fR] [\fBolayer\fR=\fIinteger\fR[,\fIinteger\fR,...]] [\fBsnap\fR=\fIfloat\fR] [\-\-\fBoverwrite\fR] [\-\-\fBverbose\fR] [\-\-\fBquiet\fR] .SS Flags: .IP "\fB\-t\fR" 4m .br Do not create attribute table .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 "\fBainput\fR=\fIname\fR" 4m .br Name of input vector map (A) .br Name of input vector map .IP "\fBatype\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br Feature type (vector map A) .br Feature type .br Options: \fIline,area\fR .br Default: \fIarea\fR .IP "\fBalayer\fR=\fIinteger\fR" 4m .br Layer number (vector map A) .br A single vector map can be connected to multiple database tables. This number determines which table to use. .br Default: \fI1\fR .IP "\fBbinput\fR=\fIname\fR" 4m .br Name of input vector map (B) .br Name of input vector map .IP "\fBbtype\fR=\fIstring[,\fIstring\fR,...]\fR" 4m .br Feature type (vector map B) .br Feature type .br Options: \fIarea\fR .br Default: \fIarea\fR .IP "\fBblayer\fR=\fIinteger\fR" 4m .br Layer number (vector map B) .br A single vector map can be connected to multiple database tables. This number determines which table to use. .br Default: \fI1\fR .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output vector map .IP "\fBoperator\fR=\fIstring\fR" 4m .br Operator defines features written to output vector map .br Feature is written to output if the result of operation 'ainput operator binput' is true. Input feature is considered to be true, if category of given layer is defined. .br Options: \fIand,or,not,xor\fR .br Default: \fIor\fR .br \fBand\fR: also known as 'intersection' in GIS .br \fBor\fR: also known as 'union' in GIS (only for atype=area) .br \fBnot\fR: features from ainput not overlayed by features from binput .br \fBxor\fR: features from either ainput or binput but not those from ainput overlayed by binput (only for atype=area) .IP "\fBolayer\fR=\fIinteger[,\fIinteger\fR,...]\fR" 4m .br Output layer for new category, ainput and binput .br If 0 or not given, the category is not written .br Default: \fI1,0,0\fR .IP "\fBsnap\fR=\fIfloat\fR" 4m .br Snapping threshold for boundaries .br Disable snapping with snap <= 0 .br Default: \fI1e-8\fR .PP .SH DESCRIPTION \fIv.overlay\fR allows the user to overlay two vector maps. Features in \fIainput\fR can be lines or areas and are cut with areas in \fIbinput\fR. Simple clipping can be performed with the \fIand\fR operator. .PP If areas in \fIainput\fR are overlaid with areas in \fIbinput\fR, it is sometimes necessary to snap areas of \fIbinput\fR to those of \fIainput\fR, otherwise areas can go missing or many sliver areas can be created. Snapping is enabled by default and can be disabled by setting the \fIsnap\fR option to a negative value. Recommended values are between 0.00000001 and 0.0001. Using larger values for snapping can have undesired side-effects, but may sometimes be necessary to get a clean output (see example below). In general, it is recommended to start with a small snapping threshold, gradually increasing the threshold until the result is reasonably clean. Snapping modifies only boundaries in binput, which are snapped to boundaries in ainput. Boundaries in ainput are not modified. .PP If the first number of the \fIolayer\fR option is > 0, then the resulting output map has a merged attribute table in the given layer number. The original column names have a prefix (\fIa_\fR and \fIb_\fR) corresponding to \fIainput\fR and \fIbinput\fR map. .PP If the second number of the \fIolayer\fR option is > 0, then the categories of \fIainput\fR in layer \fIalayer\fR are transferred to the output layer with the second number. .PP If the third number of the \fIolayer\fR option is > 0, then the categories of \fIbinput\fR in layer \fIblayer\fR are transferred to the output layer with the third number. .SH NOTES Currently only areas in \fIainput\fR are supported for the operators \fIor\fR and \fIxor\fR! See also v.select. The operator defines what kind of operation will be done. Features are written to output, if the result of an operation 'ainput operator binput' is true. .PP If the first number of the \fIolayer\fR option is > 0, then attributes of the tables from ainput and binput are joined into a new table linked to the output map with a new cat column. .PP If the second number of the \fIolayer\fR option is > 0, then the attribute table of ainput is copied to the output map. .PP If the third number of the \fIolayer\fR option is > 0, then the attribute table of binput is copied to the output map. .br .br .br .br .SH EXAMPLES .SS Polygons overlaid with ploygons \fC .DS .br v.overlay ainput=lake binput=province output=lakeXprovince operator=or .br .DE \fR Polygon union of urban area and Census 2000 areas (North Carolina dataset): \fC .DS .br # input maps .br d.vect urbanarea .br d.vect census_wake2000 .br .br # union .br v.overlay ain=census_wake2000 bin=urbanarea out=urban_census2000 operator=or .br .br # show result, graphically zooming a subset .br g.region n=230400 s=223800 w=655800 e=662400 .br d.erase .br d.vect urban_census2000 .br .br # show merged attribute table .br v.db.select urban_census2000 where="cat=108" \-v .br cat|108 .br a_cat|98 .br a_AREA|231001264 .br a_PERIMETE|67804.305 .br a_TRACT_|98 .br a_TRACT_ID|98 .br a_RINGS_OK|1 .br a_RINGS_NO|0 .br a_ID|98 .br a_FIPSSTCO|37183 .br a_TRT2000|054108 .br a_STFID|37183054108 .br a_TRACTID|541.08 .br a_TRACT|541.08 .br b_cat|55 .br b_OBJECTID|55 .br b_UA|73261 .br b_NAME|Raleigh .br b_UA_TYPE|UA .br .DE \fR .br \fIv.overlay: Polygon union (right) of urban area (left) and Census 2000 (middle) areas (North Carolina dataset)\fR .PP As can be seen by the resulting large number of centroids on boundaries, the urban areas do not match exactly the Census 2000 areas. In this case a clean result can be obtained by snapping with a threshold of 0.1 m. .SS Lines overlaid with polygons Using the North Carolina sample dataset, we clip the roads map to the area of city of Raleigh, preserving road attributes in layer 1: \fC .DS .br g.region vect=zipcodes_wake .br .br # extract Raleigh city: .br v.extract in=zipcodes_wake out=raleigh \(rs .br where="ZIPNAME = 'RALEIGH'" .br .br # clip road network to city polygon: .br v.overlay ainput=roadsmajor atype=line binput=raleigh \(rs .br out=roadsmajor_raleigh operator=and \(rs .br olayer=0,1,0 .br .DE \fR .br | \fIv.overlay: Line to polygon clipping\fR .SH SEE ALSO \fI v.db.connect, v.select, g.copy \fR .SH AUTHORS Radim Blazek, ITC-Irst, Trento, Italy .br Markus Metz .PP \fILast changed: $Date: 2014-03-16 17:58:53 +0100 (Sun, 16 Mar 2014) $\fR .PP Full index .PP © 2003-2014 GRASS Development Team