爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 56631|回复: 83

中国shp格式底图,河流,省界,市界

  [复制链接]
发表于 2014-4-13 15:27:59 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 黄小仙儿 于 2014-4-13 16:24 编辑

从地理信息网上下的,需要的人可以来下
添加底图的例子可以参考NCL的shapefiles板块

这是链接http://www.ncl.ucar.edu/Applications/shapefiles.shtml这个是官网上wrf数据的例子,大家可以先参考一下
;----------------------------------------------------------------------
; This is a basic NCL template for creating contours over maps using
; WRF data, and attaching shapefile outlines. This template plots one
; timestep of HGT from a WRF file, and attaches shapefile outlines
; from the "USA_adm2.shp" and "CAN_adm2.shp" shapefiles, downloaded
; from http://www.gadm.org/country/
;----------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin
  filename = "wrfout_d01_2002-07.nc"
  a        = addfile(filename,"r")

  ter = a->HGT(0,:,:)                        ; Read the variable to memory

  wks = gsn_open_wks("x11","wrf_hgt_shapefile")
  gsn_define_colormap(wks,"OceanLakeLandSnow")  ; Change color map

  res                   = True               ; Use basic options for this field
  res@cnFillOn          = True               ; Create a color fill plot
  res@ContourParameters = (/1,1100,20/)

  contour = wrf_contour(a,wks,ter,res)

  pltres            = True   ; Set plot options
  pltres@PanelPlot  = True   ; Tells wrf_map_overlays not to remove contours

  mpres             = True   ; Set map options
  mpres@mpOutlineOn = False
  mpres@mpFillOn    = False

;---Create the contours over the WRF map (nothing will be drawn yet).
  plot = wrf_map_overlays(a,wks,contour,pltres,mpres)

;---Attach the shapefile polylines using files read off gadm.org/country.
  usa_shp_name    = "USA_adm/USA_adm2.shp"
  canada_shp_name = "CAN_adm/CAN_adm2.shp"

  lnres                  = True
  lnres@gsLineColor      = "gray25"
  lnres@gsLineThicknessF = 0.5   
  usa_id = gsn_add_shapefile_polylines(wks,plot,usa_shp_name,lnres)
  can_id = gsn_add_shapefile_polylines(wks,plot,canada_shp_name,lnres)

  draw(plot)       ; This will draw the map and the shapefile outlines.
  frame(wks)       ; Advance the frame

end
还有这个是ncl对grib,hdf,wrf数据处理及格式的讲解pdf,需要的也可以下载看看


China.zip

31.22 MB, 下载次数: 3737, 下载积分: 金钱 -5

Grib_Hdf_Wrf.pdf

120.03 KB, 下载次数: 210, 下载积分: 金钱 -5

评分

参与人数 1金钱 +12 贡献 +3 收起 理由
mofangbao + 12 + 3

查看全部评分

密码修改失败请联系微信:mofangbao
发表于 2015-3-28 16:22:14 | 显示全部楼层
为什么每次都提示.SHP文件打不开。。。
密码修改失败请联系微信:mofangbao
回复 支持 3 反对 0

使用道具 举报

发表于 2014-4-13 16:06:54 | 显示全部楼层
顶~~~PS:要是把你自己的NCL脚本例子和画的图放上就更好了~~~
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-4-13 16:09:39 | 显示全部楼层
andrewsoong 发表于 2014-4-13 16:06
顶~~~PS:要是把你自己的NCL脚本例子和画的图放上就更好了~~~

恩,我现在添加了地区界的底图,但是省界那里是空的。不知道怎么在一张图上即设置省界,也设置市界。
现在还在请教其他人,等我把这个弄好了,就贴上来
密码修改失败请联系微信:mofangbao
 楼主| 发表于 2014-4-13 16:10:54 | 显示全部楼层
这个是官网上wrf数据的例子,大家可以先参考一下
;----------------------------------------------------------------------
; This is a basic NCL template for creating contours over maps using
; WRF data, and attaching shapefile outlines. This template plots one
; timestep of HGT from a WRF file, and attaches shapefile outlines
; from the "USA_adm2.shp" and "CAN_adm2.shp" shapefiles, downloaded
; from http://www.gadm.org/country/
;----------------------------------------------------------------------
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"

begin
  filename = "wrfout_d01_2002-07.nc"
  a        = addfile(filename,"r")

  ter = a->HGT(0,:,:)                        ; Read the variable to memory

  wks = gsn_open_wks("x11","wrf_hgt_shapefile")
  gsn_define_colormap(wks,"OceanLakeLandSnow")  ; Change color map

  res                   = True               ; Use basic options for this field
  res@cnFillOn          = True               ; Create a color fill plot
  res@ContourParameters = (/1,1100,20/)

  contour = wrf_contour(a,wks,ter,res)

  pltres            = True   ; Set plot options
  pltres@PanelPlot  = True   ; Tells wrf_map_overlays not to remove contours

  mpres             = True   ; Set map options
  mpres@mpOutlineOn = False
  mpres@mpFillOn    = False

;---Create the contours over the WRF map (nothing will be drawn yet).
  plot = wrf_map_overlays(a,wks,contour,pltres,mpres)

;---Attach the shapefile polylines using files read off gadm.org/country.
  usa_shp_name    = "USA_adm/USA_adm2.shp"
  canada_shp_name = "CAN_adm/CAN_adm2.shp"

  lnres                  = True
  lnres@gsLineColor      = "gray25"
  lnres@gsLineThicknessF = 0.5   
  usa_id = gsn_add_shapefile_polylines(wks,plot,usa_shp_name,lnres)
  can_id = gsn_add_shapefile_polylines(wks,plot,canada_shp_name,lnres)

  draw(plot)       ; This will draw the map and the shapefile outlines.
  frame(wks)       ; Advance the frame

end
密码修改失败请联系微信:mofangbao
发表于 2014-4-13 16:14:42 | 显示全部楼层
黄小仙儿 发表于 2014-4-13 16:09
恩,我现在添加了地区界的底图,但是省界那里是空的。不知道怎么在一张图上即设置省界,也设置市界。
现 ...

密码修改失败请联系微信:mofangbao
发表于 2014-4-14 11:06:47 | 显示全部楼层
谢谢分享   
密码修改失败请联系微信:mofangbao
发表于 2014-4-15 15:10:49 | 显示全部楼层
非常好,学习中
密码修改失败请联系微信:mofangbao
发表于 2014-4-22 08:51:17 | 显示全部楼层
这个怎么用啊,摸索一下!!!!
密码修改失败请联系微信:mofangbao
发表于 2014-6-24 19:04:13 | 显示全部楼层
呵呵,学习学习
密码修改失败请联系微信:mofangbao
发表于 2014-6-26 16:50:26 | 显示全部楼层
感谢楼主!
密码修改失败请联系微信:mofangbao
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

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

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