arcgis中轉換netCDF為柵格資料

來源:互聯網
上載者:User

標籤:lock   資料   rcp   import   檔案   tiff   協助   user   nis   

最近有個同學詢問我一個問題,使用arcpy把netcdf轉化成柵格檔案,忙活了兩個小時才搞定,其實主要代碼非常簡單,只不過要對arcgis 的功能比較熟悉(其實多思考和查考它的協助文章,無聊)

 

# -*- coding: utf-8 -*-import arcpyfrom arcpy.sa import *def NetCDF2Tiff(inNetCDFFile,toTIFFFile):    variable = "Qs_GDS0_SFC"    XDimension = "g0_lon_1"    YDimension = "g0_lat_0"    outRasterLayer = "gldasTest"    bandDimmension = ""    dimensionValues = ""    valueSelectionMethod = ""    print "start"    arcpy.MakeNetCDFRasterLayer_md(inNetCDFFile, variable, XDimension, YDimension,                                   outRasterLayer, bandDimmension, dimensionValues,                                    valueSelectionMethod)    arcpy.CopyRaster_management(outRasterLayer, toTIFFFile,format="TIFF")    print "finish"## inNetCDFFile = "C:/Users/Administrator/Documents/GLDAS_NOAH025SUBP_3H.A2014058.0600.001.2017040053742.pss.nc"toTIFFFile =  "C:/Users/Administrator/Documents/test.tif"NetCDF2Tiff(inNetCDFFile,toTIFFFile)

還有,值得注意的是,在使用arcpy的時候,使用ipython和notebook的時候,總是運行程式的時候出現錯誤

arcgis中轉換netCDF為柵格資料

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.