new DatasetVector()
矢量数据集类。用于对矢量数据集进行描述,并对之进行相应的管理和操作。对矢量数据集的操作主要包括数据查询、修改、删除、建立索引等。
- Source:
Methods
(static) buildSpatialIndex(spatialIndexType) → {Promise.<boolean>}
根据给定的空间索引类型来为矢量数据集创建空间索引。
Parameters:
| Name | Type | Description |
|---|---|---|
spatialIndexType |
DatasetVector.SpatialIndeType | 指定的需要创建空间索引的类型 |
- Source:
Returns:
- Type
- Promise.<boolean>
(static) computeBounds() → {Promise.<object>}
计算数据集的空间范围
- Source:
Returns:
- Type
- Promise.<object>
(static) dropSpatialIndex() → {Promise.<boolean>}
删除空间索引
- Source:
Returns:
- Type
- Promise.<boolean>
(static) fromGeoJSON(geoJson) → {Promise.<boolean>}
将数据集中指定起止SmID的对象,转换成GeoJSON格式的字符串
仅支持点、线、面和CAD数据集,转换点、线、面对象.hasAtrributte为true时,结果中包含属性值;hasAtrribute为false时,只有几何对象。
Parameters:
| Name | Type | Description |
|---|---|---|
geoJson |
string | json字符串 |
- Source:
Returns:
- Type
- Promise.<boolean>
(static) getRecordset(isEmptyRecordset, cursorType) → {Promise.<Recordset>}
根据给定的参数来返回空的记录集或者返回包括所有记录的记录集对象。
Parameters:
| Name | Type | Description |
|---|---|---|
isEmptyRecordset |
boolean | |
cursorType |
number |
- Deprecated:
- - 已弃用(所有recordset都使用json格式表达),此接口将在数个版本内移除,请慎用。
- Source:
Returns:
- Type
- Promise.<Recordset>
(static) getSpatialIndexType() → {Promise.<DatasetVector.SpatialIndeType>}
返回当前的空间索引类型
- Source:
Returns:
- Type
- Promise.<DatasetVector.SpatialIndeType>
(static) query(queryParameter) → {Promise}
通过设置查询条件对矢量数据集进行查询,该方法默认查询空间信息与属性信息。
Parameters:
| Name | Type | Description |
|---|---|---|
queryParameter |
object | 定义的查询条件。 |
- Source:
Returns:
- 返回查询结果对象:result:{geoJson:geoJson结果集数组,每次10条,queryParameterId:查询条件对象的引用,可用于重复查询,counts:总记录数,batch:返回的批次数量,size:每批次记录数(最大为10),recordsetId:记录集对象引用}
- Type
- Promise
(static) queryByFilter(attributeFilter, geoRegion, count, callback) → {Promise.<void>}
异步空间查询,查询指定空间范围内符合字段条件的记录;
Parameters:
| Name | Type | Description |
|---|---|---|
attributeFilter |
string | 查询过滤字段 |
geoRegion |
object | 查询的区域 |
count |
返回的查询结果个数 | |
callback |
function | 返回结果的处理函数,回调参数callback(e){},e为Recordset的geoJson格式对象的数组 |
- Source:
Returns:
- Type
- Promise.<void>
(static) queryInBuffer(rectangle2D, cursorType) → {Promise.<Recordset>}
查询落在已知空间范围内的记录。
Parameters:
| Name | Type | Description |
|---|---|---|
rectangle2D |
Rectangle2D | |
cursorType |
number |
- Deprecated:
- - 已弃用(所有recordset都使用json格式表达),此接口将在数个版本内移除,请慎用。
- Source:
Returns:
- Type
- Promise.<Recordset>
(static) toGeoJSON(hasAttributte, startID, endID) → {Promise.<string>}
从GeoJSON字符串中获取几何对象,并将其存入数据集中
仅支持点、线、面和CAD数据集,获取点、线、面对象
Parameters:
| Name | Type | Description |
|---|---|---|
hasAttributte |
boolean | 是否包含属性值 |
startID |
number | 起始SmID |
endID |
number | 结束SmID |
- Source:
Returns:
- Type
- Promise.<string>