The Import Shapefile dialog box is used to import Shapefiles into ModelMuse. 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. Other types of geographic information can be converted to Shapefiles using GIS software. Two free GIS program are QGIS https://www.qgis.org and MapWindow https://www.mapwindow.org/.
The Shapefile is imported either as a series of objects or a single object with multiple sections on the top view of the model. ModelMuse can usually handle a single object with multiple sections more efficiently than multiple objects. However, in some cases, the shapes can only be imported as multiple objects. The imported object(s) will set the values of data sets or define boundary conditions as specified by the user. The names of the imported object(s) are based on the name of the file from which the objects are imported. The Select Objects by Name dialog box can be used to select all these objects at a later time.
After selecting the Shapefile to import, the Options 1 tab of the Import Shapefile dialog box is displayed. The user decides whether to set the values of enclosed elements, nodes, or cells; intersected elements, nodes, or cells; or to set values or elements, nodes, or cells by interpolation. In PHAST and SUTRA models, the user decides whether to evaluate the objects at element or nodes. After being imported, the shapes can either be selected, visible but not selected (the default), or hidden. If there are a very large number of objects to be imported, it may be best to have the objects be hidden when they are imported.
The imported objects can have zero, one, or two associated Z-dimension formulas. To edit these formulas with the Formula Editor, the user can click the Edit()... button next to the formula.
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 next to the formula to edit the formula for the import criterion using the Formula Editor. The example at the end of this topic shows how the Import criterion can be used to advantage.
The following, more rarely used options can be selected on the Options 2 tab.
By default, the names of the imported objects are based on the name of the Shapefile from which they are imported. However, the user can elect to use a one of the text attributes of the Shapes in the Shapefile. This is most useful when each object has a unique identifier.
Some Shapefiles can have a measured value or a z value for each vertex of each shape. If present, these can be imported by checking the Import Z coordinate and slope for each point or Import measured value for each point checkboxes. The z and measured values will be imported as vertex values. If Z coordinates are imported, ModelMuse will also compute a slope for each point and import those as vertex values too. (See Vertex Values dialog box.)
If the Position Locked checkbox is checked, it will be impossible to accidentally drag the imported objects to new positions. This restriction can be changed in the Object Properties dialog box.
The user can elect to convert the length units of the X and Y coordinates from any of the commonly used length units to other units. By default, this option is not selected. This option is only useful when the only difference in the projection used in the Shapefile is consistent with the data in ModelMuse except for the length units. Converting the length unit does not result in the conversion of any imported value.
The attributes of the shapes are displayed in the Data tab of the Import Shapefile dialog box. The user chooses which attributes to import by checking the checkbox 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 "2-D Top" can be used for the imported shapes. The user can choose an interpolation method for any new or existing data set for which objects will be imported. (See Interpolation Methods)
Shapefiles can have a maximum of 255 attributes. In some cases, it may be desirable to have more attributes than that. The user can use "comma-separated value" files to supply additional attributes. This is done by specifying the name or names of comma-separated value files on the CSV (Optional) tab. The comma-separated value files must have a specific structure. The first line must contain labels for the attributes. The labels must start with a letter and contain only letters, digits, and the underscore character "_." Labels are not allowed to repeat even if they are in different files. Each label must be separated from the next by a comma and (optionally) by one or more space characters. Each successive line must contain exactly as many values as there are labels. There must be one such line for each shape in the shape file including "null" shapes. The order of the rows in the CSV file must be the same as the order of the shapes in the Shapefile. If you do not know the order of the shapes in the Shapefile, you may be able to determine the order by examining the attributes of the Shapefile in a database program. The attributes are stored in the .dbf file that is part of the Shapefile. Another way to determine the order of the shapes is to assign each a unique attribute value and then import the shapes using that attribute to determine the names of the imported objects. You could then use Object|Edit|Rearrange Objects to view the order of the objects.
By default, all values in CSV files are assumed to be real numbers. However, if other types of data are included, in the CSV file, this can be indicated by selecting "Label indicates field type" at the bottom of the CSV tab. If this option is selected, the first character of a label name is used to indicate the data type. "D", "R", "d", and "r" (for double and real) indicate real numbers. "I" and "i" indicate an integer. "B" and "b" indicate Boolean data. "T" and "t" indicate text. Any other first character will be treated as indicating a real number.
If the user wishes to use imported Shapefiles to set the values of a 3-D data set, the user can define a separate 2-D data set for each layer group, use the default formula of the 3-D data set to link it to the 2-D layer groups and import a separate Shapefile for each layer group. For example, the user could define 2-D data sets named Kx1, Kx2, and Kx3 to define the hydraulic conductivity in layer groups 1, 2, and 3 respectively. An appropriate default formula for the Kx data set in this case would be "CaseR(Layer, Kx1, Kx2, Kx3)."
The Features tab is used to specify that the imported shapes will specify boundary conditions or other similar features. The Features tab is only visible when it is possible to define model features with the imported shapes. At the top of the Features tab, the user chooses what type of model feature to define using the Feature choice combo box. The user can then enter the number of times periods desired for the imported objects using the Number of times edit box. In the table, either types a constant value that will apply to all the imported objects or selects the shape attributes that will define the properties of the feature. Additional controls may appear beneath the table. These are used to define properties of the features that do not vary with time. Some types of features can only be imported as separate objects. These include streams (SFR package), multinode wells (MNW2 package), lakes (LAK package) head observations (HOB package) and pipes in the Conduit Flow Process (CFP). If the SSM Sink and Source Mixing package in MT3DMS is selected, the concentrations associated with a particular sink and source packages can be imported as part of the sink and source package. When importing head observations, the user can specify a value that represents missing data. If either the observation time or observed head is that value, those values will not be imported.
Some model features are specified using text variables. In such cases, the user can either choose a value that will apply to all the shapes or select a text attribute that has a value that matches one of the predetermined choices for that feature. For example in the Multi-Aquifer Well (MAW) package in MODFLOW 6, the user can either select SPECIFIED, THIEM, SKIN, CUMULATIVE, or MEAN for the conductance equation or select a text attribute that has values corresponding to those choices.
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).
The following example illustrates the use of the Import criterion and coordinate conversions. The Import criterion will be used to select 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. The data in the Shapefile are in decimal degrees. These coordinates will be converted to UTM coordinates.
1.The National Atlas of the United States (https://nationalatlas.gov/atlasftp.html#hydrogm) has a Shapefile that represents the major streams and water bodies in the United States. Download the Shapefile version of that data (hydrogm020.tar.gz) and extract its contents.
2.In ModelMuse, select File|Import|Shapefile… and then select hydrogl020.shp which was extracted from hydrogm020.tar.gz.
3.After the Shape geometry file has been read, the Import Shapefile dialog box will be displayed. Go to the Coordinate Conversion tab and check the checkbox labeled Convert coordinates from decimal degrees to UTM. Change the UTM zone number to 14. This is the appropriate UTM zone for Oklahoma.
4.Go to the Data tab and change the Import criterion to
Pos("OK," UpperCase(STATE)) > 0.
STATE is one of the attributes of the Shapefile. It holds abbreviations for the state or states in which each water body is present. This formula evaluates to true if the water body is in the state of Oklahoma (abbreviation = “OK”). The user can choose which attributes to import by selecting them at the top of the Data tab and clicking the OK button. For an explanation of the attributes in the Shapefile, see the file hydrogm020.txt that came with the Shapefile.
5.After the shapes have been imported, select Navigation|Go To… and select the first imported shape. Then zoom out to see all the imported water bodies. Only shapes that are at least partially in Oklahoma will have been imported, and their coordinates will have been converted to UTM coordinates (fig. 26).
Figure 26. Imported Oklahoma water bodies.
See also:
•Export Grid/Mesh Data to Shapefile dialog box
•Export Objects to Shapefile dialog box
•Export Pathlines to Shapefile
•Export Endpoints at Starting Locations to Shapefile
•Export Endpoints at Ending Locations to Shapefile