- 积分
- 32
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-7-19
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
import clr
clr.AddReferenceByPartialName("System")
clr.AddReferenceByPartialName("System.Windows.Forms")
clr.AddReferenceByPartialName("System.Drawing")
from System import *
from System.Windows.Forms import *
from System.Drawing import *
import sys
sys.path.append("C:\\Program Files\\MeteoInfo")
clr.AddReference("MeteoInfoC.dll")
from MeteoInfoC import *
from MeteoInfoC.Layout import *
from MeteoInfoC.Data import *
from MeteoInfoC.Legend import *
from MeteoInfoC.Projections import *
#---- 设置路径变量
BaseDir = "C:\\Program Files\\MeteoInfo\\"
MapDir = BaseDir + "Map\\"
LegendDir = BaseDir + "Legend\\"
DataDir = BaseDir + "Sample\\MICAPS\\"
#---- 创建MIApp类的对象
myApp = MIApp()
#---- 添加图层
myApp.OpenLayer("D:\\IronPython Demo\\map\\huzhou_new.shp")
#---- 设置图层渲染
myApp.SetLegendBreak("huzhou_new.shp",0,Color.Yellow,Color.Gray,1,True,False,True)
#---- Lambert投影
#myApp.ProjectLayers("+proj=lcc+lat_1=25+lat_2=47+lon_0=105")
#---- 按照经纬度范围缩放地图
myApp.ZoomLonLat(109,121,29,32)
#---- 设置绘图类型为shaded
myApp.SetDrawType("shaded")
#---- 站点数据插值为格点数据的设置
myApp.SetInterpolation(109,121,29,32,250,250,"IDW_Radius",2,1)
#---- 设置图例文件
myApp.SetLegendScheme("D:\\IronPython Demo\\legend\\rain.lgs")
#---- 设置ActiveLayoutMap(图层显示)
myApp.MapLayout.ActiveLayoutMap.DrawGridLabel = False
myApp.MapLayout.ActiveLayoutMap.DrawGridLine = False
myApp.MapLayout.ActiveLayoutMap.DrawNeatLine = False
myApp.MapLayout.ActiveLayoutMap.Left = 10
myApp.MapLayout.ActiveLayoutMap.Top = 10
myApp.MapLayout.ActiveLayoutMap.Width = 620
myApp.MapLayout.ActiveLayoutMap.Height = 450
inFile = "2011WindD.csv"
print inFile
myApp.OpenLonLatData("D:\\IronPython Demo\\"+inFile)
#---- 生成6小时降水量图层
stData = myApp.GetStationData("WindD")
myApp.Display(stData)
print "Display finished"
myApp.SetTitle("Demo - Draw station model")
myApp.MapLayout.PaintGraphics()
Application.Run(myApp)
在myApp.Display(stData)处出错,错误信息:
ValueError: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
2011WindD.csv
(1.92 KB, 下载次数: 2)
|
|