Description
This tool generates a single point for each polygon in the input data source. The point can be positioned using one of two settings. The LABEL setting, which is the default, generates a point somewhere inside the boundary of the polygon. The algorithm ESRI uses to determine the location of the label point is not published, but the point is guaranteed to be inside the boundary of the polygon. The CENTROID position places the point in the geometric centre of the polygon (the centre of gravity), which may not fall within the bounds of the polygon depending upon its shape.
The attribute fields for the polygons can be copied to the new point dataset using the 'copyfields' setting. By default the fields are not copied.
Syntax
genpointinpoly(in, out, [position], [copyfields], [where]);
| in | the input polygon data source | |
| out | the output point data source | |
| [position] | (CENTROID or LABEL) if centroid the points are generated at the centre of gravity of the polygon (which may be outside of the polygon); if label the point is guaranteed to be inside the polygon but may not represent the centre of gravity (default=LABEL) | |
| [copyfields] | (TRUE/FALSE) if true the attribute fields from the input dataset are copied to the output dataset (default=FALSE) | |
| [where] | the selection statement that will be applied to the feature data source to identify a subset of features to process (see full Help documentation for further details) |
Example
genpointinpoly(in="C:\data\boundaries.shp", out="C:\data\bndcentroid.shp", position="CENTROID", copyfields=TRUE);
genpointinpoly(in="C:\data\boundaries.shp", out="C:\data\bndlabels.shp");