爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 14941|回复: 22

[作图] ncl中加入shapefile,网格数据值与地图偏移

[复制链接]

新浪微博达人勋

发表于 2016-9-18 16:32:50 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
本帖最后由 ffxfxfxf 于 2016-9-18 17:57 编辑

同样的网格数据和shapefile文件,为什么在ncl中出来的图,格点数据值和地图不能匹配呢?ncl图中行政区划之外的数据应该全部为0才对
我将ncl中的数据导出excel,然后赋给每个网格投影坐标,用GIS出图,结果就能完全匹配好?
请各位大神帮忙看看,不胜感激!NCL出图部分代码如下:
   res                       =  True
   res@tfDoNDCOverlay        =  True
   res@gsnAddCyclic          =  True
   res@gsnMaximize           =  False
   res@gsnDraw               =  False
   res@gsnFrame              =  False
   res@gsnStringFont         =  21
   res@gsnLeftString         =  "Grid Capacity" ; turn on up-left side title string
   res@gsnLeftStringFontHeightF   =  0.015
   res@gsnCenterString       =  start_year+"_"+cur_month_name+"_monthly" ; turn on up-left side title string
   res@gsnCenterStringFontHeightF =  0.015
   res@gsnRightString        =  species+"(kg/(grid*month))" ; turn on up-right side title string
   res@gsnRightStringFontHeightF  =  0.015

   res@cnLevelSelectionMode    =  "ManualLevels"
   res@cnMinLevelValF          =  1
   res@cnMaxLevelValF          =  max_capacity
   res@cnLevelSpacingF         =  space_capacity
   ;res@cnLevelSelectionMode    =  "AutomaticLevels" ; set explicited level label
   res@cnFillOn                =  True           ; turn on contour fill
   res@cnLinesOn               =  False          ; turn off contour lines
   res@cnLineLabelsOn          =  False          ; turn off contour labels
   res@cnConstFEnableFill      =  True
   res@cnConstFLabelOn         =  False
   res@lbAutoManage            =  True
   res@lbLabelBarOn            =  True           ; turn off labelbar
   res@lbLabelPosition         =  "Right"
   res@lbOrientation           =  "Vertical"
   res@lbLeftMarginF           =  -0.05
   res@lbLabelFont             =  25
   res@lbLabelFontHeightF      =  0.015

  res@mpFillDrawOrder         =  "PostDraw"     ; draw map fill last
   res@mpProjection            =  "LambertConformal"     ; choose projection
   res@mpLambertParallel1F     =  27.0            ; first parallel
   res@mpLambertParallel2F     =  37.0            ; second parallel
   res@mpLambertMeridianF      =  117.3           ; meridian
   res@mpLimitMode             =  "Corners"
  res@mpLeftCornerLatF    = 26.76          ; left corner
  res@mpLeftCornerLonF    = 112.78        ; left corner
  res@mpRightCornerLatF   = 35.68          ; right corner
  res@mpRightCornerLonF   = 122.62         ; right corner
   res@mpFillOn                =  False
   res@mpOutlineOn             =  False
   res@mpGridAndLimbOn         =  True            ; grid line or longitude and latitude line
   res@mpGridLatSpacingF       =  (max(lat2d_clip)-min(lat2d_clip))/4
   res@mpGridLonSpacingF       =  (max(lon2d_clip)-min(lon2d_clip))/4
   res@mpGridLineThicknessF    =  0.5

ncl

ncl

gis图

gis图
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-9-18 19:40:25 | 显示全部楼层
楼主是安徽的吗,我也是,帮顶
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-9-18 22:06:53 | 显示全部楼层
subtropical 发表于 2016-9-18 19:40
楼主是安徽的吗,我也是,帮顶

谢谢帮顶!我在帝都,目前在做一个安徽的项目!
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-9-19 08:08:44 | 显示全部楼层
ffxfxfxf 发表于 2016-9-18 22:06
谢谢帮顶!我在帝都,目前在做一个安徽的项目!

哦哦好的加油
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-9-19 09:09:19 | 显示全部楼层
是不是和地图投影有关系?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-9-20 09:12:02 | 显示全部楼层
你好,看了下图感觉整体偏移了。以前好像也遇过这个问题,所以这里问问设置投影的时候你的LambertConformal后面的参数怎么定义的?
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-9-20 18:03:05 | 显示全部楼层
dataiyang 发表于 2016-9-20 09:12
你好,看了下图感觉整体偏移了。以前好像也遇过这个问题,所以这里问问设置投影的时候你的LambertConformal ...

是啊,看图片就是整体偏移了,以为是数据处理的问题,但是把出图的二维数据输出来之后用arcmap画图又是好着的。
ncl脚本中LambertConformal后面的设置就是我贴上来的这些属性了。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2016-9-20 18:03:57 | 显示全部楼层
海盗船长 发表于 2016-9-19 09:09
是不是和地图投影有关系?

感觉是地图投影的问题。但是我NCL中和GIS中的投影设置是一样的,GIS中出来的图就是好着的。
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-9-23 01:35:56 | 显示全部楼层
这和你的数据的坐标属性有关,其他没关系
密码修改失败请联系微信:mofangbao

新浪微博达人勋

发表于 2016-9-27 12:53:49 | 显示全部楼层
请问你解决了吗
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表