.\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "SHPDUMP" "1" "August 2018" "" "shplib" . .SH "NAME" \fBshpdump\fR \- dumps as text and/or validates the content of an ESRI shapefile . .SH "SYNOPSIS" \fBshpdump\fR [\-\fIvalidate\fR] \fIshp_file\fR . .SH "DESCRIPTION" Prints the contents of the shapefile \fIshp_file\fR to standard output in textual format\. Shapefiles actually consist of two files with the same basename and extensions \fB\.shp\fR and \fB\.shx\fR (or \fB\.SHP\fR and \fB\.SHX\fR) containing the shape data and shape index respectively\. The files to open are determined by first stripping any filename extension from \fIshp_file\fR and attempting to open the files \fIshp_file\fR\fB\.shp\fR or \fIshp_file\fR\fB\.SHP\fR, and \fIshp_file\fR\fB\.shx\fR or \fIshp_file\fR\fB\.SHX\fR for the respective data and index files\. . .P Output consists of a header giving number and type of shapes in the file and the bounds for the minimum and maximum \fIX\fR, \fIY\fR, \fIZ\fR, and \fIM\fR values 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 that \fBNullShape\fR typed shapes may be intermixed with any other type\. The header has the form . .IP "" 4 . .nf Shapefile Type: type # of Shapes: count File Bounds: (minX,minY,minZ,minM) to (maxX,maxY,maxZ,maxM) . .fi . .IP "" 0 . .P See section \fBSHAPE TYPES\fR below for the list of possible shape types\. . .P Next for each shape in the file a header giving it\'s \fIshape_index\fR, it\'s type \fItype\fR, number of vertices \fInVertices\fR, number of parts \fInParts\fR, and bounding box is given, followed by the vertex data of each part\. . .IP "" 4 . .nf Shape: shape_index (type) nVertices=nVertices, nParts=nParts Bounds: (minX,minY,minZ,minM) to (maxX,maxY,maxZ,maxM) vertices of the first part + vertices of the second part\.\.\. + vertices of the last part . .fi . .IP "" 0 . .P The \fIshape_index\fR of a shape is the number of the shape starting from zero in the shape file\. Each vertex has the form . .IP "" 4 . .nf (X,Y,Z,M) . .fi . .IP "" 0 . .P 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 (\fB+\fR) sign\. The part type is \fBRing\fR for all shape types except \fBMultiPatch\fR where it is the type of a surface patch\. See below for the description of possible part types\. . .SH "SHAPE TYPES" Each type of shape except \fBMultiPatch\fR typed shapes comes in three flavours: The normal unsuffixed type, where points lie in \fIX/Y\fR\-space; a type with suffix \fIM\fR where points lie in \fIX/Y\fR\-space and additionally have a \fImeasure\fR value in \fIM\fR\-space; and finally a type with suffix \fIZ\fR where points lie in \fIX/Y/Z\fR\-space and also have a measure value in \fIM\fR\-space\. . .TP \fBNullShape\fR A 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\. . .TP \fBPoint\fR or \fBPointZ\fR or \fBPointM\fR A single point\. . .TP \fBArc\fR or \fBArcZ\fR or \fBArcM\fR Piecewise linear paths\. Shapes of this type may consist of multiple parts which may or may not intersect and/or connect\. Arcs are called \fBPolyLines\fR in the shapefile specification\. . .TP \fBPolygon\fR or \fBPolygonZ\fR or \fBPolygonM\fR Polygon shapes consist of one or more parts, called \fIrings\fR, 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 type \fBPolygon\fR, 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 in \fIX/Y\fR\-space and never in \fIX/Y/M\fR\-space\. . .TP \fBMultiPoint\fR or \fBMultiPointZ\fR or \fBMultiPointM\fR A set of points\. . .TP \fBMultiPatch\fR A \fBMultiPatch\fR represents one or more surfaces in \fBX/Y/Z\fR\-space, and consists of a number of parts called it\'s \fIsurface\fR \fIpatches\fR\. 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 of . .IP \fBTriangleStrip\fR: A 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\. . .IP \fBTriangleFan\fR: A 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\. . .IP \fBOuterRing\fR: The outer ring of a sequence of rings defining a polygon with holes\. All following parts of type \fBInnerRing\fR are taken to be the holes of the polygon\. The sequence of rings ends with the first non\-\fBInnerRing\fR typed part or the part of the shape, whichever comes first\. . .IP \fBInnerRing\fR: An inner ring in a sequence of rings defining a polygon with holes\. This type of part may only follow an \fBOuterRing\fR or other \fBInnerRing\fR typed parts\. . .IP \fBFirstRing\fR: The first in a sequence of rings defining a polygon of unspecified type\. The following parts of type \fBRing\fR defines 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 first non\-\fBRing\fR typed part or the last part of the shape, whichever comes first\. . .IP \fBRing\fR: A ring in a sequence of rings defining a polygon of unspecified type\. It may only follow a \fBFirstRing\fR or other \fBRing\fR typed parts\. . .IP \fBUknownPartType\fR: This type is returned for parts whose type isn\'t recognised\. . .TP \fBUnknownShapeType\fR This type is returned for shapes whose type isn\'t recognised\. . .SH "OPTIONS" . .TP \-\fIvalidate\fR count the number of objects that have invalid ring ordenings . .IP Performs validation on the orientation of inner and outer rings in \fBPolygon\fR, \fBPolygonZ\fR, and \fBPolygonM\fR objects\. 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: . .IP \fIcount\fR rings wound in the wrong direction\. . .IP In addition the total number of shapes with problem rings is output after the last shape has been dumped: . .IP \fIcount\fR object has invalid ring orderings\. . .TP \fIshp_file\fR the name of an existing shapefile\. . .SH "EXIT STATUS" . .TP \fB0\fR Successful program execution\. . .TP \fB1\fR No shapefile \fIshp_file\fR was given or it couldn\'t be opened\. . .SH "EXAMPLE" . .nf $ 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) $ . .fi . .SH "DIAGNOSTICS" The following diagnostics may be issued on stdout: . .P Unable to open:\fIshp_file\fR . .SH "AUTHOR" \fBshpdump\fR is part of shapelib, maintained by Frank Warmerdam\. This guide was created by Eduardo Patoo Kanegae and converted to manpage by Johan Van de Wauw\. It was further enhanced with the man page written by Joonas Pihlaja (jpihlaja@cc\.helsinki\.fi)\. . .SH "BUGS" The \fB\-\fR\fIvalidate\fR option 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 inside \fBMultiPatch\fR shapes\. The \fIX\fR and \fIY\fR coordinates of a point are printed to three decimal places only\. . .SH "SEE ALSO" \fBdbfadd\fR(1), \fBdbfcat\fR(1), \fBdbfcreate\fR(1), \fBdbfdump\fR(1), \fBdbfinfo\fR(1), \fBshpadd\fR(1), \fBshpcat\fR(1), \fBshpcentrd\fR(1), \fBshpcreate\fR(1), \fBshpdxf\fR(1), \fBshpfix\fR(1), \fBshpinfo\fR(1), \fBshpproj\fR(1), \fBshprewind\fR(1), \fBshptest\fR(1)