请选择 进入手机版 | 继续访问电脑版
爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 5736|回复: 1

[作图] 轮廓出图错误

[复制链接]

新浪微博达人勋

发表于 2019-1-16 16:59:40 | 显示全部楼层 |阅读模式

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

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

x
fatal:MapRGDHDrawMapList: MDRGSF/MDRGOF - ERROR OPENING RANGS/GSHHS CAT FILE
fatal:PlotManagerDraw: error in plot draw
fatal:_NhlPlotManagerDraw: Draw error
中国轮廓图绘制时报错。请问是什么出了问题。出来的图什么都没有,只是阴影

segments = f->segments
geometry = f->geometry
segsDims = dimsizes(segments)
geomDims = dimsizes(geometry)

;-- get global attributes
geom_segIndex = f@geom_segIndex
geom_numSegs = f@geom_numSegs
segs_xyzIndex = f@segs_xyzIndex
segs_numPnts = f@segs_numPnts
numFeatures = geomDims(0)

;-- open workstation
wks = gsn_open_wks("png","plot_shapefile_plot")
;-- set resources for the map

res = True
res@gsnDraw = False ;-- don't draw the plot
res@gsnFrame = False ;-- don't advance frame yet




res@gsnMaximize = True ;-- maximize plot in frame
res@mpDataBaseVersion = "HighRes"
res@mpDataResolution = "Medium"
res@mpProjection = "Mercator" ;-- change projection
;-- select coordinates for Germany

res@mpLimitMode = "Corners"
res@mpLeftCornerLatF = 47.
res@mpRightCornerLatF = 55.
res@mpLeftCornerLonF = 5.
res@mpRightCornerLonF = 16.
res@tiMainString = "NCL Doc Example: Shapefile plot"
res@tiMainFontHeightF = 0.015
;-- generate map, but don't draw it
plot = gsn_csm_map(wks,res) ;-- draw map, but don't advance frame
;-- add polylines from the shape files to the plot
lines = new(segsDims(0),graphic) ;-- array to hold shapefile polylines
;-- set resources for the polylines
plres = True
plres@gsLineColor = "red"

;-- generate polylines, but don't draw it
lon = f->x
lat = f->y
segNum = 0
do i=0, numFeatures-1
startSegment = geometry(i, geom_segIndex)
numSegments = geometry(i, geom_numSegs)
do seg=startSegment, startSegment+numSegments-1
startPT = segments(seg, segs_xyzIndex)
endPT = startPT + segments(seg, segs_numPnts) - 1
lines(segNum) = gsn_add_polyline(wks, plot, lon(startPT:endPT),lat(startPT:endPT), plres)
segNum = segNum + 1
end do
end do
;-- draw the plot
draw(plot)
frame(wks)





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

新浪微博达人勋

发表于 2020-9-28 10:30:38 | 显示全部楼层
res@mpDataBaseVersion = "HighRes"  
你查一下是不是没有下载高分辨率地图
把这一行注释掉就可以了
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

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

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

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