首页 > 其他 > 详细

使用arcpy添加grb2数据到镶嵌数据集中

时间:2019-05-19 14:11:18      阅读:199      评论:0      收藏:0      [点我收藏+]

 

 

#!coding: utf-8
import numpy as np
import arcpy


def 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()

 

使用arcpy添加grb2数据到镶嵌数据集中

原文:https://www.cnblogs.com/Leechg/p/10889048.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!