This tool maps the spatial pattern of vector feature density onto a raster grid. The tool can be used to answer the question, what is the density of vector features (points, lines, or polygons) within a specified distance of each grid cell in a raster? This can be quite a useful operation for visualizing spatial patterns. The user must specify the name of the input vector file. The user must also provide either the grid resolution of the output surface or the name of an existing raster file from which to derive the geographical extent and grid resolution. If a cell size (grid resolution) is specified, the output raster will derive its geographical extent from that of the input vector file. Each grid cell in the output raster image will contain the density of the features contained (or partially contained) within circular neighbourhood centered on the grid cell. If no features are contained within the neighbourhood, the NoData value will be assigned to the grid cell. This tool operates in parallel and will experience significantly faster processing when run using a system with a multi-core processor.
The following is an example of a Python script using this tool:
wd = pluginHost.getWorkingDirectory()
inputFile = wd + "input.shp"
cellSize = "10.0"
baseFile = "not specified"
searchDistance = "100.0"
outputFile = wd + "output.dep"
args = [inputFile, cellSize, baseFile, searchDistance, outputFile]
pluginHost.runPlugin("VectorFeatureDensity", args, False)
This is a Groovy script also using this tool:
def wd = pluginHost.getWorkingDirectory()
def inputFile = wd + "input.shp"
def cellSize = "not specified"
def baseFile = wd + "basefile.dep"
def searchDistance = "100.0"
def outputFile = wd + "output.dep"
String[] args = [inputFile, cellSize, baseFile, searchDistance, outputFile]
pluginHost.runPlugin("VectorFeatureDensity", args, false)