Answers:
在ESRI文档的各个角落进行了大量搜索之后,我得出结论,没有合理的方法在Arcpy / ArcGIS中运行双变量Ripley的K函数。但是,我发现了使用R的解决方案:
# Calculates an estimate of the cross-type L-function for a multitype point pattern.
library(maptools)
library(spatstat)
library(sp)
# Subset certain areas within a points shapefile. In this case, features are grouped by gap number
gap = 1
# Read the shapefile
sdata = readShapePoints("C:/temp/GapPoints.shp") #Read the shapefile
data = sdata[sdata$SITE_ID == gap,] # segregate only those points in the given cluster
# Get the convex hull of the study area measurements
gapdata = readShapePoints("C:/temp/GapAreaPoints_merged.shp") #Read the shapefile that is used to estimate the study area boundary
data2 = gapdata[gapdata$FinalGap == gap,] # segregate only those points in the given cluster
whole = coordinates(data2) # get just the coords, excluding other data
win = convexhull.xy(whole) # Convex hull is used to get the study area boundary
plot(win)
# Converting to PPP
points = coordinates(data) # get just the coords, excluding other data
ppp = as.ppp(points, win) # Convert the points into the spatstat format
ppp = setmarks(ppp, data$SPECIES) # Set the marks to species type YB or EH
summary(ppp) # General info about the created ppp object
plot(ppp) # Visually check the points and bounding area
# Plot the cross type L function
# Note that the red and green lines show the effects of different edge corrections
plot(Lcross(ppp,"EH","YB"))
# Use the Lcross function to test the spatial relationship between YB and EH
L <- envelope(ppp, Lcross, nsim = 999, i = "EH", j = "YB")
plot(L)
在ArcToolbox中的空间统计 - 分析模式工具集下,有一个内置的脚本工具,称为多距离空间聚类分析(Ripleys K函数)。如果进入工具的属性并找到“源”选项卡中使用的脚本,则可以阅读该工具的源代码。