'\" -*- coding: UTF-8 -*- .if \n(.g .ds T< \\FC .if \n(.g .ds T> \\F[\n[.fam]] .de URL \\$2 \(la\\$1\(ra\\$3 .. .if \n(.g .mso www.tmac .TH sortshp 1 "05 February 2024" "" "" .SH NAME sortshp \- sort a Shape data set .SH SYNOPSIS 'nh .fi .ad l \*(T<\fBsortshp\fR\*(T> \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu [ \fIinfile\fR \fIoutfile\fR \fIitem\fR [\fIascending\fR | \fIdescending\fR] | \*(T<\fB\-v\fR\*(T>] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBsortshp\fR sorts a Shape data set based on a single column in ascending or descending order. Supports INTEGER, DOUBLE and STRING column types. Useful for prioritizing shapes for rendering and/or labeling. .PP The idea here is that if you know that you need to display a certain attribute classed by a certain value, it will be faster for MapServer to access that value if it is at the beginning of the attribute file. .SH OPTIONS .TP \fIinfile\fR The name of the .shp file .TP \fIoutfile\fR The name of the .shp/.shx and .dbf files to create .TP \fIitem\fR Name of the field to sort on .TP \fIascending\fR, \fIdescending\fR Sort order (default: ascending) .TP \*(T<\fB\-v\fR\*(T> Display mapserver version and build options. .SH EXAMPLE This example uses a roads file ('roads_ugl') that has a field with road classes in integer format ('class1'). .PP .nf \*(T< sortshp roads_ugl roads\-sort class1 ascending \*(T> .fi Result: .RS A new Shape data set named 'roads-sort.shp' is created with shapes sorted in ascending order, according to the values in the 'class1' field. .RE .PP \fBFigure 1: Attributes Before sortshp\fR .URL http://mapserver.org/_images/sortshp-before.png "" .PP \fBFigure 2: Attributes After sortshp\fR .URL http://mapserver.org/_images/sortshp-after.png "" .SH "SEE ALSO" \fBmap2img\fR(1), \fBshptree\fR(1), \fBshptreetst\fR(1), \fBshptreevis\fR(1)