可以利用脚本程序来做。
- #-----------------------------------------------------
- # Author: Yaqiang Wang
- # Date: 2014-11-24
- # Purpose: Read U/V data from two files and plot streamline
- # Note: Sample
- #-----------------------------------------------------
- import os
- from org.meteoinfo.data.meteodata import MeteoDataInfo, DrawMeteoData
- from org.meteoinfo.legend import LegendManage
- from org.meteoinfo.shape import ShapeTypes
- from java.awt import Color
- #---- Set directories
- dataDir = 'D:/Temp/nc'
- #---- Open data
- print 'Open data...'
- DataU = MeteoDataInfo()
- DataV = MeteoDataInfo()
- ufn = os.path.join(dataDir, 'uwnd.sig995.2010.nc')
- vfn = os.path.join(dataDir, 'vwnd.sig995.2010.nc')
- DataU.openNetCDFData(ufn)
- DataV.openNetCDFData(vfn)
- #---- Get grid data
- print 'Get grid data...'
- uwnd = DataU.getGridData('uwnd')
- vwnd = DataV.getGridData('vwnd')
- #---- Draw streamline
- print 'Draw streamline...'
- ls = LegendManage.createSingleSymbolLegendScheme(ShapeTypes.Polyline, Color.blue, 1)
- aLayer = DrawMeteoData.createStreamlineLayer(uwnd, vwnd, 4, ls, 'Streamline_UV', True)
- miapp.getMapDocument().getActiveMapFrame().addLayer(aLayer)
- print 'Finished!'
|