This can be used to identify an interior point for a vector polygon. The interior point will generally be located in a central position and is guaranteed to be located within the polygon, unlike the centroid, which may fall outside the feature for highly convoluted or irregular shaped polygons. For layers containing multi-part polygons, the user can optionally choose to extract an interior point for each part. The default for multi-part polygons is to extract a single point, contained within the widest part of the multi-part polygon.
The following is an example of a Python script that uses this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "polygons.shp"
outputFile = wd + "output.shp"
multipart = "false"
args = [inputFile, outputFile, multipart]
pluginHost.runPlugin("InteriorPoint", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "polygons.shp"
def outputFile = wd + "output.shp"
def multipart = "true"
String[] args = [inputFile, outputFile, multipart]
pluginHost.runPlugin("InteriorPoint", args, false)