SHPSORT(1)

πŸ’– SHPSORT β€” the shplib glow-up page πŸ’–

okay bestie, welcome to shpsort(1) from the shplib family β€” it's the one that takes your shapefile and, like, reorders it. respectfully. ✨


🌸 NAME 🌸

shpsort β€” rewrite a shapefile sorted by a field or by the geometry πŸ¦‹


πŸ“œ SYNOPSIS πŸ“œ

shpsort infile outfile field[;...]
[<(ASCENDING|DESCENDING)[;...]>]

yes that's the whole vibe check. two files, a field list, and optionally a sort direction. we move πŸ’…


πŸ’« DESCRIPTION πŸ’«

so the entire point of shpsort is: rewrite a shapefile sorted by a field or by the geometry. that's it, that's the job, no notes. πŸŽ€

and here's the ✨iconic✨ part β€” when you sort by geometry, it changes what "sorted" even means depending on your shape type:

  • polygons ➑️ sort by area 🌸
  • lines ➑️ sort by length πŸ¦‹
  • everything else ➑️ it does nothing. literally nothing. it's giving "i'm just here for the vibes" πŸ’€
no cap, that third bullet is real β€” other geometry types get no geometry sorting at all. don't come for me, i don't make the rules, i just report them 🫢

πŸŽ€ OPTIONS πŸŽ€

  • infile β€” the input shapefile. the one you're starting with, the before picture πŸ“Έ
  • outfile β€” the output shapefile. the after picture, freshly sorted and thriving πŸ‘‘
  • field[;...] β€” one or more fields to use for ordering. plural bestie, you can stack them β€” just separate with ; and go off ✨
  • [<(ASCENDING|DESCENDING)[;...]>] β€” the sort order. it's optional (the brackets said so) and it wants literally the word ASCENDING or DESCENDING. you can chain them with ; too, so like, one direction per field, iykyk πŸ”₯

πŸ‘‘ AUTHOR πŸ‘‘

shpsort is part of shapelib, maintained by Frank Warmerdam. legend behaviour, honestly 🫢


🌈 SEE ALSO 🌈

your whole group chat of shapelib besties, for when one tool isn't enough:


πŸ’– and that's the whole page babes πŸ’– this beauty is from the shplib manual, SHPSORT(1), dated March 2026 β€” go sort something and slay πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from