GMS:Importing/Exporting Shapefiles: Difference between revisions

From XMS Wiki
Jump to navigationJump to search
No edit summary
 
(23 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
{{TOCright}}
GMS has the capability to import and export shapefiles.
== Shapefile files ==
When a shapefile is saved from ArcGIS, multiple files are saved. The files are described in the following table. When the shapefile (*.shp) is imported to GMS, the database file (*.dbf) and (*.prj) files are automatically imported at the same time.


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.
{| class="wikitable"
 
!File Extension
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.
!Decription
 
|-
{| border="1" cellpadding="2" align="center"  
|<center>*.shp</center>||This file contains the geometry of the points, lines, or polygons.
!width="300"|File Extension
!width="400"|Decription
|-
|-
|<center>*.shp</center>||<center>This file contains the geometry of the points, lines, or polygons.</center>
|<center>*.dbf</center>||This is a relational database file. The properties of the feature objects are stored in this file.
|-
|-
|<center>*.dbf</center>||<center>This is a relational database file. The properties of the feature objects are stored in this file.</center>
|<center>*.shx</center>||This is an index file. It is ignored by GMS.
|-
|-
|<center>*.shx</center>||<center>This is an index file. It is ignored by GMS.</center>
|<center>*.prj</center>||Projection file [optional]. Contains the projection information for the data which GMS uses to [[Projection#Reproject_on_the_Fly|project the data on-the-fly]].
|}
|}


==Importing Shapefiles==
==Import==
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.
Shapefiles are imported to GMS using '''Open''' command in the ''File'' menu and selecting the *.shp extension. Drag-and-drop is also supported. Shapefiles are handled in GMS by the [[GMS:GIS_Module|GIS module]] and are listed in the [[GMS:Project_Explorer|Project Explorer]] under ''GIS Layers''.


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.
==Export==
GMS can export the following object types as shapefiles:


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.
*[[GMS:Feature_Objects|Feature Objects]]
*[[GMS:2D_Scatter_Point_Module|2D Scatter points]]
*[[GMS:3D_Scatter_Point_Module|3D Scatter points]]
*[[GMS:3D_Grid_Module|3D Grids]]
*[[GMS:UGrid_Module|UGrids]]
*[[GMS:TIN Module|TINs]]
*[[GMS:2D_Mesh_Module|2D Meshes]]


==Exporting Shapefiles==
The ''Export'' command can be found by right-clicking on the object in the [[GMS:Project_Explorer|Project Explorer]].
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.
===Exporting Feature Objects===
In GMS, a single coverage can contain points, nodes, arcs and polygons. Shapefiles, however, can only contain one type of attribute. Thus, when exporting a coverage as a shapefile, 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,  export the arcs to one shapefile and the points and nodes to a separate point shapefile. It is possible to 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.


With the current version of GMS, only steady state data can be exported to a shapefile. Transient properties are not saved to the file.
With the current version of GMS, only steady state data can be exported to a shapefile. Transient properties are not saved to the file.
Line 34: Line 41:
The table of attributes that is exported matches the table that is displayed in the properties dialog when editing feature objects.
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.
Currently, only one coverage at a time can be exported to shapefiles.
 
== Converting Shapefiles to Other Object Types ==
Shapefiles can be converted to the following types of objects:
 
*[[GMS:Feature_Objects|Feature Objects]]
*[[GMS:2D_Scatter_Point_Module|2D Scatter points]]
*[[GMS:3D_Scatter_Point_Module|3D Scatter points]]
*[[GMS:UGrid_Module|UGrids]]
 
===Conversion to Feature Objects===
When converting a shapefile to feature objects the [[GMS:GIS_to_Feature_Objects_Wizard|''GIS to Feature Objects Wizard'']] is used.


==Shapefile Properties==
==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.
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.
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.
Line 46: Line 64:
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.
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.
Note that the following options only work for steady state data. Transient well data can be imported using the pumping well data file formats.


{| border="1" cellpadding="2"
{| class="wikitable" style="text-align:center;"
!width="200"|Type
!Type
!width="100"|Z
!Z
!width="100"|Cond
!Cond
!width="100"|Elev
!Elev
!width="100"|Stage
!Stage
!width="100"|Flux
!Flux
!width="100"|Screentop
!Screentop
!width="100"|Screenshot
!Screenshot
!width="100"|Beginlayer
!Beginlayer
!width="100"|Endlayer
!Endlayer
|-
|-
|<center>Generic</center>||<center>X</center>|| || || || || || || ||  
|Generic||X|| || || || || || || ||  
|-
|-
|<center>Shead</center>||<center>X</center>|| ||<center>X</center>|| || || || ||<center>X</center>||<center>X</center>
|Shead||X|| ||X|| || || || ||X||X
|-
|-
|<center>Sconc</center>||<center>X</center>|| || || || || || ||<center>X</center>||<center>X</center>
|Sconc||X|| || || || || || ||X||X
|-
|-
|<center>Ghead</center>||<center>X</center>||<center>X</center>||<center>X</center>|| || || || ||<center>X</center>||<center>X</center>
|Ghead||X||X||X|| || || || ||X||X
|-
|-
|<center>Drn</center>||<center>X</center>||<center>X</center>||<center>X</center>|| || || || ||<center>X</center>||<center>X</center>
|Drn||X||X||X|| || || || ||X||X
|-
|-
|<center>Riv</center>||<center>X</center>||<center>X</center>||<center>X</center>||<center>X</center>|| || || ||<center>X</center>||<center>X</center>
|Riv||X||X||X||X|| || || ||X||X
|-
|-
|<center>Well</center>||<center>X</center>|| || || ||<center>X</center>||<center>X</center>||<center>X</center>||<center>X</center>||<center>X</center>
|Well||X|| || || ||X||X||X||X||X
|}
|}
''Point Properties For MODFLOW/MT3D Local Source/sink Coverage.''
''Point Properties For MODFLOW/MT3D Local Source/sink Coverage.''


{| border="1" cellpadding="2"
{| class="wikitable" style="text-align:center;"
!width="200"|Type
!Type
!width="100"|Z
!Z
!width="100"|Elev
!Elev
!width="100"|Stage
!Stage
!width="100"|Topelev
!Topelev
!width="100"|Botelev
!Botelev
|-
|-
|<center>Shead</center>||<center>X</center>||<center>X</center>|| || ||
|Shead||X||X|| || ||
|-
|-
|<center>Sconc</center>||<center>X</center>|| || || ||  
|Sconc||X|| || || ||  
|-
|-
|<center>Ghead</center>||<center>X</center>||<center>X</center>|| || ||
|Ghead||X||X|| || ||
|-
|-
|<center>Drn</center>||<center>X</center>||<center>X</center>|| || ||
|Drn||X||X|| || ||
|-
|-
|<center>Riv</center>||<center>X</center>||<center>X</center>||<center>X</center>|| ||  
|Riv||X||X||X|| ||  
|-
|-
|<center>Strm||<center>X</center>|| ||<center>X</center>||<center>X</center>||<center>X</center>
|Strm||X|| ||X||X||X
|}
|}
''Node Properties For MODFLOW/MT3D Local Source/sink Coverage.''
''Node Properties For MODFLOW/MT3D Local Source/sink Coverage.''


{| border="1" cellpadding="2"
{| class="wikitable" style="text-align:center;"
!width="200"|Type
!Type
!width="100"|Cond
!Cond
!width="100"|Elev
!Elev
!width="100"|Stage
!Stage
!width="100"|Beginlayer
!Beginlayer
!width="100"|Endlayer
!Endlayer
|-
|-
|Generic|| || || || ||
|Generic|| || || || ||
Line 122: Line 140:
===MODFLOW/MT3D Areal 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 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.
The following table lists the attributes that go with each flow package.


{| border="1" cellpadding="2"
{| class="wikitable"
!width="250"|Shapefile Field
!Shapefile Field
!width="300"|Meaning
!Meaning
!width="100"|LPF
!LPF
!width="100"|BCF
!BCF
!width="100"|HUF
!HUF
|-
|-
|Type||The attribute type ("Layer")||X||X||X
|Type||The attribute type ("Layer")||X||X||X
Line 177: Line 195:
===Observation 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 (ie 95 means 95% confidence). GMS will assign default values if there is any information missing.
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.


{| border="1" cellpadding="2"
{| class="wikitable"
!width="250"|Type
!Type
!width="300"|Name
!Name
!width="100"|Z
!Z
!width="100"|Layer
!Layer
!width="100"|Value
!Value
!width="100"|Int
!Int
!width="100"|Conf
!Conf
!width="100"|Stdev
!Stdev
|-
|-
|Obs||X||X||X||X||X||X||X
|Obs||X||X||X||X||X||X||X
|}
|}
''Point Properties for Observation Coverage.''
''Point Properties for Observation Coverage.''


==See also==
==See also==
Line 200: Line 217:


{{Navbox GMS}}
{{Navbox GMS}}
[[Category:Importing Data]]
[[Category:Importing Data|Shape]]
[[Category:Exporting Data|Shape]]

Latest revision as of 15:32, 29 November 2017


GMS has the capability to import and export shapefiles.

Shapefile files

When a shapefile is saved from ArcGIS, multiple files are saved. The files are described in the following table. When the shapefile (*.shp) is imported to GMS, the database file (*.dbf) and (*.prj) files are 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.
*.prj
Projection file [optional]. Contains the projection information for the data which GMS uses to project the data on-the-fly.

Import

Shapefiles are imported to GMS using Open command in the File menu and selecting the *.shp extension. Drag-and-drop is also supported. Shapefiles are handled in GMS by the GIS module and are listed in the Project Explorer under GIS Layers.

Export

GMS can export the following object types as shapefiles:

The Export command can be found by right-clicking on the object in the Project Explorer.

Exporting Feature Objects

In GMS, a single coverage can contain points, nodes, arcs and polygons. Shapefiles, however, can only contain one type of attribute. Thus, when exporting a coverage as a shapefile, 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, export the arcs to one shapefile and the points and nodes to a separate point shapefile. It is possible to 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.

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, only one coverage at a time can be exported to shapefiles.

Converting Shapefiles to Other Object Types

Shapefiles can be converted to the following types of objects:

Conversion to Feature Objects

When converting a shapefile to feature objects the GIS to Feature Objects Wizard is used.

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