码迷,mamicode.com
首页 > 编程语言 > 详细

python gdal 数组生成图片

时间:2017-11-16 14:28:04      阅读:387      评论:0      收藏:0      [点我收藏+]

标签:new   height   eps   out   ati   ror   erb   drive   write   

cols = array.shape[1]
rows = array.shape[0]
originX = rasterOrigin[0]
originY = rasterOrigin[1]
driver = gdal.GetDriverByName(‘GTiff‘)
outRaster = driver.Create(newRasterfn, cols, rows, 0, gdal.GDT_Float32)
outRaster.SetGeoTransform((originX, pixelWidth, 0, originY, 0, pixelHeight))
outband = outRaster.GetRasterBand(1)
outband.WriteArray(array)
outRasterSRS = osr.SpatialReference()
outRasterSRS.ImportFromEPSG(4326)
outRaster.SetProjection(outRasterSRS.ExportToWkt())
outband.FlushCache()

python gdal 数组生成图片

标签:new   height   eps   out   ati   ror   erb   drive   write   

原文地址:http://www.cnblogs.com/weihongli/p/7843435.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!