当前位置: 首页>>代码示例>>Python>>正文


Python Nansat.write_image_kml方法代码示例

本文整理汇总了Python中nansat.Nansat.write_image_kml方法的典型用法代码示例。如果您正苦于以下问题:Python Nansat.write_image_kml方法的具体用法?Python Nansat.write_image_kml怎么用?Python Nansat.write_image_kml使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在nansat.Nansat的用法示例。


在下文中一共展示了Nansat.write_image_kml方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: array

# 需要导入模块: from nansat import Nansat [as 别名]
# 或者: from nansat.Nansat import write_image_kml [as 别名]
# 5. Write image
n.reproject() # 1.
lons, lats = n.get_corners() # 2.
pxlRes = distancelib.getPixelResolution(array(lats), array(lons), n[1])
pxlRes = array(pxlRes)*360/40000 # great circle distance
srsString = "+proj=latlong +datum=WGS84 +ellps=WGS84 +no_defs"
#~ extentString = '-lle %f %f %f %f -ts 3000 3000' % (min(lons), min(lats), max(lons), max(lats))
extentString = '-lle %f %f %f %f -tr %f %f' % (min(lons), min(lats), \
                max(lons), max(lats), pxlRes[1], pxlRes[0])
d = Domain(srs=srsString, ext=extentString) # 3.
print d
n.reproject(d) # 4.

# get array with watermask (landmask) b 
# it must be done after reprojection!
# 1. Get Nansat object with watermask
# 2. Get array from Nansat object. 0 - land, 1 - water
#wm = n.watermask(mod44path='/media/magDesk/media/SOLabNFS/store/auxdata/coastline/mod44w/')
wm = n.watermask(mod44path='/media/data/data/auxdata/coastline/mod44w/')
wmArray = wm[1]

figureName = oPath + fileName + '_proj.png'
n.write_figure(fileName=figureName, clim=[3,133], \
               mask_array=wmArray, mask_lut={0: [204, 153, 25]}) # 5.

#~ # make KML file with image borders (to be opened in Googe Earth)
#~ n.write_kml(kmlFileName=oPath + fileName + '_preview.kml')

# make KML image file with image borders (to be opened in Googe Earth)
n.write_image_kml(kmlFileName=oPath + fileName + '.kml', kmlFigureName=figureName)
开发者ID:lelou6666,项目名称:PySOL,代码行数:32,代码来源:nansatExampleNetCDF.py


注:本文中的nansat.Nansat.write_image_kml方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。