1. Introduction

ESRI Shapefiles are one of the recognised Feature Collection file formats in GPlates. Loading a feature collection from a Shapefile follows the same procedure as any other feature data file - see the Loading and Saving chapter.

2. Shapefile attributes

Shapefile attributes can contain meta-data associated with the geospatial data. This data could specify, for example, the feature’s reconstruction plateID, or the times of appearance and disappearance of the feature. GPlates allows you to specify which shapefile attribute field names will be associated with GPlates feature properties, such as the reconstruction plateID. GPlates records this information on disk so that in subsequent GPlates sessions the last used association will be loaded by default. You can change this association at any time during a GPlates session.

2.1. Mapping shapefile attributes

The first time a shapefile has been loaded, you will see the Map Shapefile Attributes dialog.

screenshots/MapShapefileAttributes.win32.png

This dialog allows the user to select which shapefile attribute fields will be associated with GPlates feature properties. The feature properties are listed on the left-hand side of the dialog.

Feature property Explanation Expected values
PlateID The reconstrution plateID for the feature Integer
Feature type The type (e.g. Coastline, COB) of the feature Two letter code
Begin The time of appearance of the feature Numerical
End The time of disappearance of the feature Numerical
Name The name of the feature Text
Description A description of the feature Text

Alongside each feature property is a drop-down box showing the name of the shapefile attribute field which will be associated with the feature property. You can use the drop-down boxes to change the shapefile attribute fields which you want to associate with each feature property.

screenshots/MapShapefileAttributes-Combobox.win32.png

By default GPlates will look for certain shapefile attribute field names, and will initialise the drop-down boxes with the following values:

Feature property Default attribute field name
PlateID PLATEID
Feature type TYPE
Begin FROMAGE
End TOAGE
Description DESC

If the default field name for a feature property cannot be found in the shapefile, the drop-down box will be initialised with <none>.

Once you have selected the mapping you want, clicking OK will load the shapefile.

2.2. Recording the mapping

Once a mapping has been selected, GPlates records this information on disk. If the shapefile was called mydata.shp, the mapping information will be stored in the same folder in a file called mydata.shp.gplates.xml. The next time a user loads mydata.shp, GPlates will look for the file mydata.shp.gplates.xml. If this mapping file is found, GPlates will use the mapping contained in it, and will not force the user to use the Map Shapefile Attributes dialog.

2.3. Changing the mapping

The mapping can be reset at any time during a GPlates session.

To reset the mapping for a feature collection:
  1. Open the Manage Feature Collections dialog (Ctrl+M) screenshots/ManageFeatureCollections.win32.png

  2. Select the File Properties icon spanner.png for the file whose mapping you want to change.

  3. The Re-map Shapefile Attributes dialog will appear; this behaves in the same way as the Map Shapefile Attributes dialog described above.
    screenshots/MapShapefileAttributes-Remap.win32.png

  4. When you have selected the fields for your mapping, click OK.

Note Re-mapping the shapefile attributes will update the *.shp.gplates.xml file on disk.

2.4. Viewing Shapefile attributes

Shapefile attributes can be viewed in two ways:

  • For an entire feature collection.

  • For individual features in a feature collection.

To view shapefile attributes for a feature collection
  1. Go to the Features Menu in the menu bar.

  2. Scroll down to View Shapefile Attributes

  3. The Shapefile Attributes dialog will appear.

screenshots/ViewShapefileAttributes.win32.png

The shapefile attribute field names are displayed at the top of each column. Each row of the table corresponds to a single feature in the feature collection, and displays the attribute values for that feature. If there is more than one shapefile feature collection loaded, you can use Feature Collection drop-down box at the top of the dialog to select the feature collection whose attributes you want to view.

To view shapefile attributes for a single feature

Shapefile attributes for a single feature can be viewed through the Query Feature Properties dialog - see the Interacting with Features chapter.

2.5. Editing Shapefile attributes

Shapefile attributes can be edited through the Edit Feature Properties dialog - see the Interacting with Features chapter.

Note Only the value of shapefile attributes can be edited. Field names and field types cannot be edited.
Note You cannot create new shapefile attribute fields or delete existing shapefile attribute fields.

3. More about the Shapefile format

The ESRI Shapefile format is a file format allowing storage of geospatial vector graphics data and metadata. An ESRI Shapefile is a collection of (at least) 3 files with file extensions ".shp", ".shx" and ".dbf". A shapefile called mydata will consist of the files:

 mydata.shp
 mydata.shx
 mydata.dbf

The geospatial data are stored in the ".shp" and ".shx" files; the meta-data (attributes) are stored in the ".dbf" file. When loading a shapefile feature collection, you only need to select the ".shp" file; the ".shx" and ".dbf" files are loaded automatically. The file filter used in the Open Feature Collection dialog will show only the ".shp" form of shapefiles.

The ESRI shapefile specification can be downloaded from http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf.