You are here: Popular Formats > Esri Shapefile Reader/Writer > Feature Representation

Esri Shapefile Feature Representation

In addition to the generic FME feature attributes that FME Workbench adds to all features (see About Feature Type Attributes), this format adds the format-specific attributes described in this topic.

Shapefile features consist of geometry, a special predefined attribute, and a set of user-defined attributes. All shapefile features have one predefined attribute, SHAPE_GEOMETRY, which identifies the type of the feature's geometry.

Geometry types can be two-dimensional (2D), 2D plus elevations, 2D plus measures, 2D plus elevations and measures, or 3D:

Attribute Name

Contents

SHAPE_GEOMETRY

The type of the geometry read from the shapefile. This attribute will contain one of:

  • shape_point
  • shape_multipoint
  • shape_polyline
  • shape_polygon
  • shape_null
  • shape_multipatch

Default: No default

shape_measures

This is present for features that have measures when reading only if the Navigator reader parameter Treat Measures as Elevation is not specified or is set to No.

To write measures using this attribute, make sure the Navigator writer parameter Treat Measures as Elevation is not specified or is set to No, and simply build this list with one value for each vertex in the feature being written.

This is a comma-separated list of floating values which correspond to the vertex measures. The first value is for the first vertex, second for the second, and so on. NaN (Not a Number) values are represented by the string NaN.

Shapefile writer feature types can specify an additional SHAPE_GEOMETRY type, which is shape_first_feature. If shape_first_feature is set as the feature type geometry, the writer extracts geometry information from the first feature encountered, and (since shapefiles cannot contain multiple geometries) sets all subsequent features to this particular geometry.

shape_first_feature is set as the default geometry for a Shapefile writer feature type, unless the writer is created through generating a workspace, or if the writer schema definition was copied from a Shapefile reader.

A shapefile defines a set of features that share the same geometry type and the same list of user-defined attributes. In other words, all features belonging to the same shapefile have the same value for the SHAPE_GEOMETRY attribute and the same list of user-defined attributes. The values of the user-defined attributes can vary from feature to feature within the same shapefile. The geometry type and the names of the user-defined attributes for an individual shapefile are specified in the feature type parameters for that shapefile. The feature type of a shapefile feature is the same as the baseName specified in the feature type name.

When reading shapefile features, the SHAPE_GEOMETRY attribute will correspond to the geometry type specified in the feature type parameters for that shapefile. When writing shapefile features, the SHAPE_GEOMETRY attribute is not required and will be ignored if it is present because the geometry type is taken from the feature type parameters for the Shapefile. If the feature being written out cannot be converted into the geometry type specified in the feature type parameters , this feature will not be written out and the log window will display a warning message. (This will happen if, for example, you try to write an area feature into a point geometry file.)

There is one exception where the geometry type indicated in the feature type parameters may not be the type of file that is actually created. If the feature type indicates that a point file is to be created, but the first actual feature written to that file is instead a multipoint, a multipoint file will be created instead. (The same is true for pointz/multipointz and pointm/multipointm files.)

Note: As of Esri ArcGIS Desktop 9.3, shapefiles of type shape_null are no longer valid. Any feature type parameters with SHAPE_GEOMETRY set to shape_null will be output instead as shape_point.

Polyline and Polygon Features

When reading a polyline feature with multiple parts, the FME representation consists of an aggregate of lines. Similarly, when reading a polygon feature with multiple parts, the FME representation consists of an aggregate of polygons.

Conversely, when writing aggregates of lines or polygons, FME will output multi-part polyline and polygon shapefile features.

3D Polygon or Multipatch Geometry Types

When providing 3D data to the Shapefile writer, the 3D polygon or multipatch geometry types can either split or preserve the 3D geometries. By default, 3D surfaces and solids are mapped to multipatches to preserve their representation as single objects.

If 3D geometries are instead provided to 3D polygon destination feature types, the surfaces and solids will be converted to individual component polygons.

See Esri Shapefile Writer Parameters.