Provided by: shapelib_1.2.10-7_amd64

**NAME**

shpdump - dump an ESRI shapefile as text

**SYNOPSIS**

shpdump[-validate]file

**DESCRIPTION**

Prints the contents of the shapefilefileto standard output in textual format. Shapefiles actually consist of two files with the same basename and extensions.shpand.shx(or.SHPand.SHX) containing the shape data and shape index respectively. The files to open are determined by first stripping any filename extension fromfileand attempting to open the filesfile.shporfile.SHP,andfile.shxorfile.SHXfor the respective data and index files. Output consists of a header giving number and type of shapes in the file and the bounds for the minimum and maximumX,Y,Z, andMvalues appearing in the shapes. The header is followed by the geometric data for each shape in the file. All shapes in the file should be of the same type, except thatNullShapetyped shapes may be intermixed with any other type. The header has the form Shapefile Type:type# of Shapes:countFile Bounds: (minX,minY,minZ,minM) to (maxX,maxY,maxZ,maxM) See sectionSHAPETYPESbelow for the list of possible shape types. Next for each shape in the file a header giving it'sshape_index, it's typetype, number of verticesnVertices, number of partsnParts, and bounding box is given, followed by the vertex data of each part. Shape:shape_index(type) nVertices=nVertices, nParts=nPartsBounds: (minX,minY,minZ,minM) to (maxX,maxY,maxZ,maxM)verticesofthefirstpart+verticesofthesecondpart...+verticesofthelastpartTheshape_indexof a shape is the number of the shape starting from zero in the shape file. Each vertex has the form (X,Y,Z,M) If there are multiple parts then the type of the part is appended appended to first vertex of each part, and the first vertex of the second and following parts is preceded by a plus (+) sign. The part type isRingfor all shape types exceptMultiPatchwhere it is the type of a surface patch. See below for the description of possible part types.

**SHAPE** **TYPES**

Each type of shape exceptMultiPatchtyped shapes comes in three flavours: The normal unsuffixed type, where points lie inX/Y-space; a type with suffixMwhere points lie inX/Y-space and additionally have ameasurevalue inM-space; and finally a type with suffixZwhere points lie inX/Y/Z-space and also have a measure value inM-space.NullShapeA shape without data. Shapes of this type may be intermixed with other shapes and are sometimes used to represented deleted or missing geometric data for a shape.PointorPointZorPointMA single point.ArcorArcZorArcMPiecewise linear paths. Shapes of this type may consist of multiple parts which may or may not intersect and/or connect. Arcs are calledPolyLines in the shapefile specification.PolygonorPolygonZorPolygonMPolygon shapes consist of one or more parts, calledrings, that each define a closed path. Rings must contain at least four vertices with the first and last vertices being equal, and must not self-intersect. For shapes of typePolygon, the rings define a polygon with optional holes by giving the vertices of inner rings a counterclockwise orientation and the vertices of outer rings a clockwise orientation. Intersection and orientation is always computed inX/Y-space and never inX/Y/M-space.MultiPointorMultiPointZorMultiPointMA set of points.MultiPatchAMultiPatchrepresents one or more surfaces inX/Y/Z-space, and consists of a number of parts called it'ssurfacepatches. Each surface patch describes a either a surface or a hole in another surface, depending on the type of the patch. Patches may share a common boundary but may not otherwise intersect. The type of a patch may be one ofTriangleStripA set of connected triangles. The first three points define the first triangle and every following point defines a new triangle using the new point and the two previous points.TriangleFanA set of connected triangles. The first three points define the first triangle and every following point defines a new triangle using the previous point, the current point, and the first point, thus forming a fan of triangles around the first point.OuterRingThe outer ring of a sequence of rings defining a polygon with holes. All following parts of typeInnerRingare taken to be the holes of the polygon. The sequence of rings ends with the first non-InnerRingtyped part or the part of the shape, whichever comes first.InnerRingAn inner ring in a sequence of rings defining a polygon with holes. This type of part may only follow anOuterRingor otherInnerRingtyped parts.FirstRingThe first in a sequence of rings defining a polygon of unspecified type. The following parts of typeRingdefines the other rings in the polygon. This type of part is used when the innerness or outerness of a polygon isn't known or applicable. The sequence of rings defining the polygon ends with the firstnon-Ring typed part or the last part of the shape, whichever comes first.RingA ring in a sequence of rings defining a polygon of unspecified type. It may only follow aFirstRingor otherRingtyped parts.UknownPartTypeThis type is returned for parts whose type isn't recognised.UnknownShapeTypeThis type is returned for shapes whose type isn't recognised.

**OPTIONS**

-validatePerforms validation on the orientation of inner and outer rings inPolygon,PolygonZ, andPolygonMobjects. According to the shapefile specification outer rings should be given a clockwise orientation, and inner rings that define holes a counterclockwise orientation. If some rings of a shape are oriented the wrong way around then the following message is output after dumping that shape:countrings wound in the wrong direction. In addition the total number of shapes with problem rings is output after the last shape has been dumped:countobject has invalid ring orderings.

**EXIT** **STATUS**

0Successful program execution.1No shapefilefilewas given or it couldn't be opened.

**EXAMPLE**

$ shpdump shapefile.shp Shapefile Type: Arc # of Shapes: 3 File Bounds: ( 3531586.750, 7253086.100,0,0) to ( 3536417.463, 7778375.875,0,0) Shape:0 (Arc) nVertices=2, nParts=1 Bounds:( 3536397.797, 7253086.100, 0, 0) to ( 3536417.463, 7253163.597, 0, 0) ( 3536397.797, 7253163.597, 0, 0) Ring ( 3536417.463, 7253086.100, 0, 0) Shape:1 (Arc) nVertices=3, nParts=1 Bounds:( 3458966.390, 7373335.808, 0, 0) to ( 3459141.856, 7373474.681, 0, 0) ( 3458966.390, 7373474.681, 0, 0) Ring ( 3458979.042, 7373466.273, 0, 0) ( 3459141.856, 7373335.808, 0, 0) Shape:2 (Arc) nVertices=7, nParts=1 Bounds:( 3531586.750, 7777880.500, 0, 0) to ( 3532930.206, 7778375.875, 0, 0) ( 3531586.750, 7777880.500, 0, 0) Ring ( 3532228.265, 7778072.455, 0, 0) ( 3532310.897, 7778119.445, 0, 0) ( 3532367.866, 7778144.877, 0, 0) ( 3532440.559, 7778168.920, 0, 0) ( 3532506.504, 7778190.785, 0, 0) ( 3532930.206, 7778375.875, 0, 0) $

**DIAGNOSTICS**

The following diagnostics may be issued on stdout: Unable to open:file

**AUTHORS**

Frank Warmerdam (warmerdam@pobox.com) is the maintainer of theshapelibshapefile library. Joonas Pihlaja (jpihlaja@cc.helsinki.fi) wrote this man page.

**BUGS**

The-validateoption supports only one outer ring in a polygonal shape and assumes that the first ring in a shape is the outer ring. It doesn't support polygons insideMultiPatchshapes. TheXandYcoordinates of a point are printed to three decimal places only.

**SEE** **ALSO**

dbfadd(1),dbfcreate(1),dbfdump(1),dbf_dump(1),shpadd(1),shpcreate(1),shprewind(1)