'\" -*- 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 shptree 1 "09 December 2020" "" "" .SH NAME shptree \- create a quadtree-based spatial index for a Shape data set .SH SYNOPSIS 'nh .fi .ad l \fBshptree\fR \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu [ \fIshpfile\fR [\fIdepth\fR] [\fIindex_format\fR] | \fB-v\fR] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBshptree\fR creates a quadtree-based spatial index for a Shape data set. The default tree depth is calculated so that each tree node (quadtree cell) contains 8 shapes. Do not use the default with point files, a value between 6 and 10 seems to work ok. Your millage may vary and you'll need to do some experimenting. .PP This utility is a must for any MapServer application that uses Shape data sets. \fBshptree\fR creates a spatial index of your Shape data set, using a quadtree method. This means that MapServer will use this index to quickly find the appropriate shapes to draw. It creates a file of the same name as your Shape data set, with a .qix file extension. The quadtree method breaks the file into 4 quadrants, recursively until only a few shapes are contained in each quadrant. This minimum number can be set with the \fIdepth\fR parameter of the command. .SH OPTIONS .TP \fIshpfile\fR The name of the .shp file to index. .TP \fIdepth\fR (Optional) The maximum depth of the index to create, default is 0 meaning that \fBshptree\fR will calculate a reasonable default depth. .TP \fIindex_format\fR (Optional) One of: .RS .TP \*(T<\fBNL\fR\*(T> LSB byte order, using new index format .TP \*(T<\fBNM\fR\*(T> MSB byte order, using new index format .RE The following old format options are deprecated: .RS .TP \*(T<\fBN\fR\*(T> Native byte order .TP \*(T<\fBL\fR\*(T> LSB (intel) byte order .TP \*(T<\fBM\fR\*(T> MSB byte order .RE The default \fIindex_format\fR on this system is: \*(T<\fBNL\fR\*(T> .TP \*(T<\fB\-v\fR\*(T> Display mapserver version and build options. .SH NOTES Shape data sets are native to MapServer, and therefore do not require the \&.shp extension in the DATA path of the LAYER. In fact, in order for MapServer to use the .qix extension you MUST NOT specify the extension, for example: .nf \*(T< LAYER ... DATA "us_states" #MapServer will search for us_states.qix and will use it ... END LAYER ... DATA "us_states.shp" #MapServer will search for us_states.shp.qix and won't find it ... END \*(T> .fi Note: As of MapServer 5.2 the qix will be used even when the .shp extension is specified. .SH EXAMPLE .nf \*(T< shptree us_states.shp creating index of new LSB format \*(T> .fi Result: .RS A file named 'us_states.qix' is created in the same location. (note that you can use the \fBshptreevis\fR(1) utility to view the actual quadtree quadrants that are used by MapServer in this qix file) .RE .SH "SEE ALSO" \fBshptreetst\fR(1), \fBshptreevis\fR(1), \fBsortshp\fR(1) The .URL https://github.com/mapserver/mapserver/wiki/ShpTree " shptree wiki page " may also contain information on this utility.