NCL Home > Training > Webinars

Webinar: NCL and Shapefiles

Mary Haley
February 13, 2014

Description

This 43-minute webinar includes a brief introduction to shapefiles and how to use shapefile data in NCL plots. There are some demos of downloading and examining shapefile data from the web, and modifying an NCL plot to add shapefile outlines. There's a brief reference to using a shapefile for masking data arrays.

This webinar assumes that you are familar with creating, modifying, and running NCL graphical scripts, and that you have UNIX experience with downloading files via a web browser, and moving or copying them to other directories.

Slides as a PDF file (23 MB)

Recorded presentation as MP4 file (77 MB)

Scripts and links used or referenced in demos

  • demo_map.ncl - simple NCL map script

    [Uses the "CHN_adm0.shp" China administrative shapefile downloaded from gadm.org/country.]

  • sf_latlon.ncl - NCL script for printing four resources needed for zooming in on map

  • sf_info.ncl - NCL script for printing basic information about a shapefile

  • wrf_hgt_shapefile.ncl - NCL script for attaching shapefile outlines to WRF plot.

    [Uses the USA and Canada administrative shapefiles downloaded from gadm.org/country.]

  • multi_gadm_levels.ncl - script for creating panel plot of all shapefile administrative areas for a particular country

    [Uses the Germany administrative shapefiles downloaded from gadm.org/country]

  • mask_gadm.ncl - script that masks a 2D rectilinear grid using a country outline from gadm.org, and then plots both original and masked data in a panel plot.

    [Uses this TEST.TRMM_3B43V6_CLM.1998-2005.nc NetCDF file (4.4 MB).]

  • mask_gadm_by_name.ncl - This script is similar to mask_gadm.ncl, except it does a little more masking by using the second-level adm file (BOL_adm1.shp) and masking the data based on given list of areas of interest.

    [Uses this TEST.TRMM_3B43V6_CLM.1998-2005.nc NetCDF file (4.4 MB).]

Useful links

Places to download shapefiles

  • Natural Earth - public domain map dataset available at 1:10m, 1:50m, and 1:110 million scales

  • DIVA-GIS - free country level maps, including administrative boundaries, roads, railroads, altitude and land cover

  • Global Administrative Areas - spatial database of the location of the world's administrative boundaries

  • National Elevation Dataset (NED) - a primary elevation data product of the USGS

  • NWS provides base maps in the Advanced Weather Interactive Processing System (AWIPS)