IDensityOp PointDensity Example


Dim pDensityOp As IDensityOp
Set pDensityOp = New RasterDensityOp

‘Create Raster Analysis Environment and set output cell size
Dim pEnv As IRasterAnalysisEnvironment
Set pEnv = pDensityOp
pEnv.SetCellSize esriRasterEnvValue, 50

Dim pFClass01 As IFeatureClass
Set pFClass01 = FunctionToOpenPointFeatureClass(“C:\data\point01.shp”)

‘ Create Neighborhood using map unit
Dim pNbr As IRasterNeighborhood
Set pNbr = New RasterNeighborhood
pNbr.SetCircle 4, esriUnitsMap

‘ Call the Point Density method using featureclass as input

Dim pRasOut As IRaster
Set pRasOut = pDensityOp.PointDensity(pFClass01, pNbr)

‘ OR

‘ Create FeatureClassDescriptor to specify a field or keyword NONE
Dim pFDescr As IFeatureClassDescriptor
Set pFDescr = New FeatureClassDescriptor
pFDescr.Create pFClass01, Nothing, “Field1”

‘ Call the Point Density method using FeatureClassDescriptor

Dim pRasOut2 As IRaster

Set pRasOut2 = pDensityOp.PointDensity(pFDescr, pNbr)

Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: