GMS:Importing/Exporting Shapefiles

From XMS Wiki
Revision as of 17:16, 6 November 2013 by Jcreer (talk | contribs)
Jump to navigationJump to search


The data model used for feature objects (points, nodes, vertices, arcs, polygons) was patterned after the vector GIS data model used in Arc/Info and ArcView. As a result, feature objects can be imported from Arc/Info or ArcView into GMS or exported from GMS to either Arc/Info or ArcView using shapefiles. A shapefile is a binary file used to store points, arcs, and polygons. Each object type is typically saved to a separate shapefile.

When a shapefile is saved from ArcView or Arc/Info, three files are saved. The files are described in the following table. When the shapefile (*.shp) is imported to GMS, the database file (*.dbf) is automatically imported at the same time.

File Extension Decription
*.shp
This file contains the geometry of the points, lines, or polygons.
*.dbf
This is a relational database file. The properties of the feature objects are stored in this file.
*.shx
This is an index file. It is ignored by GMS.

Importing Shapefiles

Shapefiles are imported to GMS using Open command in the File menu and selecting the *.shp extension. A dialog comes up that prompts the user whether to import the shapefile as a scatter set or feature objects.

If the scatter set option is selected and the file must is a point file, the points are imported. If the option selected is Feature Objects, the Map Shapefile Properties Dialog appears. The list of coverage attributes in the top right portion of the dialog are the properties for the current GMS coverage type. The list of database fields in the top left portion of the dialog are the properties that GMS found in the specified shapefile. The bottom portion of the dialog shows how the shapefile properties will be mapped to the GMS coverage properties. GMS will attempt to automatically set up the mapping by looking for shapefile attribute names that match the names of the GMS coverage properties. The user can manually change the attribute mapping using the Map and Unmap buttons. Database fields that are not mapped will be ignored by GMS.

The order for importing is first polygons, then arcs, then points. For example, when importing both an arc and a node shapefile, it is important to import the arc shapefile first. The properties that a node can have depend on the arcs it is attached to so GMS must find the arcs attached to nodes being imported. The points on the arcs need to be nodes and not vertices for GMS to match them up. That is, the points on the arcs that correspond with the points being imported in the point shapefile must be nodes, not vertices. Even if they're in the exact same location, GMS won't match them up if they're vertices, only if they're nodes.

With the current version of GMS, only steady state data can be imported from a shapefile. Transient properties are not supported. Transient well data can be imported using a Pumping Well Data file. Transient observation point data can be imported using a Tabular Obersvation Point file.

Exporting Shapefiles

GMS feature objects are saved to shapefiles by right-clicking a coverage in the Project Explorer and using the Export command. Saving shapefiles brings up the Export Shapefile dialog. The Export Shapefile dialog shows the path and filename where the shapefile will be saved. In GMS, a single coverage can contain points, nodes, arcs and polygons. Shapefiles, however, can only contain one type of attribute. Thus, GMS can export up to three shapefiles depending on the type of objects in the GMS coverage. For example, if the GMS coverage contains arcs, points and nodes, the user can export the arcs to one shapefile and the points and nodes to a separate point shapefile. The user can control which shapefiles GMS will create when more than one is possible. The names for the shapefiles come from the prefix listed at the top of the dialog, appended with "_pts" for the point shapefile, "_arcs" for the arc shapefile, and "_polys" for the polygon shapefile.

The Export Shapefile dialog allows the user to specify the format of fields containing floating point numbers in the shapefile. The total width of the field and the number of digits to the right of the decimal can be specified. All float fields in the shapefile will be formatted according to these settings.

With the current version of GMS, only steady state data can be exported to a shapefile. Transient properties are not saved to the file.

The table of attributes that is exported matches the table that is displayed in the properties dialog when editing feature objects.

Currently, you can only export one coverage at a time to shapefiles.

Shapefile Properties

The tables below indicate how GMS imports and exports shapefile properties. A "type" field must exist as an attribute when importing so GMS knows what kind of attribute to assign to the object. If the "type" field is not found, GMS will import the objects as generic objects without properties and the Map Shapefile Properties dialog will not appear.

A single shapefile may contain objects with different attribute types. Different attribute types require different fields, as shown in the tables. The X's in the table indicate which fields correspond with which attribute types. GMS writes -999 to empty cells when exporting because shapefiles have no way of flagging "null" or "no data" fields. If a field is not required based on the attribute types of the objects to be exported, the field will not be included.

GMS only supports importing of steady state data (one moment in time) from shapefiles.

MODFLOW/MT3D Local Sources Sinks Coverage

For MODFLOW/MT3D local source/sink coverages, if a node is attached to more than one arc, it can have more than one attribute type. When GMS exports these nodes, it exports one node for every attribute type the node has. So the shapefile might end up with several points in the same location, each with different properties. When importing, GMS will resolve all nodes found in the same location to one node and assign the node the union of the properties of all the nodes.

Note that the following options only work for steady state data. Transient well data can be imported using the Pumping Well Data File formats.

Type Z Cond Elev Stage Flux Screentop Screenshot Beginlayer Endlayer
Generic
X
Shead
X
X
X
X
Sconc
X
X
X
Ghead
X
X
X
X
X
Drn
X
X
X
X
X
Riv
X
X
X
X
X
X
Well
X
X
X
X
X
X

Point Properties For MODFLOW/MT3D Local Source/sink Coverage.

Type Z Elev Stage Topelev Botelev
Shead
X
X
Sconc
X
Ghead
X
X
Drn
X
X
Riv
X
X
X
Strm
X
X
X
X

Node Properties For MODFLOW/MT3D Local Source/sink Coverage.

Type Cond Elev Stage Beginlayer Endlayer
Generic
Shead X X X
Sconc X X
Ghead X X X X
Drn X X X X
Riv X X X X X

Polygon Properties for MODFLOW/MT3D Local Source/sink Coverage.

MODFLOW/MT3D Areal Coverage

The fields exported for MODFLOW/MT3D layer coverages depend on what properties are defined for the polygons. They also depend on which flow package (LPF, BCF or HUF) is selected in the Coverage Properties dialog. Similarly when importing GMS looks for the appropriate fields based on the selected flow package.

The following table lists the attributes that go with each flow package.

Shapefile Field Meaning LPF BCF HUF
Type The attribute type ("Layer") X X X
Topelev Top Elevation X X X
Botelev Bottom Elevation X X X
Trans Transmissivity X
Kh Horizontal hydraulic conductivity X X
KV Vertical hydraulic conductivity X
Leak Leakance X
Hanis Horizontal Anisotropy X
Vanis Vertical Anisotropy X
Specstore Specific storage X
Specyield Specific yield X
Pstore Primary storage coefficient X
Sstore Secondary storage coefficient X
Wetdry Wet/dry flag X X X
Zonecode Zone code X X X
Porosity Porosity X X X
Longdisp Longitudinal dispersivity X X X
Bulkdens Bulk density X X X
Imporosity Immobile porosity X X X
Material Material X

Polygon Properties for MODFLOW/MT3D Layer Coverage.

Observation Coverage

When importing shapefiles into an observation coverage, information should exist in the Int (interval) and Conf (confidence) fields, or in the Stdev (standard deviation) field but not both. The confidence value should be an integer between 0 and 100 (i.e., 95 means 95% confidence). GMS will assign default values if there is any information missing.

Type Name Z Layer Value Int Conf Stdev
Obs X X X X X X X

Point Properties for Observation Coverage.

See also