爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 11243|回复: 18

[作图] NCL添加地区分界线-shp文件哪里可以下?

[复制链接]
发表于 2017-3-20 11:31:38 | 显示全部楼层 |阅读模式

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

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

x
shp_filename = ("$NCL_TUT/data/Shapefiles/DEU_adm/DEU_adm1.shp")
poly = gsn_add_shapefile_polylines(wks,plot,shp_filename,False)
以上命令是给图形加上地区轮廓分界线的,中国各个省的.shp文件在哪里可以下到呢?
请教各位大神!!


密码修改失败请联系微信:mofangbao
发表于 2017-3-20 12:37:13 | 显示全部楼层
本论坛有做好的,好像在MI板块
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-20 15:19:01 | 显示全部楼层
andrewsoong 发表于 2017-3-20 12:37
本论坛有做好的,好像在MI板块

我找到啦,谢谢!!!
密码修改失败请联系微信:mofangbao
发表于 2017-3-20 15:49:39 | 显示全部楼层
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-20 15:59:44 | 显示全部楼层
1649518749 发表于 2017-3-20 15:49
http://bbs.06climate.com/forum.php?mod=viewthread&tid=45252&extra=page%3D1
感觉这个也适合你

好的,我自己先研究研究吧!
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-20 16:29:30 | 显示全部楼层
Soaring 发表于 2017-3-20 15:59
好的,我自己先研究研究吧!

好像不对,我想画北京市具体的图,你这个好像只是为了画中国地图而描绘的每个省的大致轮廓,那每个省具体的shp在哪里呢?
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-20 21:41:37 | 显示全部楼层
andrewsoong 发表于 2017-3-20 12:37
本论坛有做好的,好像在MI板块

你好,还有一个小问题:
begin

  f=addfile("pres.mon.ltm.nc","r")
  pres= f->pres(0,:,:)

;---------------------------------------------------------------
  wks = gsn_open_wks("png","jiangsu")
  gsn_define_colormap( wks ,"gui_default")  

  res                            = True            
  res@gsnMaximize                = True
  res@gsnDraw                    = False
  res@gsnFrame                   = False

;---------------------------------------------------------------
; Mask Beijing plot

; set for the map
  res@mpMinLatF                  = 30
  res@mpMaxLatF                  = 36
  res@mpMinLonF                  = 115
  res@mpMaxLonF                  = 125

  res@mpFillOn                   = True
  res@mpDataSetName              = "Earth..4"
  res@mpDataBaseVersion          = "MediumRes" ; or "Ncarg4_1"

  res@mpAreaMaskingOn            = True
  res@mpOutlineSpecifiers        = "Jiangsu"
  res@mpMaskAreaSpecifiers       = "Jiangsu"

  res@mpLandFillColor            = "white"
  res@mpOceanFillColor           = "white"
  res@mpProvincialLineColor      = "red"
  res@mpProvincialLineThicknessF = 2.

  res@mpShapeMode                = "FreeAspect"
  res@mpFillDrawOrder            = "PostDraw"

;---------------------------------------------------------------
; set for the plot

  res@cnFillOn                   = True
  res@cnFillDrawOrder            = "PreDraw"
  res@cnLinesOn                  = False            
  res@cnLevelSpacingF            = 20.            
  res@gsnSpreadColors            = True   
  res@lbLabelAutoStride          = True
  res@pmTickMarkDisplayMode      = "Always"
  res@gsnRightString             = "hPa"
  res@gsnLeftString              = "Surface pressure in Beijing with NCL Mask"

  map4 = gsn_csm_contour_map(wks,pres,res)

;--- add shp file boundaries to test whether the border overlap---
  ShpDir = "C:/cygwin/usr/local/ncl/lib/ncarg/nclscripts/cnmap/" ;"$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/"
  cnres                       = True
  cnres@gsLineThicknessF      = 1.5
  cnres@gsLineColor           = "blue"

  getvalues map4
    "mpMinLatF" : cnres@minlat
    "mpMaxLatF" : cnres@maxlat
    "mpMinLonF" : cnres@minlon
    "mpMaxLonF" : cnres@maxlon
  end getvalues

  plotshp = gsn_add_shapefile_polylines(wks,map4,ShpDir+"county_2004.shp",cnres)

;---------------------------------------------------------------
  draw(map4)
  frame(wks)

end  


怎么把江苏以外的中国轮廓线去掉呢?
谢谢!
jiangsu.png
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2017-3-21 08:17:25 | 显示全部楼层
andrewsoong 发表于 2017-3-20 12:37
本论坛有做好的,好像在MI板块

已经解决啦!mpOutlineBoundarySets="NoBoundaries"
谢谢
密码修改失败请联系微信:mofangbao
发表于 2017-5-8 09:49:39 | 显示全部楼层
Soaring 发表于 2017-3-20 16:29
好像不对,我想画北京市具体的图,你这个好像只是为了画中国地图而描绘的每个省的大致轮廓,那每个省具体 ...

我每个省的时候shp文件。。
密码修改失败请联系微信:mofangbao
发表于 2017-10-17 16:08:06 | 显示全部楼层
Soaring 发表于 2017-3-20 21:41
你好,还有一个小问题:
begin

请问你这个.shp文件哪里找到的呢
密码修改失败请联系微信:mofangbao
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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