Class: GetFeaturesByBufferParameters

GetFeaturesByBufferParameters

数据集缓冲区查询参数类。此类用于指定进行缓冲区查询的数据集列表,设置缓冲距离、空间查询条件、属性查询条件以及一些通用的查询参数。

Notice

推荐设置 returnFeaturesOnly 配置为 true 来提升性能,如果需要获取总数量与数据集信息,FeatureService 提供了 getFeaturesCount 和 getFeaturesDatasetInfo 方法

new GetFeaturesByBufferParameters(options)

Usage
import { GetFeaturesByBufferParameters } from '@supermapgis/iclient-leaflet';

new GetFeaturesByBufferParameters(options);
<script type="text/javascript" src="https://iclient.supermap.io/dist/leaflet/iclient-leaflet.js"></script>
<script>
  new L.supermap.GetFeaturesByBufferParameters({paramsNames});
  // 弃用的写法
  new SuperMap.GetFeaturesByBufferParameters(options);
</script>
common/iServer/GetFeaturesByBufferParameters.js, line 9
Name Type Description
options Object

参数。

Name Type Default Description
bufferDistance number

缓冲距离,单位与所查询图层对应的数据集单位相同。

geometry Object

空间查询条件。

dataSetNames Array.<string>

数据集集合中的数据集名称列表。

fields Array.<string> 可选

查询结果返回字段。默认返回所有字段。

attributeFilter string 可选

属性查询条件。

returnContent boolean true 可选

是否立即返回新创建资源的表述还是返回新资源的 URI。如果为 true,则直接返回新创建资源,即查询结果的表述。如果为 false,则返回的是查询结果资源的 URI。

returnFeaturesOnly boolean false 可选

是否仅返回要素信息。当 returnContent 为 true 时设置有效。

fromIndex number 0 可选

查询结果的最小索引号,指定了返回结果的开始位置。

toIndex number 19 可选

查询结果的最大索引号,指定了返回结果的结束位置。例如 fromIndex=0&toIndex=2,表示仅返回前 3 条查询结果信息。如果该值大于预期查询结果的最大索引号,则以预期查询结果的最大索引号为实际查询结果的最大索引号。

targetEpsgCode string | number 可选

查询结果的目标坐标系对应的 EPSG Code,使用此参数时,returnContent 参数需为 true。

targetPrj Object 可选

查询结果的目标坐标系。使用此参数时,returnContent 参数需为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。

API Relations

As method parameter: FeatureService.getFeaturesByBuffer , FeatureService.getFeaturesCount , FeatureService.getFeaturesDatasetInfo , GetFeaturesByBufferParameters.toJsonParameters.

Extends

GetFeaturesByBufferParameters -> GetFeaturesParametersBase

Members

聚合查询参数,该参数仅支持数据来源为 Elasticsearch 服务的 SuperMap iServer 的 REST 数据服务。

attributeFilterstring

属性查询条件。

bufferDistancenumber

缓冲距离,单位与所查询图层对应的数据集单位相同。

datasetNameArray.<string>

数据集集合中的数据集名称列表。

fieldsArray.<string>

查询结果返回字段。当指定了返回结果字段后,则 GetFeaturesResult 中的 features 的属性字段只包含所指定的字段。不设置即返回全部字段。

fromIndexnumber

查询结果的最小索引号,指定了返回结果的开始位置。如果该值大于查询结果的最大索引号,则查询结果为空。

空间查询条件。

hasGeometrynumber

返回结果是否包含 Geometry。

Default Value:
true

maxFeaturesnumber

进行 SQL 查询时,用于设置服务端返回查询结果条目数量。

Default Value:
1000

returnContentboolean

是否立即返回新创建资源的表述还是返回新资源的 URI。如果为 true,则直接返回新创建资源,即查询结果的表述。如果为 false,则返回的是查询结果资源的 URI。 如果为 true,则直接返回新创建资源,即查询结果的表述。 如果为 false,则返回的是查询结果资源的 URI。

Default Value:
true

returnFeaturesOnlyboolean

仅返回要素信息。

targetEpsgCodestring

查询结果的目标坐标系对应的 EPSG Code,使用时需设置 returnContent 参数为 true。

targetPrjObject

查询结果的目标坐标系。使用时需设置 returnContent 参数为 true。如:prjCoordSys={"epsgCode":3857}。当同时设置 targetEpsgCode 参数时,此参数不生效。

toIndexnumber

查询结果的最大索引号,指定了返回结果的结束位置。例如 fromIndex=0&toIndex=2,表示仅返回前 3 条查询结果信息。如果该值大于预期查询结果的最大索引号,则以预期查询结果的最大索引号为实际查询结果的最大索引号。

Default Value:
19

Methods

static toJsonParameters(params){string}

common/iServer/GetFeaturesByBufferParameters.js, line 84

将 GetFeaturesByBufferParameters 对象转换为 JSON 字符串。

Name Type Description
params GetFeaturesByBufferParameters

数据集缓冲区查询参数对象。

Returns:
Type Description
string 转化后的 JSON 字符串。

inherited destroy()

common/iServer/GetFeaturesByBufferParameters.js, line 63

释放资源,将引用资源的属性置空。