---
name: "shpsort"
section: "1"
platform: "linux"
package: "shapelib"
version: "1.6.1-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/shpsort"
---

# shpsort(1)

rewrite a shapefile sorted by a field or by the geometry ##SYNOPSIS shpsort infile outfile field\[;...\] \[\<(ASCENDING\|DESCENDING)\[;...\]\>\] ##DESCRIPTION Rewrite a shapefile sorted by a field or by the geometry. For polygons, sort by area, for lines sort by length and do nothing for all others. ##OPTIONS ##AUTHOR shpsort is part of shapelib, maintained by Frank Warmerdam. ##SEE ALSO dbfadd(1), dbfcat(1), dbfcreate(1), dbfdump(1), dbfinfo(1), shpcat(1), shpcentrd(1), shpcreate(1), shpdump(1), shpdxf(1), shpfix(1), shpinfo(1), shpproj(1), shprewind(1), shptest(1)

## NAME

**shpsort** - rewrite a shapefile sorted by a field or by the geometry

\##SYNOPSIS **shpsort** *infile* *outfile* *field\[;...\]* \[\<(ASCENDING\|DESCENDING)\[;...\]\>\]

\##DESCRIPTION Rewrite a shapefile sorted by a field or by the geometry. For polygons, sort by area, for lines sort by length and do nothing for all others.

\##OPTIONS

- *infile*

  input shapefile

- *outfile*

  output shapefile

- *field\[;...\]*

  one or more fields to use for ordering

- \[\<(ASCENDING\|DESCENDING)\[;...\]\>\]

  sort order

\##AUTHOR **shpsort** is part of shapelib, maintained by Frank Warmerdam.

\##SEE ALSO [**dbfadd**(1)](/dbfadd/1.md), [**dbfcat**(1)](/dbfcat/1.md), [**dbfcreate**(1)](/dbfcreate/1.md), [**dbfdump**(1)](/dbfdump/1.md), [**dbfinfo**(1)](/dbfinfo/1.md), [**shpcat**(1)](/shpcat/1.md), [**shpcentrd**(1)](/shpcentrd/1.md), [**shpcreate**(1)](/shpcreate/1.md), [**shpdump**(1)](/shpdump/1.md), [**shpdxf**(1)](/shpdxf/1.md), [**shpfix**(1)](/shpfix/1.md), [**shpinfo**(1)](/shpinfo/1.md), [**shpproj**(1)](/shpproj/1.md), [**shprewind**(1)](/shprewind/1.md), [**shptest**(1)](/shptest/1.md)
