Geospatial Modelling Environment

genpointinpoly (Generate Points In Polygons)

Generates a single point for each polygon in the input data source


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.


genpointinpoly(in, out, [position], [copyfields], [where]);

inthe input polygon data source
outthe output point data source
[position]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; options: CENTROID, 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)


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");


Please consider making a purchase to support the continued development of these tools  Read more...

Tips on how to use this interface efficiently 


Open Source GIS

Copyright © 2001-2014 Hawthorne L. Beyer, Ph.D., Spatial Ecology LLC    Connect on LinkedIn