RadiusVariable
Summary
Defines a variable search radius by specifying a maximum distance and the number of points for analysis. If the number of points cannot be satisfied within that maximum distance, a smaller number of points will be used.
Discussion
Tools that use radius objects: Kriging and IDW.
Syntax
RadiusVariable({numberOfPoints}, {maxDistance})
| Name | Explanation | Data type |
|---|---|---|
|
numberOfPoints (Optional) |
The The default value is 12. |
Long |
|
maxDistance (Optional) |
The If the number of points cannot be satisfied within that distance, a smaller number of points will be used. |
Double |
Properties
| Name | Explanation | Data type |
|---|---|---|
|
numberOfPoints (Read and Write) |
The |
Long |
|
maxDistance (Read and Write) |
The |
Double |
Code sample
Demonstrates how to create a RadiusVariable class and use it in the Kriging tool within the Python window.
import arcpy
from arcpy import env
from arcpy.sa import *
env.workspace = "C:/sapyexamples/data"
myRadius = RadiusVariable(12)
outKriging = Kriging("ca_ozone_pts.shp", "ELEVATION", "SPHERICAL", 2000, myRadius, "C:/sapyexamples/output/krigvpradiusv")
outKriging.save("C:/sapyexamples/output/krigradvar")
Calculates a surface with the Idw interpolation tool using the RadiusVariable class.
# Name: RadiusVariable_Ex_02.py
# Description: Uses the RadiusVariable object to run IDW tool.
# Requirements: Spatial Analyst extension
# Import system modules
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
env.workspace = "C:/sapyexamples/data"
# Set local variables
inFeature = "ca_ozone_pts.shp"
# Create the Radius Variable
numberOfPoints = 5
maxDistance = 200000
searchRadius = RadiusVariable(numberOfPoints, maxDistance)
# Run IDW
outIDWRadVar = Idw(inFeature, "elevation", 2000, 3, searchRadius)
# Save the output
outIDWRadVar.save("C:/sapyexamples/output/idwradvar")