📄 largeintersect.py
字号:
"""********************************************************************************************************************
LargeIntersect.py
Description:
Requirements:
Python and the Python for Windows extention (win32 Extension) to be installed.
Author: ESRI, Redlands
Date: 07/14/2004
Usage: .
*********************************************************************************************************************"""
try:
#Import system modules and PartionedOverlayer.py (contains functions to partiondata and overlay)
import PartitionedOverlay, os, sys, string
#PartitionedOverlay.gp.scratchworkspace = "C:\\Temp"
#Get system arguments necessary for processing in this script.
input_featureclasses = sys.argv[1]
output_featureclass = sys.argv[2]
out_type = sys.argv[5]
#Create a Value Table here to contain list of Input featureclasses
input_table = PartitionedOverlay.gp.CreateObject("ValueTable")
input_table.LoadFromString(input_featureclasses)
row_count = input_table.RowCount
#Create a new list to populate with feature type
shape_list = []
#Check if out_type is specified. If it is, set the shape_type.
if out_type.upper() == "POINT" or out_type.upper() == "LINE":
shape_type = out_type
else:
#If out_type is not set, loop through Value Table to get list of input shape types.
for x in range(0, row_count):
inFC = input_table.GetValue(x, 0)
#Describe the inputs to determine shape type
dsc = PartitionedOverlay.gp.describe(inFC)
shape_list.append(dsc.shapetype)
#If any input is of type POINT, the output shape type must be POINT.
#If no POINT featureclass is found, but a LINE feature class is, shape type must be POLYLINE.
if "Point" in shape_list:
shape_type = "POINT"
elif "Polyline" in shape_list:
shape_type = "POLYLINE"
else:
shape_type = "POLYGON"
#Set the shape type
PartitionedOverlay.shape_type = shape_type
#Create the parameter list to pass to the partitioning operation
param_list = [input_featureclasses, output_featureclass, sys.argv[3], sys.argv[4], out_type]
PartitionedOverlay.ScratchWorkspaceExists("intersect_analysis", param_list)
#Set the cluster tolerance in the Partition Overlay script for later use
PartitionedOverlay.SetClustTol("intersect_analysis", input_featureclasses, sys.argv[4])
#Run LargeIntersect passing in the tool name and parameter list
PartitionedOverlay.RunLargeOverlay("intersect_analysis", param_list)
del dsc
except Exception, ErStr:
PartitionedOverlay.gp.AddError(str(ErStr))
except:
PartitionedOverlay.gp.AddError("Failure in LargeIntersect\n" + str(PartitionedOverlay.gp.getmessages(2)))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -