栅格
1、栅格处理
# Process: 使用栅格函数生成表
arcpy.GenerateTableFromRasterFunction_management("", 输出表, "")
# Process: 分割栅格
arcpy.SplitRaster_management("", "", "", "SIZE_OF_TILE", "TIFF", "NEAREST", "1 1", "2048 2048", "0", "PIXELS", "", "", "", "NONE", "DEFAULT", "")
# Process: 创建全色锐化的栅格数据集
arcpy.CreatePansharpenedRasterDataset_management("", "3", "2", "1", "1", 输出栅格数据集, "", "Esri", "0.166", "0.167", "0.167", "0.5", "UNKNOWN")
# Process: 创建正射校正的栅格数据集
arcpy.CreateOrthoCorrectedRasterDataset_management("", 输出栅格数据集__2_, "", "", "", "1", "0", "NONE")
# Process: 提取子数据集
arcpy.ExtractSubDataset_management("", 输出栅格, "")
# Process: 栅格转数字地形高程(DTED)
arcpy.RasterToDTED_management("", "", "DTED_1", "NEAREST")
# Process: 波段合成
arcpy.CompositeBands_management("", 输出栅格__2_)
# Process: 裁剪
arcpy.Clip_management("", "", 输出栅格数据集__3_, "", "", "NONE", "NO_MAINTAIN_EXTENT")
# Process: 计算全色锐化权重
arcpy.ComputePansharpenWeights_management("", "", "")
# Process: 重采样
arcpy.Resample_management("", 输出栅格数据集__4_, "", "NEAREST")
2、栅格属性
# Process: 删除栅格属性表
arcpy.DeleteRasterAttributeTable_management("")
# Process: 删除色彩映射表
arcpy.DeleteColormap_management("")
# Process: 导出栅格坐标文件
arcpy.ExportRasterWorldFile_management("")
# Process: 批量构建金字塔
arcpy.BatchBuildPyramids_management("", "-1", "NONE", "NEAREST", "DEFAULT", "75", "")
# Process: 批量计算统计数据
arcpy.BatchCalculateStatistics_management("", "1", "1", "", "")
# Process: 构建栅格属性表
arcpy.BuildRasterAttributeTable_management("", "NONE")
# Process: 构建金字塔
arcpy.BuildPyramids_management("", "-1", "NONE", "NEAREST", "DEFAULT", "75", "OVERWRITE")
# Process: 构建金字塔和统计数据
arcpy.BuildPyramidsandStatistics_management("", "INCLUDE_SUBDIRECTORIES", "BUILD_PYRAMIDS", "CALCULATE_STATISTICS", "NONE", "", "NONE", "1", "1", "", "-1", "NONE", "NEAREST", "DEFAULT", "75", "SKIP_EXISTING", "")
# Process: 添加色彩映射表
arcpy.AddColormap_management("", "", "")
# Process: 获取像元值
arcpy.GetCellValue_management("", "", "")
# Process: 获取栅格属性
arcpy.GetRasterProperties_management("", "MINIMUM", "")
# Process: 计算统计数据
arcpy.CalculateStatistics_management("", "1", "1", "", "OVERWRITE", 感兴趣区)
# Process: 设置栅格属性
arcpy.SetRasterProperties_management("", "", "", "", "", "")
# Process: 转换栅格函数模板
arcpy.ConvertRasterFunctionTemplate_management("", 输出栅格函数模板文件, "JSON")
3、栅格数据集
# Process: 下载栅格
arcpy.DownloadRasters_management("", "", "", "DEFAULT", "NO_CLIPPING", "CONVERT_AS_REQUIRED", "TIFF", "NONE", "", "NO_MAINTAIN_FOLDER")
# Process: 使用栅格函数生成栅格
arcpy.GenerateRasterFromRasterFunction_management("", 输出栅格数据集, "", "", "")
# Process: 创建栅格数据集
arcpy.CreateRasterDataset_management("", "", "", "8_BIT_UNSIGNED", "", "1", "", "PYRAMIDS -1 NEAREST DEFAULT 75 NO_SKIP", "128 128", "LZ77", "")
# Process: 创建随机栅格
arcpy.CreateRandomRaster_management(Default_gdb, "", "UNIFORM 0.0 1.0", "0 0 250 250", "1")
# Process: 复制栅格
arcpy.CopyRaster_management("", 输出栅格数据集__4_, "", "", "", "NONE", "NONE", "", "NONE", "NONE", "", "NONE")
# Process: 工作空间转栅格数据集
arcpy.WorkspaceToRasterDataset_management("", "", "NONE", "LAST", "FIRST", "", "", "NONE", "0", "NONE", "NONE")
# Process: 栅格目录转栅格数据集
arcpy.RasterCatalogToRasterDataset_management("", 输出栅格数据集__6_, "", "LAST", "FIRST", "", "NONE", "8_BIT_UNSIGNED", "NONE", "NONE", "CALCULATE_FROM_ALL", "")
# Process: 镶嵌
arcpy.Mosaic_management("", "", "LAST", "FIRST", "", "", "NONE", "0", "NONE")
# Process: 镶嵌至新栅格
arcpy.MosaicToNewRaster_management("", "", "", "", "8_BIT_UNSIGNED", "", "", "LAST", "FIRST")
4、栅格目录
# Process: 修复栅格目录路径
arcpy.RepairRasterCatalogPaths_management("", "FIX", "", "")
# Process: 创建栅格目录
arcpy.CreateRasterCatalog_management("", "", "", "", "", "0", "0", "0", "MANAGED", "")
# Process: 删除栅格目录项
arcpy.DeleteRasterCatalogItems_management("")
# Process: 复制栅格目录项
arcpy.CopyRasterCatalogItems_management("", 输出栅格目录__4_, "", "0", "0", "0")
# Process: 导出栅格目录路径
arcpy.ExportRasterCatalogPaths_management("", "BROKEN", 输出表)
# Process: 工作空间转栅格目录
arcpy.WorkspaceToRasterCatalog_management("", "", "NONE", "NONE")
5、正射映射
# Process: 分析控制点
arcpy.AnalyzeControlPoints_management("", "", 输出控制点覆盖范围表, 输出重叠要素类, "", "0.2", "2")
# Process: 匹配控制点
arcpy.MatchControlPoints_management("", "", 输出控制点表, "HIGH")
# Process: 基于点云进行插值
arcpy.InterpolateFromPointCloud_management("", 输出栅格, "", "TRIANGULATION", "GAUSS5x5", "DTM", "")
# Process: 应用区域网平差
arcpy.ApplyBlockAdjustment_management("", "ADJUST", "", "", "", "", "", "NO_ADJUST_FOOTPRINTS")
# Process: 更新内部方向
arcpy.UpdateInteriorOrientation_management("", "", "", "NO_CHANGE", "NO_UPDATE")
# Process: 构建立体模型
arcpy.BuildStereoModel_management("", "10", "70", "0.5", "", "2", "")
# Process: 生成区域网平差报告
arcpy.GenerateBlockAdjustmentReport_management("", "", "", 输出报表, "")
# Process: 生成点云
arcpy.GeneratePointCloud_management("", "ETM", 输出_LAS_文件夹, 输出_LAS_基本名称, "10", "", "4", "0.6", "0.2", "2", "8")
# Process: 计算区域网平差
arcpy.ComputeBlockAdjustment_management("", "", "POLYORDER1", 输出解决方案表, 输出解决方案点表, "5", "", "MEDIUM", 输出校正质量表)
# Process: 计算基准
arcpy.ComputeFiducials_management("", 输出基准表, "", "", "NO_CHANGE")
# Process: 计算控制点
arcpy.ComputeControlPoints_management("", "", 输出控制点表__2_, "HIGH", 输出影像要素, "MEDIUM", "RANDOM", "", "MEDIUM")
# Process: 计算照相机模型
arcpy.ComputeCameraModel_management("", 输出_DSM, "HIGH", "ESTIMATE", "REFINE", "APPLY", "5", "8", 输出控制点表__3_, 输出解决方案表__2_, 输出解决方案点表__2_, 输出飞行路径, "", "0.2", "NO_REMOVE", "", "")
# Process: 计算连接点
arcpy.ComputeTiePoints_management("", 输出控制点表__4_, "MEDIUM", "", 输出影像要素__2_, "MEDIUM", "RANDOM", "MEDIUM")
# Process: 追加控制点
arcpy.AppendControlPoints_management("", "", "", "", "", "", "", "NONE")
6、镶嵌数据集
# Process: 从镶嵌数据集中移除栅格
arcpy.RemoveRastersFromMosaicDataset_management("", "", "UPDATE_BOUNDARY", "MARK_OVERVIEW_ITEMS", "DELETE_OVERVIEW_IMAGES", "DELETE_ITEM_CACHE", "REMOVE_MOSAICDATASET_ITEMS", "UPDATE_CELL_SIZES")
# Process: 修复镶嵌数据集路径
arcpy.RepairMosaicDatasetPaths_management("", "", "")
# Process: 分割镶嵌数据集项目
arcpy.SplitMosaicDatasetItems_management("", "")
# Process: 分析镶嵌数据集
arcpy.AnalyzeMosaicDataset_management("", "", "")
# Process: 创建镶嵌数据集
arcpy.CreateMosaicDataset_management("", "", "", "", "", "NONE", "")
# Process: 删除镶嵌数据集
arcpy.DeleteMosaicDataset_management("", "DELETE_OVERVIEW_IMAGES", "DELETE_ITEM_CACHE")
# Process: 合并镶嵌数据集项目
arcpy.MergeMosaicDatasetItems_management("", "", "", "1000")
# Process: 同步镶嵌数据集
arcpy.SynchronizeMosaicDataset_management("", "", "NO_NEW_ITEMS", "SYNC_STALE", "UPDATE_CELL_SIZES", "UPDATE_BOUNDARY", "NO_OVERVIEWS", "NO_PYRAMIDS", "NO_STATISTICS", "NO_THUMBNAILS", "NO_ITEM_CACHE", "REBUILD_RASTER", "UPDATE_FIELDS", "", "UPDATE_EXISTING_ITEMS", "IGNORE_BROKEN_ITEMS", "SKIP_EXISTING_ITEMS", "NO_REFRESH_INFO", "NO_STATISTICS")
# Process: 定义概视图
arcpy.DefineOverviews_management("", "", "", "", "", "", "5120", "5120", "3", "NO_FORCE_OVERVIEW_TILES", "BILINEAR", "JPEG", "80")
# Process: 定义镶嵌数据集 NoData
arcpy.DefineMosaicDatasetNoData_management("", "", "", "", "", "NO_COMPOSITE_NODATA")
# Process: 导入镶嵌数据集边界
arcpy.ImportMosaicDatasetGeometry_management("", "", "", "", "")
# Process: 导出镶嵌数据集几何
arcpy.ExportMosaicDatasetGeometry_management("", 输出要素类, "", "FOOTPRINT")
# Process: 导出镶嵌数据集路径
arcpy.ExportMosaicDatasetPaths_management("", 输出表, "", "ALL", "")
# Process: 导出镶嵌数据集项目
arcpy.ExportMosaicDatasetItems_management("", "", "", "", "TIFF", "", "NONE", "DEFAULT", "")
# Process: 平衡镶嵌数据集色彩
arcpy.ColorBalanceMosaicDataset_management("", "DODGING", "COLOR_GRID", "", "", "NONE", "1", "")
# Process: 引用已有数据创建镶嵌数据集
arcpy.CreateReferencedMosaicDataset_management("", 输出镶嵌数据集, "", "", "", "", "", "", "SELECT_USING_FEATURES", "", "", "", "", "BUILD_BOUNDARY")
# Process: 更改镶嵌数据集方案
arcpy.AlterMosaicDatasetSchema_management("", "", "", "NO_EDITOR_TRACKING")
# Process: 构建接缝线
arcpy.BuildSeamlines_management("", "", "NORTH_WEST", "ASCENDING", "", "", "", "RADIOMETRY", "", "BOTH", "1000", "PIXELS", "PIXELS", 感兴趣区, "", "IGNORE_EXISTING", "100", "0.05", "20")
# Process: 构建概视图
arcpy.BuildOverviews_management("", "", "DEFINE_MISSING_TILES", "GENERATE_OVERVIEWS", "GENERATE_MISSING_IMAGES", "REGENERATE_STALE_IMAGES")
# Process: 构建轮廓
arcpy.BuildFootprints_management("", "", "RADIOMETRY", "1", "254", "80", "0", "NO_MAINTAIN_EDGES", "SKIP_DERIVED_IMAGES", "UPDATE_BOUNDARY", "2000", "100", "NONE", "", "20", "0.05")
# Process: 构建边界
arcpy.BuildBoundary_management("", "", "OVERWRITE", "NONE")
# Process: 构建镶嵌数据集项目缓存
arcpy.BuildMosaicDatasetItemCache_management("", "", "DEFINE_CACHE", "GENERATE_CACHE", "", "LOSSLESS", "80", "200000", "200000", "PIXEL_SIZE_FACTOR", "1")
# Process: 添加栅格至镶嵌数据集
arcpy.AddRastersToMosaicDataset_management("", "Raster Dataset", "", "UPDATE_CELL_SIZES", "UPDATE_BOUNDARY", "NO_OVERVIEWS", "", "0", "1500", "", "", "SUBFOLDERS", "ALLOW_DUPLICATES", "NO_PYRAMIDS", "NO_STATISTICS", "NO_THUMBNAILS", "", "NO_FORCE_SPATIAL_REFERENCE", "NO_STATISTICS", "")
# Process: 生成排除区域
arcpy.GenerateExcludeArea_management("", 输出栅格数据集, "8_bit", "COLOR_MASK", "255", "255", "255", "255", "0", "255", "255", "255", "0", "100")
# Process: 生成栅格集合
arcpy.GenerateRasterCollection_management(输出栅格集合, "", "", "", "", "", "NO_GENERATE_RASTERS", "", "CRF", "")
# Process: 编辑栅格函数
arcpy.EditRasterFunction_management("", "EDIT_MOSAIC_DATASET", "INSERT", "", "")
# Process: 计算像元大小范围
arcpy.CalculateCellSizeRanges_management("", "", "MIN_CELL_SIZES", "MAX_CELL_SIZES", "10", "0.8", "UPDATE_ALL")
# Process: 计算脏区
arcpy.ComputeDirtyArea_management("", "", "", 输出要素类__2_)
# Process: 计算镶嵌候选项
arcpy.ComputeMosaicCandidates_management("", "0.6", "0.05")
# Process: 设置镶嵌数据集属性
arcpy.SetMosaicDatasetProperties_management("", "4100", "15000", "None;LZ77;JPEG;LERC", "NONE", "75", "0", "BILINEAR", "NOT_CLIP", "FOOTPRINTS_MAY_CONTAIN_NODATA", "CLIP", "NOT_APPLY", "", "NONE", "Center;NorthWest;LockRaster;ByAttribute;Nadir;Viewpoint;Seamline;None", "Center", "", "", "ASCENDING", "FIRST", "10", "600", "300", "20", "0.8", "", "FULL", "", "DISABLED", "", "", "", "", "20", "1000", "GENERIC", "1", "", "None", "", "", "NONE", "")
箴言:因为这些东西是非常简单的。不要抱怨自己学不会,那是因为你没有足够用心。