3.5. Specifying Grids, Ellipsoids, and Map Projections

3.5.1 Specifying Grids

The spatial allocator programs srgcreate, allocator, and beld3smk use the Input/Output Applications Programming Interface (I/O API) grid description (GRIDDESC) file to specify the input and output grids to be used. The GRIDDESC file contains both map projection and grid description information. Click to see a sample GRIDDESC file. The GRIDDESC file is part of the EDSS Models-3 I/O API; see the I/O API web pages for more information. Note that the I/O API assumes that the earth's ellipsoid is a sphere.

The map projection information in the GRIDDESC file consists of five descriptive parameters: PROJ_ALPHA, PROJ_BETA, PROJ_GAMMA, X-CENT, and Y-CENT. These parameters are dependent upon Projection Types in GRIDDESC File.  The projection section of the GRIDDESC file must start with the following line of text:


! coords --line: name; type, P-alpha, P-beta, P-gamma, xcent, ycent

The grid description section of the GRIDDESC file follows the projection section.  The following line of text must be included to show the separation between the two sections:


' ' ! end coords. grids: name; xorig,yorig,xcell,ycell,ncols,nrows,nthik

Definitions of regular grids require four descriptive parameters and three dimensioning parameters in addition to the specification of a map projection:

The grid information section ends with the following text:


' ' ! end grids

3.5.2 Map Projection and Ellipsoid Specification

Map projections are the mathematical 2-D representations of the spherical surface of the Earth that are shared by the emission and air quality models. Map projections are needed because the round Earth is being displayed on, and computatoins are performed for, a flat two-dimensional space. There are many different techniques or types of map projections used in modeling. The Spatial Allocator uses the PROJ4.6.0 library (PROJ4 Website) for map projection computations (including the ellipsoid that is assumed to represent the Earth) and also for datum transformations. A datum may be spherical, as is assumed by many air quality models, or it may be ellipsoidal, as is assumed by many of the geographic data sets that are available as shapefiles and otherwise. If you wish to overlay one geographic data set with another and they do not assume the same datum, a data transformation should be performed to make the data sets consistent.

The Proj4.6.0 library is stored under the SA source code directory ($SA_HOME/src/libs). The PROJ4.6.0 library is used by the srgcreate and allocator programs to specify map projections and ellipsoids. NOTE: this new library supports datum transformation, but the old map projection called LATLON is no longer accepted, nor is the ellipsoid called SPHERE. The library is stored under the source code directory $SA_HOME/src. In order for the datum transformation functions to find the proper transformation files, users must set the environmental variable PROJ_LIB to $SA_HOME/src/PROJ4.6.0/local/share/proj in their .cshrc files on unix or otherwise set PROJ_LIB to the directory as an environment variable. PROJ_LIB lets the system know where the PROJ4.6.0 shared libraries are installed, so that it can find all files needed for datum transformation.

Different environment variables are used to specify the map projection depending on the context of how the geographic data set is to be used (e.g. DATA_FILE_MAP_PRJN, WEIGHT_FILE_MAP_PRJN, INPUT_FILE_MAP_PRJN, and OUTPUT_FILE_MAP_PRJN). You must specify map projections for any geographic data that are input or output by the SA. Information on specifying map projection parameters for particular map projections that are available in the PROJ4.6.0 library can be found at the bottom of the Projection List webpage. The projection parameters should start with "+proj=" and the parameters should be in a comma-separated list without white space. For example, to use a Lambert Conformal conic projection with standard parallels of 33 and 45 degrees, a central latitude of 40 degrees, and a central longitude of -97 degrees as the projection for data polygons, use the following syntax:

   setenv INPUT_FILE_MAP_PRJN "+proj=lcc,+lat_1=33,+lat_2=45,+lat_0=40,+lon_0=-97"



To specify a UTM projection for zone 17 for the weight polygons, use the following syntax:

   setenv WEIGHT_FILE_MAP_PRJN "+proj=utm,+zone=17"

To specify a geographic latitude and longitude data for the data polygons, use the following syntax:

   setenv DATA_FILE_MAP_PRJN "+proj=latlong"

Note: In the UNIX C-shell, quotes are needed to specify the map projection line above. For consistency, all examples use quotes.

The Spatial Allocator allows the user to set the shape of the Earth independently for data, weight, and output polygons with the (INPUT/WEIGHT/OUTPUT)_FILE_ELLIPSOID environment variables. The ellipsoid for the spatial coordinate system has to be specified correctly when datum transformation is involked in projection coversion for two different ellipsoids.

To specify an ellipsoid, you must specify either

More information on these parameters is available from http://www.remotesensing.org/geotiff/spec/geotiff2.5.html.
A plus sign must precede either the name of the Earth shape or each ellipsoidal parameter.  When supplying multiple parameters, the list must be comma separated without any white space between the parameters. For example, you could specify the MERIT spheroid using the following syntax:

   setenv WEIGHT_FILE_ELLIPSOID=+ellps=MERIT 

A list of Datum Specifications which can be used in datum transformation and a list of Named Ellipses are available. You may specify the ellipsoid parameters as shown in the following examples:

For the Weather Research and Forecasting Model (WRF) sphere:
   setenv WEIGHT_FILE_WLLIPSOID "+a=6370000.0,+b=6370000.0"

For the Fifth Generation Mesoscale Model (MM5) sphere:
   setenv WEIGHT_FILE_ELLIPSOID "+a=6370993.0,+b=6370993.0"

For a North American Datum of 1983 (NAD83) datum shapefile:
   setenv WEIGHT_FILE_ELLIPSOID "+datum=NAD83"

For a Godetic Reference System 1980 GRS80 spheroid: 
   setenv WEIGHT_FILE_ELLIPSOID "+ellps=GRS80"

Note: There is no automatic datum transformatoin when projecting between a sphere and a datum (e.g., +a=6370000.0,+b=6370000.0 to =+datum=NAD83) starting with PROJ4 version 4.6.0. This method is consistent with WRF and MM5 geopreprocessing methods that also do no datum transformation between a perfect sphere and the World Geodetic System 1984 (WGS84) datum. Since the NAD83 datum is very similar to the WGS84 datum (with only a few meters of offset), they are treated the same in the SA. You must ensure that your shapefiles are in either NAD83 or WGS84 datum projections when using the SA in order to be consistent with the typical meteorological and air quality modeling spatial data. If a shapefile is defined as a sphere, you must make sure that it was projected to the sphere from NAD83 or WGS84 with no datum transformation (like the EPA emission shapefile), to avoid potential grid distortion issues.


To Section 4: Surrogate Computation and Quality Assurance Summary