4.2. More about Generating Surrogates using srgcreate

The srgcreate program is used to generate surrogates from weight shapefiles such as population or road shapefiles. The generate_surrogates script is provided with the software. These scripts specify:

  1. where the executables are located.
  2. where to get the shapefiles and save the resulting surrogate files.
  3. where to find the GRIDDESC file (contains grid definitions) for regular grid or egrid output format
  4. define projection and ellipsoid for data, weight, and output files.
  5. define grid name for regular grid and egrid output.
  6. define output file for egrid and polygon output format.
  7. whether to put a header line on the surrogate file.
  8. whether to include a column summing the surrogate fractions for each data polygon (used for quality assurance purposes).
  9. what files to use for the surrogate generation.
  10. what attribute to use in the data file.
  11. whether the weight shapefile needs to be filtered using a filter function to extract some shapes for surrogate computation. Detailed information of using filter function for weight shapefile is described in Section 7.3: Filtering a Shapefile.
  12. whether weight attribute function from the weight shapefile is used for surrogate computation. How to use weight function is described in Section 4.2: Computing Surrogates Using Weight Functions.
  13. what attribute to use in the weight file if no weight function is used.
  14. the name of the output shapefile containing the gridded numerator.
  15. what surrogate ID to assign to the surrogate.
  16. specify the value of a denominator threshold under which the surrogate values will not be used.
  17. commands to aggregate the individual surrogates into a single file.
  18. .

The scripts contain both mandatory and optional environment variables that control the functioning of the program. The environment variables described in the Environment Variables section that impact the functioning of the srgcreate program are the ones listed in subsections with headings that relate to surrogates. Note that the output file containing the gridded surrogate numerators is output only if the OUTPUT_FILE_NAME is set to something other than NONE. This file is output using the map projection of the output grid, egrid, or polygon.

The selection of the weight for the surrogates with the WEIGHT_ATTR_LIST variable is an important decision. For example, if you want to weight the surrogates based on the population at the census tract level, but the surrogates are created at the county level, you must specify the census tract file as your WEIGHT_FILE_NAME file and the name of the population attribute from that file as the WEIGHT_ATTR_LIST. Some important items to note are the following:

The srgcreate program generates a surrogate file ready to be used in SMOKE. On each line after the header line, the values used by SMOKE are followed by a "!" and then by the numerator, denominator, and QA sum. The format of the surrogate file is described below, and an example is provided in the file sample_srg.txt for regular grid output.

Line

Columns

Description

1

A

#GRID

B

Grid name

C

X origin in units of the projection

D

Y origin in units of the projection

E

X direction cell length in units of the projection

F

Y direction cell length in units of the projection

G

Number of columns

H

Number of rows

I

Number of boundary cells

J

Projection types:
Latitude-Longitude: “LAT-LON” or “LATGRD3”
Lambert Conformal: “LAMBERT” or “LAMGRD3”
Universal Transverse Mercator: “UTM” or “UTMGRD3”

K

Projection units

L

Projection alpha value

M

Projection beta value

N

Projection gamma value

O

X-dir projection center in units of the projection

P

Y-dir projection center in units of the projection

2+

A

Spatial Surrogates code (area) or County feature/roadway type (mobile) (Integer)

B

Country/State/County Code (integer)

C

Grid column number (Integer)

D

Grid row number (Integer)

E

Spatial surrogate ratio (area) or fraction of county feature in cell (mobile) (Real)



To Section 5.1:Creating Inputs to SMOKE Biogenic Processing