Skip to main content
added esri spec
Source Link
blah238
  • 35.9k
  • 8
  • 96
  • 200

Wikipedia says yes and no (but mostly no):

Mixing shape types

Because the shape type precedes each record, a shape file is physically capable of storing a mixture of different shape types. However, the specification states, "All the non-Null shapes in a shapefile are required to be of the same shape type." Therefore this ability to mix shape types must be limited to interspersing null shapes with the single shape type declared in the file's header. A shape file must not contain both polyline and polygon data, for example, and the descriptions for a well (point), a river (polyline), and a lake (polygon) would be stored in three separate files.

The ESRI Shapefile Technical Description confirms this:

All the non-Null shapes in a shapefile are required to be of the same shape type. The values for shape type are as follows:

Value Shape Type
0     Null Shape
1     Point
3     PolyLine
5     Polygon
8     MultiPoint
11    PointZ
13    PolyLineZ
15    PolygonZ
18    MultiPointZ
21    PointM
23    PolyLineM
25    PolygonM
28    MultiPointM
31    MultiPatch

Wikipedia says yes and no (but mostly no):

Mixing shape types

Because the shape type precedes each record, a shape file is physically capable of storing a mixture of different shape types. However, the specification states, "All the non-Null shapes in a shapefile are required to be of the same shape type." Therefore this ability to mix shape types must be limited to interspersing null shapes with the single shape type declared in the file's header. A shape file must not contain both polyline and polygon data, for example, and the descriptions for a well (point), a river (polyline), and a lake (polygon) would be stored in three separate files.

Wikipedia says yes and no (but mostly no):

Mixing shape types

Because the shape type precedes each record, a shape file is physically capable of storing a mixture of different shape types. However, the specification states, "All the non-Null shapes in a shapefile are required to be of the same shape type." Therefore this ability to mix shape types must be limited to interspersing null shapes with the single shape type declared in the file's header. A shape file must not contain both polyline and polygon data, for example, and the descriptions for a well (point), a river (polyline), and a lake (polygon) would be stored in three separate files.

The ESRI Shapefile Technical Description confirms this:

All the non-Null shapes in a shapefile are required to be of the same shape type. The values for shape type are as follows:

Value Shape Type
0     Null Shape
1     Point
3     PolyLine
5     Polygon
8     MultiPoint
11    PointZ
13    PolyLineZ
15    PolygonZ
18    MultiPointZ
21    PointM
23    PolyLineM
25    PolygonM
28    MultiPointM
31    MultiPatch
Source Link
blah238
  • 35.9k
  • 8
  • 96
  • 200

Wikipedia says yes and no (but mostly no):

Mixing shape types

Because the shape type precedes each record, a shape file is physically capable of storing a mixture of different shape types. However, the specification states, "All the non-Null shapes in a shapefile are required to be of the same shape type." Therefore this ability to mix shape types must be limited to interspersing null shapes with the single shape type declared in the file's header. A shape file must not contain both polyline and polygon data, for example, and the descriptions for a well (point), a river (polyline), and a lake (polygon) would be stored in three separate files.