SYNOPSIS

shprewind infile outfile

DESCRIPTION

Makes a copy of the shapefile infile to outfile and fixes the orientation of points in the rings of Polygon, PolygonZ, and PolygonM typed shapes to conform to the shapefile specification. According to the specification, the vertices of outer rings should be oriented clockwise on the X/Y plane, and those of inner rings counterclockwise.

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 from infile and attempting to open the files infile.shp or infile.SHP, and infile.shx or infile.SHX for the respective data and index files. The files to create from outfile are determined by stripping any filename extension from outfile and appending .shp and .shx suffixes for the respective data and index files.

EXIT STATUS

0

Successful program execution.

1

Missing infile or outfile arguments, failed to open shapefile infile or create shapefile outfile.

DIAGNOSTICS

The following diagnostics may be issued on stdout:

Unable to open:infile

Unable to create:outfile

count objects rewound.

AUTHORS

Frank Warmerdam ([email protected]) is the maintainer of the shapelib shapefile library. Joonas Pihlaja ([email protected]) wrote this man page.

BUGS

The implementation assumes that there is at most one outer ring in each shape, that it is the first ring in a shape, and all other rings in a shape are inner rings. Polygons inside MultiPatch shape types aren't rewound.

RELATED TO shprewind…