The Import Shapefile dialog box is used to import Shapefiles into GoPhast. To display the Import Shapefile dialog box, select File|Import|Shapefile...
The Shapefile format (Environmental Systems Research Institute, Inc, 1998) is a commonly used file format in Geographic Information Systems. The Shapefile will be imported as a series of objects on the top view of the model. These objects will set the values of data sets as specified by the user. The names of the imported objects will be based on the name of the file from which the objects are imported. The “Select Objects by Name Dialog Box” (p. 58) can be used to select all these objects at a later time.
After selecting the Shapefile to import, the attributes of the shapes are displayed in the Import Shapefile dialog box. The user chooses which attributes to import by checking the check box next to the name of the attribute. The user can then decide whether to create a new data set for each attribute that is imported or to assign values to existing, compatible data sets. Only data sets with an orientation of "2D Top" can be used for the imported shapes. If a new data set will be used, the user can choose an interpolation method for the new data set. (See “Interpolation Methods” on p. 22.) The user also decides whether to evaluate the objects at element or nodes and whether to set the values of enclosed elements or nodes, intersected elements or nodes, or to set values or elements or nodes by interpolation.
Some Shapefiles store the coordinates of points as latitudes and longitudes. On the coordinate conversion tab, the user can choose to convert those coordinates to Universal Transverse Mercator (UTM) coordinates. If all the points in the Shapefile belong in the same UTM zone, that zone will be picked automatically. Otherwise, the user must specify the appropriate zone number in an edit box. The user also must specify the ellipsoid used as a basis for the conversion. Normally, the default ellipsoid is appropriate. More information about coordinate conversions and map projections can be found in Snyder (1987).
Shapes in Shapefiles can contain holes inside polygons. GoPhast does not have a method of representing holes so such shapes are skipped when importing into GoPhast.
In some cases, the user may not wish to import all the shapes in a Shapefile. The Import criterion can be used to determine which shapes are imported. The user can enter a formula which will be evaluated for each shape. Only those shapes for which the formula evaluates to True will be imported. The user can click the Edit F()… button to edit the formula for the import criterion using the Formula Editor (p. 42). The following example shows how coordinate conversions and the Import criterion can be used to advantage.
In this example, only the shapes from Oklahoma will be imported from a Shapefile containing shapes for rivers throughout the United States. Oklahoma was selected for this example because example 4 from the PHAST documentation is set in Oklahoma.
![]() |
Figure 22. Imported Oklahoma
rivers. |
---|