.\" generated with Ronn-NG/v0.9.1 .\" http://github.com/apjanke/ronn-ng/tree/0.9.1 .TH "SHPREWIND" "1" "December 2023" "" "shplib" .SH "NAME" \fBshprewind\fR \- validates and resets the winding order of rings .SH "SYNOPSIS" \fBshprewind\fR \fIin_shp_file\fR \fIout_shp_file\fR .SH "DESCRIPTION" Validates and resets the winding order of rings in polygon geometries to match the ordering required by shapefile specification\. This is useful for shapefiles having troubles when checked with a 'shpdump \-validate'\. .P Makes a copy of the shapefile \fIin_shp_file\fR to \fIout_shp_file\fR and fixes the orientation of points in the rings of \fBPolygon\fR, \fBPolygonZ\fR, and \fBPolygonM\fR typed shapes to conform to the shapefile specification\. According to the specification, the vertices of outer rings should be oriented clockwise on the \fIX/Y\fR plane, and those of inner rings counterclockwise\. .P 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 \fIin_shp_file\fR and attempting to open the files \fIin_shp_file\fR\fB\.shp\fR or \fIin_shp_file\fR\fB\.SHP\fR, and \fIin_shp_file\fR\fB\.shx\fR or \fIin_shp_file\fR\fB\.SHX\fR for the respective data and index files\. The files to create from \fIout_shp_file\fR are determined by stripping any filename extension from \fIout_shp_file\fR and appending \fB\.shp\fR and \fB\.shx\fR suffixes for the respective data and index files\. .SH "OPTIONS" .TP \fIin_shp_file\fR the name of an existing shapefile\. .TP \fIout_shp_file\fR the name of the new fixed shapefile that will be created\. .SH "EXIT STATUS" .TP \fB0\fR Successful program execution\. .TP \fB1\fR Missing \fIin_shp_file\fR or \fIout_shp_file\fR arguments, failed to open shapefile \fIin_shp_file\fR or create shapefile \fIout_shp_file\fR\. .SH "DIAGNOSTICS" The following diagnostics may be issued on stdout: .P Unable to open:\fIin_shp_file\fR .P Unable to create:\fIout_shp_file\fR .P \fIcount\fR objects rewound\. .SH "EXAMPLE" \fBshprewind\fR \fIbadshapefile\fR \fInewshapefile\fR .SH "AUTHOR" \fBshprewind\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 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 \fBMultiPatch\fR shape types aren't rewound\. .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), \fBshpdump\fR(1), \fBshpdxf\fR(1), \fBshpfix\fR(1), \fBshpinfo\fR(1), \fBshpproj\fR(1), \fBshptest\fR(1)