importarcpy arcpy.AddField_management("c:/data/Portland.gdb/streets","LENGTH_MILES","FLOAT") arcpy.CalculateField_management("c:/data/Portland.gdb/streets","LENGTH_MILES","!shape.length@miles!","PYTHON3") arcpy.FeatureClassToFeatureClass_conversion("c:/data/Portland.gdb/streets","Database Co...
arcpy.FeatureClassToFeatureClass:用于将一个地图要素集合转换为另一个地图要素集合,可以指定要转换的要...
1. 创建Feature Class。 //新建Feature类 Create_Feature_Class() 2. Add Field。 #Name: AddField_Example2.py#Description: Add a pair of new fields to a table#Import system modulesimportarcpyfromarcpyimportenv#Set environment settingsenv.workspace ="C:/data/airport.gdb"#Set local variablesinFeat...
列出字段:还有一个常用的列出数据的函数是 arcpy.ListFields() 。此函数列出指定数据集的要素类或表中的字段。语法为arcpy.ListFields(dataset, {wild_card}, {field_type})。 列出文件:另一个有用的函数是 arcpy.ListFiles() 。此函数返回工作区中所有文件的列表,通常用于列出不是空间数据集的独立文件,包括CSV...
arcpy.AddField_management(r"C:\data\roads.shp", "length", "DOUBLE")```5. arcpy.Calculate...
arcpy.AddField_management("c:/data/Portland.gdb/streets","LENGTH_MILES","TEXT")arcpy.CalculateField_management("c:/data/Portland.gdb/streets","LENGTH_MILES","!shape.length@miles!","PYTHON_9.3")arcpy.FeatureClassToFeatureClass_conversion("c:/data/Portland.gdb/streets","Database Connections/My...
>>> import arcpy >>> arcpy.AddField_management("c:/data/Portland.gdb/streets", "LENGTH_MILES", "TEXT") >>> arcpy.CalculateField_management("c:/data/Portland.gdb/streets", "LENGTH_MILES", "!shape.length@miles!", "PYTHON_9.3") >>> arcpy.FeatureClassToFeatureClass_conversion("c:/data...
比如裁剪(clip),缓冲区(buffer),要素类转要素类(feature class to feature class),添加字段(add field)等等。在脚本中你也可以执行ArcToolbox中的所有工具。作为一名程序员需要记住能够使用的工具取决于当前ArcGIS桌面软件的许可级别。创建一个Python脚本执行ArcToolbox中的工具可实现地理处理任务自动化。
比如裁剪(clip),缓冲区(buffer),要素类转要素类(feature class to feature class),添加字段(add field)等等。在脚本中你也可以执行ArcToolbox中的所有工具。作为一名程序员需要记住能够使用的工具取决于当前ArcGIS桌面软件的许可级别。创建一个Python脚本执行ArcToolbox中的工具可实现地理处理任务自动化。
arcpy.AddField_management("c:/data/Portland.gdb/streets","LENGTH_MILES","FLOAT") arcpy.CalculateField_management("c:/data/Portland.gdb/streets","LENGTH_MILES","!shape.length@miles!","PYTHON3") arcpy.FeatureClassToFeatureClass_conversion("c:/data/Portland.gdb/streets","Database Connections/My...