1SHPREWIND(1) shapelib SHPREWIND(1)
2
3
4
6 shprewind - validates and resets the winding order of rings
7
9 shprewind in_shp_file out_shp_file
10
12 Validates and resets the winding order of rings in polygon geometries
13 to match the ordering required by shapefile specification. This is use‐
14 ful for shapefiles having troubles when checked with a ´shpdump -vali‐
15 date´.
16
17 Makes a copy of the shapefile in_shp_file to out_shp_file and fixes the
18 orientation of points in the rings of Polygon, PolygonZ, and PolygonM
19 typed shapes to conform to the shapefile specification. According to
20 the specification, the vertices of outer rings should be oriented
21 clockwise on the X/Y plane, and those of inner rings counterclockwise.
22
23 Shapefiles actually consist of two files with the same basename and ex‐
24 tensions .shp and .shx (or .SHP and .SHX) containing the shape data and
25 shape index respectively. The files to open are determined by first
26 stripping any filename extension from in_shp_file and attempting to
27 open the files in_shp_file.shp or in_shp_file.SHP, and in_shp_file.shx
28 or in_shp_file.SHX for the respective data and index files. The files
29 to create from out_shp_file are determined by stripping any filename
30 extension from out_shp_file and appending .shp and .shx suffixes for
31 the respective data and index files.
32
34 in_shp_file
35 the name of an existing shapefile.
36
37 out_shp_file
38 the name of the new fixed shapefile that will be created.
39
41 0 Successful program execution.
42
43 1 Missing in_shp_file or out_shp_file arguments, failed to open
44 shapefile in_shp_file or create shapefile out_shp_file.
45
47 The following diagnostics may be issued on stdout:
48
49 Unable to open:in_shp_file
50
51 Unable to create:out_shp_file
52
53 count objects rewound.
54
56 shprewind badshapefile newshapefile
57
59 shprewind is part of shapelib, maintained by Frank Warmerdam. This
60 guide was created by Eduardo Patoo Kanegae and converted to manpage by
61 Johan Van de Wauw. It was further enhanced with the man page written by
62 Joonas Pihlaja (jpihlaja@cc.helsinki.fi).
63
65 The implementation assumes that there is at most one outer ring in each
66 shape, that it is the first ring in a shape, and all other rings in a
67 shape are inner rings. Polygons inside MultiPatch shape types aren´t
68 rewound.
69
71 dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpadd(1),
72 shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shp‐
73 fix(1), shpinfo(1), shpproj(1), shptest(1)
74
75
76
77 July 2021 SHPREWIND(1)