SHPDUMP(1) | shplib | SHPDUMP(1) |
shpdump - dumps as text and/or validates the content of an ESRI shapefile
shpdump [-validate] shp_file
Prints the contents of the shapefile shp_file to standard output in textual format. Shapefiles actually consist of two files with the same basename and extensions .shp and .shx (or .SHP and .SHX) containing the shape data and shape index respectively. The files to open are determined by first stripping any filename extension from shp_file and attempting to open the files shp_file.shp or shp_file.SHP, and shp_file.shx or shp_file.SHX for 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 maximum X, Y, Z, and M 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 NullShape typed shapes may be intermixed with any other type. The header has the form
Shapefile Type: type # of Shapes: count File Bounds: (minX,minY,minZ,minM)
to (maxX,maxY,maxZ,maxM)
See section SHAPE TYPES below for the list of possible shape types.
Next for each shape in the file a header giving it's shape_index, it's type type, number of vertices nVertices, number of parts nParts, and bounding box is given, followed by the vertex data of each part.
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
The shape_index of 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 is Ring for all shape types except MultiPatch where it is the type of a surface patch. See below for the description of possible part types.
Each type of shape except MultiPatch typed shapes comes in three flavours: The normal unsuffixed type, where points lie in X/Y-space; a type with suffix M where points lie in X/Y-space and additionally have a measure value in M-space; and finally a type with suffix Z where points lie in X/Y/Z-space and also have a measure value in M-space.
$ 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) $
The following diagnostics may be issued on stdout:
Unable to open:shp_file
shpdump 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).
The -validate 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 MultiPatch shapes. The X and Y coordinates of a point are printed to three decimal places only.
dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)
March 2023 |