Rasterize: Using Shape File Polygons to Select Countries and States


Syntax:

Field
dup [T]average
Features
objectid number VALUE
.the_geom
rasterize
0 maskle
dataflag
/missing_value 0 def
mul

Examples:

  • Plotting precipitation over the U.S. Figure
  • Plotting precipitation over CA Figure
  • Troubleshooting:

    1. There are multiple types of shape data (Countries, Level 1 entities, etc) and old datasets ESRI (2002-2008) and GAUL (2012-2015):

    Shape Files

    2. How do we know the object numbers? This can take some digging. Use your browser's search function on:

    country names for ESRI

    state names for ESRI

    3. Rasterize only works on iridl. If you need to cut a shape out of a file on another machine make a mask on iridl with same resolution as your target data.

    4. Both X and Y need to be evenly spaced grids or rasterize can fail.