希普特里

目的

为形状数据集创建基于四叉树的空间索引。计算默认的树深度,使每个树节点(四叉树单元)包含8个形状。不要将默认值与点文件一起使用,6到10之间的值似乎可以正常工作。你的里程可能会有所不同,你需要做一些实验。

这个 shptree wiki page 可能还包含有关此实用程序的信息。

描述

对于使用形状数据集的任何MapServer应用程序,此实用程序都是必需的。shptree使用四叉树方法创建形状数据集的空间索引。这意味着MapServer将使用此索引快速找到要绘制的适当形状。它创建与形状数据集同名的文件,文件扩展名为*.qix*。四叉树方法将文件分成4个象限,递归地直到每个象限中只包含几个形状。可以使用命令的<depth>参数设置此最小值。

句法

shptree <shpfile> [<depth>] [<index_format>]
  Where:
  <shpfile> is the name of the .shp file to index.
  <depth>   (optional) is the maximum depth of the inde
       to create, default is 0 meaning that shptre
       will calculate a reasonable default depth.
  <index_format> (optional) is one of:
       NL: LSB byte order, using new index format
       NM: MSB byte order, using new index format
   The following old format options are deprecated
       N:  Native byte order
       L:  LSB (intel) byte order
       M:  MSB byte order
   The default index_format on this system is: NL

例子

shptree us_states.shp
  creating index of new  LSB format
结果

在同一位置创建一个名为“us_states.qix”的文件。(请注意,您可以使用shptreevis实用程序(如下所述)查看此QIX文件中MapServer使用的实际四叉树象限)

Mapfile 注释

形状数据集是MapServer的本机数据集,因此不需要在层的数据路径中使用*.shp*扩展名。实际上,为了让MapServer使用*.qix*扩展名,您不能指定扩展名,例如:

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

备注

从MapServer 5.2开始,即使指定了.shp扩展名,也将使用qix。