- bookworm 8.0.0-3+b8
- bookworm-backports 8.2.2-1~bpo12+1
- testing 8.2.2-1+b1
- unstable 8.2.2-1+b2
- experimental 8.4.0~beta2-1~exp1
shptree(1) | shptree(1) |
NAME¶
shptree - create a quadtree-based spatial index for a Shape data set
SYNOPSIS¶
shptree
[ shpfile [depth] [index_format] | -v]
DESCRIPTION¶
shptree 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.
This utility is a must for any MapServer application that uses Shape data sets. shptree 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 depth parameter of the command.
OPTIONS¶
- shpfile
- The name of the .shp file to index.
- depth
- (Optional) The maximum depth of the index to create, default is 0 meaning that shptree will calculate a reasonable default depth.
- index_format
- (Optional) One of:
The following old format options are deprecated:
The default index_format on this system is: NL
- -v
- Display mapserver version and build options.
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:
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
Note: As of MapServer 5.2 the qix will be used even when the .shp extension is specified.
EXAMPLE¶
shptree us_states.shp
creating index of new LSB format
Result:
SEE ALSO¶
shptreetst(1), shptreevis(1), sortshp(1)
The
shptree wiki page
⟨https://github.com/mapserver/mapserver/wiki/ShpTree⟩ may also
contain information on this utility.
18 January 2023 |