博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用arcpy添加grb2数据到镶嵌数据集中
阅读量:5205 次
发布时间:2019-06-14

本文共 1672 字,大约阅读时间需要 5 分钟。

 

 

#!coding: utf-8import numpy as npimport arcpydef addGRB2ToMosaic(grb2name):    print "start add raster"    mygdb = u'/mosaic/mosaic/gdbs/data.gdb/image'    mdname = mygdb  # u"Z:\\gdbs\\data.gdb\\image"    rastype = "Raster Dataset"    inpath = u"/mosaic/mosaic/grb2/{0}".format(grb2name)    print(inpath)    updatecs = "UPDATE_CELL_SIZES"    updatebnd = "UPDATE_BOUNDARY"    updateovr = "NO_OVERVIEWS"    maxlevel = "2"    maxcs = ""    maxdim = ""    spatialref = ""    inputdatafilter = "*.GRB2"    subfolder = "NO_SUBFOLDERS"    duplicate = "OVERWRITE_DUPLICATES"    buildpy = "NO_PYRAMIDS"    calcstats = "CALCULATE_STATISTICS"    buildthumb = "NO_THUMBNAILS"    comments = "Add Raster Datasets"    forcesr = "NO_FORCE_SPATIAL_REFERENCE"    subfolder = "NO_SUBFOLDERS"    duplicate = "EXCLUDE_DUPLICATES"    buildpy = "BUILD_PYRAMIDS"    calcstats = "CALCULATE_STATISTICS"    buildthumb = "NO_THUMBNAILS"    result = arcpy.AddRastersToMosaicDataset_management(        mdname, rastype, inpath, updatecs, updatebnd, updateovr,        maxlevel, maxcs, maxdim, spatialref, inputdatafilter,        subfolder, duplicate, buildpy, calcstats,        buildthumb, comments, forcesr)    print("end add")    print(result)def listRaster():    arcpy.env.workspace = mygdb = u'/mosaic/mosaic/gdbs/data.gdb'    # Get and print a list of GRIDs from the workspace    rasters = arcpy.ListDatasets("*")    for raster in rasters:        print(raster) if __name__ == "__main__":    print("start main ")    # addGRB2ToMosaic("Z_NAFP_C_BABJ_20170906051033_P_CLDAS_RT_CHN_0P05_HOR-TEM-2017090605.GRB2")    addGRB2ToMosaic("")    listRaster()

 

转载于:https://www.cnblogs.com/Leechg/p/10889048.html

你可能感兴趣的文章
UIImage 和 iOS 图片压缩UIImage / UIImageVIew
查看>>
MongoDB的数据库、集合的基本操作
查看>>
JS 多种变量定义
查看>>
redis可执行文件说明
查看>>
ajax向后台传递数组
查看>>
剑指offer系列14:包含min函数的栈
查看>>
疯狂JAVA16课之对象与内存控制
查看>>
[转载]树、森林和二叉树的转换
查看>>
WPF移动Window窗体(鼠标点击左键移动窗体自定义行为)
查看>>
Java核心技术梳理-类加载机制与反射
查看>>
1593: [Usaco2008 Feb]Hotel 旅馆 (线段树)
查看>>
软件测试-----Graph Coverage作业
查看>>
POJO 与 JavaBean 的区别 !
查看>>
php、mysql查询当天,查询本周,查询本月的数据实例(字段是时间戳)
查看>>
Windows Phone 7手势识别左右滑动 非XNA
查看>>
django ORM创建数据库方法
查看>>
Win8下,以管理员身份启动VS项目
查看>>
[bzoj1025][SCOI2009]游戏 (分组背包)
查看>>
BZOJ 1629 [Usaco2005 Nov]Cow Acrobats:贪心【局部证明】
查看>>
生活中的设计模式
查看>>