You are here: FME Readers and Writers > Esri Shape Reader/Writer > Feature Representation

Feature Representation

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

Shape features consist of geometry, a special predefined attribute, and a set of user-defined attributes. All shape features have one predefined attribute, SHAPE_GEOMETRY, which identifies the type of the features 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_pointm

shape_multipointm

shape_polylinem

shape_polygonm

shape_pointz

shape_multipointz

shape_polylinez

shape_polygonz

shape_multipatch

Default: No default

shape_measures

This is present for features that have measures when reading only if the reader directive MEASURES_AS_Z is not specified or is set to no.

To write measures using this attribute, make sure the writer directive MEASURES_AS_Z 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.

However, this will not be present on features if the FME_GEOMETRY_HANDLING directive is set to YES.

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 DEF line for that Shapefile. The feature type of a Shape feature is the same as the baseName specified in the DEF line.

When reading Shape features, the SHAPE_GEOMETRY attribute will correspond to the geometry type specified in the DEF line for that for the shapefile. When writing Shape features, the SHAPE_GEOMETRY attribute is not required and will be ignored if it is present because the geometry type is taken from the DEF line for the shapefile. If the feature being written out cannot be converted into the geometry type specified on the DEF line, this feature will not be written out and a warning message will be printed in the logfile. (An example of this would be trying to write an area feature into a point geometry file.)

There is one exception where the geometry type indicated on the DEF line may not be the type of file that is actually created. If the DEF line 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 will be true for pointz/multipointz as well as pointm/multipointm files.)

As of Esri ArcGIS Desktop 9.3 Shape files of type shape_null are no longer valid. Any DEF lines with SHAPE_GEOMETRY set to shape_null will be output instead as shape_point.

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, the FME will output multi-part polyline and polygon Shape features.

When providing 3D data to the Shape writer the polygonz 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 polygonz destination feature types the surfaces and solids will be converted to individual component polygons.