IDensityOp PointDensity Example

http://resources.esri.com/help/9.3/arcgisengine/ArcObjects/esriSpatialAnalyst/IDensityOp_PointDensity_Example.htm

Reference: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/PointDensity_Method/00400000003r000000/

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)

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: