Description
This tool writes data from a polygon attribute table to the attribute table of the input point data source. The tool finds the polygon that intersects each point, and acquires the attribute data from that polygon. If polygons overlap and a point intersects multiple polygons the tool just acquires the data from the first polygon it finds.
The tool can acquire data from more than one field in the polygon table at one time. If a single field name is provided (e.g. field="NAME") then only that one field is recorded. To specify multiple fields use the list format, e.g. field=c("NAME", "HEIGHT", "COST"). This tool does not support geometry or blob fields, and if you specify a unique ID field (like FID or OID) then it will be written as a long integer field and renamed so that it does not conflict with the unique ID fields already in the point attribute table.
It is important that the spatial references are defined and are identical for both layers.
Syntax
isectpntpoly(in, poly, field, [where]);
| in | the input point data source | |
| poly | the polygon data source | |
| field | the field(s) in this polygon layer to acquire (either one field or a list of fields) | |
| [where] | the filter/selection statement that will be applied to the point feature class to identify a subset of points to process |
Example
isectpntpoly(in="C:\data\samples.shp", poly="C:\data\soils.shp", field="SOILTYPE");
isectpntpoly(in="C:\data\locs.shp", poly="C:\data\forestunits.shp", field=c("PRIMARY","SECONDARY"));
isectpntpoly(in="C:\data\wells.shp", poly="C:\data\census.shp", field="POPSIZE");