°®ÆøÏ󣬰®ÆøÏó¼ÒÔ°£¡ 

ÆøÏó¼ÒÔ°

 ÕÒ»ØÃÜÂë
 Á¢¼´×¢²á

QQ怬

Ö»ÐèÒ»²½£¬¿ìËÙ¿ªÊ¼

ÐÂÀË΢²©µÇ½

Ö»ÐèÒ»²½, ¿ìËÙ¿ªÊ¼

ËÑË÷
²é¿´: 9753|»Ø¸´: 14

MeteoInfo½Å±¾Ê¾Àý£ºÉú³É¿É¼û¹âÔÆͼ

[¸´ÖÆÁ´½Ó]

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2013-8-27 11:07:45 | ÏÔʾȫ²¿Â¥²ã |ÔĶÁģʽ

µÇ¼ºó²é¿´¸ü¶à¾«²ÊÄÚÈÝ~

ÄúÐèÒª µÇ¼ ²Å¿ÉÒÔÏÂÔØ»ò²é¿´£¬Ã»ÓÐÕʺţ¿Á¢¼´×¢²á ÐÂÀË΢²©µÇ½

x
¶ÁÈ¡MICAPS¸ñʽÔÆͼÊý¾Ý²¢Éú³ÉͼƬ¡£

½Å±¾´úÂ룺

  1. # This Python file uses the following encoding: GB2312
  2. #--------------------------------------------------------        
  3. # Author: Yaqiang Wang                                          
  4. # Date: 2013-8-27                                                
  5. # Purpose: Read and plot MICAPS cloud data  
  6. # Note: Sample                                                   
  7. #-----------------------------------------------------------  
  8. #---- ÒýÈëÀà¿â
  9. import clr
  10. clr.AddReferenceByPartialName("System")
  11. clr.AddReferenceByPartialName("System.Windows.Forms")
  12. clr.AddReferenceByPartialName("System.Drawing")
  13. from System import *
  14. from System.Windows.Forms import *
  15. from System.Drawing import *
  16. clr.AddReference("MeteoInfoC.dll")
  17. from MeteoInfoC import *
  18. from MeteoInfoC.Data.MapData import *
  19. from MeteoInfoC.Data.MeteoData import *
  20. from MeteoInfoC.Layout import *
  21. from MeteoInfoC.Projections import *

  22. #---- ÉèÖ÷¾¶±äÁ¿
  23. baseDir = "C:\\Program Files (x86)\\MeteoInfo\\"
  24. mapDir = baseDir + "Map\\"
  25. legendDir = baseDir + "pal\\"
  26. dataDir = "D:\\Temp\\micaps\\"

  27. #---- ´ò¿ªÍ¼²ã
  28. bou2Layer = MapDataManage.OpenLayer(mapDir + "bou2_4p.shp")
  29. lb = bou2Layer.LegendScheme.LegendBreaks[0]
  30. lb.Color = Color.Yellow
  31. lb.OutlineColor = Color.Gray
  32. lb.OutlineSize = 1
  33. lb.DrawFill = False
  34. bou1Layer = MapDataManage.OpenLayer(mapDir + "bou1_4l.shp")
  35. lb = bou1Layer.LegendScheme.LegendBreaks[0]
  36. lb.Color = Color.Red
  37. res1Layer = MapDataManage.OpenLayer(mapDir + "res1_4m.shp")
  38. lb = res1Layer.LegendScheme.LegendBreaks[0]
  39. lb.Color = Color.Red
  40. lb.OutlineColor = Color.Black
  41. lb.Size = 5
  42. res1Layer.LabelSet.FieldName = "NAME";
  43. res1Layer.LabelSet.LabelFont = Font("¿¬Ìå", 10);
  44. res1Layer.LabelSet.YOffset = 15;
  45. res1Layer.LabelSet.LabelColor = Color.Red
  46. res1Layer.AddLabels();

  47. #---- ´´½¨MIAppÀàµÄ¶ÔÏó
  48. myApp = MIApp()
  49. mapLayout = myApp.MapLayout
  50. layoutMap = mapLayout.ActiveLayoutMap
  51. mapFrame = layoutMap.MapFrame
  52. mapView = mapFrame.MapView

  53. #---- ÉèÖÃLayout
  54. mapLayout.SetPaperSize(540, 550)

  55. #---- Ìí¼ÓµØͼͼ²ã
  56. mapFrame.AddLayer(bou2Layer)
  57. mapFrame.AddLayer(bou1Layer)
  58. mapFrame.AddLayer(res1Layer)

  59. #---- ÉèÖÃActiveLayoutMap£¨Í¼²ãÏÔʾ£©
  60. layoutMap.DrawGridLine = False
  61. layoutMap.DrawNeatLine = False
  62. layoutMap.DrawGridLabel = False
  63. layoutMap.DrawGridTickLine = False
  64. layoutMap.Left = 10
  65. layoutMap.Top = 10
  66. layoutMap.Width = 500
  67. layoutMap.Height = 490

  68. #---- ÉèÖÃͼÐαêÌâ
  69. aText = mapLayout.AddText("Temp",250,50,"ºÚÌå",12)
  70. aText.Graphic.Legend.Color = Color.Red

  71. #---- ÉèÖÃʱ¼ä
  72. sTime = DateTime.Parse("2013-08-22 16:00")

  73. #---- ÉèÖÃͼÀý
  74. palfn = legendDir + "I-01.pal"

  75. #---- ÉèÖÃMeteoDataInfo
  76. mid = MeteoDataInfo()

  77. #---- ÉèÖÃÊý¾ÝÎļþ  
  78. inFile = sTime.ToString("yyMMddHH") + "00.000"
  79. print inFile
  80. #---- ´ò¿ªMICAPSÊý¾ÝÎļþ
  81. mid.OpenMICAPSData(dataDir + inFile)  
  82. #---- ͶӰ
  83. mapView.ProjectLayers(mid.ProjInfo)
  84. #---- »ñÈ¡ÔÆͼ¸ñµãÊý¾Ý
  85. gData = mid.GetGridData("var")
  86. #---- Éú³ÉÔÆͼͼ²ã
  87. cloudLayer = DrawMeteoData.CreateRasterLayer(gData, "Cloud", palfn)
  88. cloudLayer.ProjInfo = mid.ProjInfo
  89. #---- Ìí¼Óͼ²ã
  90. mapFrame.AddLayer(cloudLayer)
  91. print "Display finished"  
  92. #---- µ÷Õûͼ²ã˳Ðò£¨ÒÔ±ÜÃâѹ¸Ç£©
  93. mapFrame.MoveLayerToBottom(cloudLayer)  
  94. #---- Ëõ·ÅÖÁÔÆͼ·¶Î§
  95. mapView.ZoomToExtentEx(cloudLayer.Extent)
  96. #---- ÉèÖñêÌâÃû³Æ
  97. title = "¿É¼û¹âÔÆͼ(" + sTime.ToString("yyyy-MM-dd HH:00") + ")"
  98. aText.SetLabelText(title)
  99. #---- »æÖÆͼÐÎ
  100. mapLayout.PaintGraphics()
  101. #---- Êä³öͼÐÎΪÎļþ
  102. outFile = "Cloud_" + sTime.ToString("yyyyMMddHH") + ".png"
  103. print outFile
  104. #mapLayout.ExportToPicture("E:\\Temp\\" + outFile)  

  105. #---- ÏÔʾ³ÌÐò´°Ì壨ֻÊÇΪÁË¿´Ð§¹û£¬×Ô¶¯ÔËÐÐʱ²»ÐèÒª£©
  106. #Application.Run(myApp)
  107. myApp.Show()


ÔËÐнá¹û£º
Image00442.png
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2013-8-27 15:38:20 | ÏÔʾȫ²¿Â¥²ã
´óÉñÍþÎä
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2013-8-27 17:18:56 | ÏÔʾȫ²¿Â¥²ã
·Ç³£¸ÐлÀÏʦ
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2013-8-28 02:00:08 | ÏÔʾȫ²¿Â¥²ã
ºÃ¶«Î÷ ¸Ðл¹²Ïí
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2013-8-28 16:09:45 | ÏÔʾȫ²¿Â¥²ã
ѧϰһÏ£¬Êղر¸Ó㬶àл·ÖÏí
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2013-9-9 12:06:47 | ÏÔʾȫ²¿Â¥²ã
´óÉñÍþÎä
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2014-12-24 15:16:41 | ÏÔʾȫ²¿Â¥²ã
ÀÏʦ ÇëÎÊÏ ½Å±¾ÔõôִÐÐÄØ
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2015-6-18 11:23:32 | ÏÔʾȫ²¿Â¥²ã
Â¥Ö÷¿ÉÒÔ·ÖÏí¸öMeteoInfo¶ÁÈ¡¡¢Éú³ÉFY¡ª2CµÄ¿É¼û¹â¡¢ºìÍ⡢ˮÆûͨµÀµÄ´úÂëÂð£¿
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

 Â¥Ö÷| ·¢±íÓÚ 2015-6-18 11:52:36 | ÏÔʾȫ²¿Â¥²ã
Ä«Ä«¿¨ÍÐ ·¢±íÓÚ 2015-6-18 11:23
Â¥Ö÷¿ÉÒÔ·ÖÏí¸öMeteoInfo¶ÁÈ¡¡¢Éú³ÉFY¡ª2CµÄ¿É¼û¹â¡¢ºìÍ⡢ˮÆûͨµÀµÄ´úÂëÂð£¿

Êý¾ÝÊÇʲô£¿
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao

ÐÂÀË΢²©´ïÈËÑ«

·¢±íÓÚ 2015-6-18 16:13:19 | ÏÔʾȫ²¿Â¥²ã

ÀÏʦÄúºÃ£¬Êý¾ÝËäÈ»²»´ó£¬µ«Ò²²»Ð¡£¬¾ßÌåÊý¾ÝÎÒËæºó·¢ÄúµÄÓÊÏ䣬ÕâÀïÌáǰд¹ýÀÏʦÁË~
ÃÜÂëÐÞ¸Äʧ°ÜÇëÁªÏµÎ¢ÐÅ£ºmofangbao
ÄúÐèÒªµÇ¼ºó²Å¿ÉÒÔ»ØÌû µÇ¼ | Á¢¼´×¢²á ÐÂÀË΢²©µÇ½

±¾°æ»ý·Ö¹æÔò

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (¾©ICP-10201084)

±¾Õ¾ÐÅÏ¢¾ùÓÉ»áÔ±·¢±í£¬²»´ú±íÆøÏó¼ÒÔ°Á¢³¡£¬½ûÖ¹ÔÚ±¾Õ¾·¢±íÓë¹ú¼Ò·¨ÂÉÏàµÖ´¥ÑÔÂÛ

¿ìËٻظ´ ·µ»Ø¶¥²¿ ·µ»ØÁбí