'\" -*- 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 shptreetst 1 "07 March 2024" "" "" .SH NAME shptreetst \- execute a spatial query on an existing spatial index .SH SYNOPSIS 'nh .fi .ad l \*(T<\fBshptreetst\fR\*(T> \kx .if (\nx>(\n(.l/2)) .nr x (\n(.l/5) 'in \n(.iu+\nxu \fIshapefile\fR [\fIminx\fR \fIminy\fR \fImaxx\fR \fImaxy\fR] 'in \n(.iu-\nxu .ad b 'hy .SH DESCRIPTION \fBshptreetst\fR executes a spatial query on an existing spatial index (.qix), that was created by the \fBshptree\fR(1) utility. This utility is useful to understand how a search of a Shape data set and its \fIqix\fR index works. .SH OPTIONS .TP \fIshapefile\fR The name of the .shp file index. .TP \fIminx\fR \fIminy\fR \fImaxx\fR \fImaxy\fR Extents to render .SH EXAMPLE .nf \*(T< shptreetst esp 879827.480246 4317203.699447 884286.289767 4321662.508967 This new LSB index supports a shapefile with 48 shapes, 4 depth shapes 6, node 4, \-13702.315770,3973784.599548,1127752.921471,4859616.714055 shapes 5, node 3, \-13702.315770,3973784.599548,614098.064712,4460992.262527 shapes 1, node 1, \-13702.315770,3973784.599548,331587.893495,4241748.814186 shapes 1, node 0, 141678.278400,3973784.599548,331587.893495,4121164.917599 shapes 1, node 0, 268807.855447,4193028.047889,614098.064712,4460992.262527 shapes 1, node 0, 268807.855447,3973784.599548,614098.064712,4241748.814186 shapes 7, node 4, \-13702.315770,4372409.051076,614098.064712,4859616.714055 shapes 1, node 0, \-13702.315770,4372409.051076,331587.893495,4640373.265714 shapes 3, node 1, \-13702.315770,4591652.499417,331587.893495,4859616.714055 shapes 1, node 0, \-13702.315770,4712236.396004,176207.299326,4859616.714055 shapes 2, node 0, 268807.855447,4372409.051076,614098.064712,4640373.265714 shapes 3, node 2, 268807.855447,4591652.499417,614098.064712,4859616.714055 shapes 2, node 0, 424188.449617,4712236.396004,614098.064712,4859616.714055 shapes 1, node 0, 424188.449617,4591652.499417,614098.064712,4739032.817468 shapes 2, node 1, 499952.540988,3973784.599548,1127752.921471,4460992.262527 shapes 2, node 0, 499952.540988,4193028.047889,845242.750254,4460992.262527 shapes 5, node 3, 499952.540988,4372409.051076,1127752.921471,4859616.714055 shapes 1, node 1, 499952.540988,4372409.051076,845242.750254,4640373.265714 shapes 1, node 0, 655333.135158,4372409.051076,845242.750254,4519789.369127 shapes 1, node 0, 499952.540988,4591652.499417,845242.750254,4859616.714055 read entire file now at quad box rec 20 file pos 1084 result of rectangle search was 8, 10, 36, 37, 38, 39, 42, 46, \*(T> .fi Result: .RS The above output from the shptreetst command tells us that the existing \fI.qix\fR index is for a Shape data set that contains 48 shapes; indeed the Shape data set used in this example, \fIesp.shp\fR, contains 48 polygons of Spain. The command also tells us that \fIqix\fR file has a quadtree depth of 4. .PP Most importantly, the resulting shape IDs (or feature IDs) that were contained in the bounding box that we passed in our example were returned at the bottom of the output: "8, 10, 36, 37, 38, 39, 42, 46". You can use a tool such as QGIS to view those feature IDs and check what shapes MapServer is querying when a user clicks within that bounding box. .RE .SH "SEE ALSO" \fBshptree\fR(1), \fBshptreevis\fR(1), \fBsortshp\fR(1)