Class: ServerGeometry

ServerGeometry

服务端几何对象类。该类描述几何对象(矢量)的特征数据(坐标点对、几何对象的类型等)。基于服务端的空间分析、空间关系运算、查询等 GIS 服务功能使用服务端几何对象。

new ServerGeometry(options)

Usage
// 浏览器
<script type="text/javascript" src="https://iclient.supermap.io/dist/mapboxgl/iclient-mapboxgl.js"></script>
<script>
  new mapboxgl.supermap.ServerGeometry(options);
  
  // 弃用的写法
  new SuperMap.ServerGeometry(options);

</script>

// ES6 Import
import { ServerGeometry } from '@supermap/iclient-mapboxgl';

new ServerGeometry(options);

common/iServer/ServerGeometry.js, line 17
Name Type Description
options Object

参数。

Name Type Description
id string

服务端几何对象唯一标识符。

parts Array.<number>

服务端几何对象中各个子对象所包含的节点个数。

points Array.<GeometryPoint>

组成几何对象的节点的坐标对数组。

type GeometryType

几何对象的类型。

style ServerStyle 可选

服务端几何对象的风格。

Members

idstring

服务端几何对象唯一标识符。

partsArray.<number>

服务端几何对象中各个子对象所包含的节点个数。
1.几何对象从结构上可以分为简单几何对象和复杂几何对象。 简单几何对象与复杂几何对象的区别:简单的几何对象一般为单一对象, 而复杂的几何对象由多个简单对象组成或经过一定的空间运算之后产生, 如:矩形为简单的区域对象,而中空的矩形为复杂的区域对象。
2.通常情况,一个简单几何对象的子对象就是它本身, 因此对于简单对象来说的该字段为长度为1的整型数组, 该字段的值就是这个简单对象节点的个数。 如果一个几何对象是由几个简单对象组合而成的, 例如,一个岛状几何对象由 3 个简单的多边形组成而成, 那么这个岛状的几何对象的 Parts 字段值就是一个长度为 3 的整型数组, 数组中每个成员的值分别代表这三个多边形所包含的节点个数。

pointsArray.<GeometryPoint>

组成几何对象的节点的坐标对数组。
1.所有几何对象(点、线、面)都是由一些简单的点坐标组成的, 该字段存放了组成几何对象的点坐标的数组。 对于简单的面对象,他的起点和终点的坐标点相同。
2.对于复杂的几何对象,根据 Parts 属性来确定每一个组成复杂几何对象的简单对象所对应的节点的个数, 从而确定 Points 字段中坐标对的分配归属问题。

prjCoordSysObject

投影坐标参数,现仅在缓冲区分析中有效。

服务端几何对象的风格(ServerStyle)。

几何对象的类型(GeometryType)。

Methods

destroy()

common/iServer/ServerGeometry.js, line 90

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

fromGeometry(geometry){ServerGeometry}

common/iServer/ServerGeometry.js, line 505

将客户端 Geometry 转换成服务端 ServerGeometry。

Name Type Description
geometry Geometry

要转换的客户端 Geometry 对象。

Returns:
Type Description
ServerGeometry 转换后的 ServerGeometry 对象。

fromJson(jsonObject){ServerGeometry}

common/iServer/ServerGeometry.js, line 481

将 JSON 对象表示服务端几何对象转换为 ServerGeometry。

Name Type Description
jsonObject Object

要转换的 JSON 对象。

Returns:
Type Description
ServerGeometry 转换后的 ServerGeometry 对象。

IsClockWise(geometry){number}

common/iServer/ServerGeometry.js, line 598

判断 linearRing 中的点的顺序。返回值大于 0,逆时针;小于 0,顺时针。

Name Type Description
geometry Geometry

要转换的客户端 Geometry 对象。

Returns:
Type Description
number 返回值大于 0,逆时针;小于 0,顺时针。

toGeoLine(){Geometry}

common/iServer/ServerGeometry.js, line 158

将服务端的线几何对象转换为客户端几何对象。包括 GeometryLinearRing、GeometryLineString、GeometryMultiLineString。

Returns:
Type Description
Geometry 转换后的客户端几何对象。

toGeoLineEPS(){Geometry}

common/iServer/ServerGeometry.js, line 197

将服务端的线几何对象转换为客户端几何对象。包括 GeometryLinearRing、GeometryLineString、GeometryMultiLineString。

Returns:
Type Description
Geometry 转换后的客户端几何对象。

toGeoLinem(){Geometry}

common/iServer/ServerGeometry.js, line 241

将服务端的路由线几何对象转换为客户端几何对象。包括 LinearRing、LineString、MultiLineString。

Returns:
Type Description
Geometry 转换后的客户端几何对象。

toGeometry(){Geometry}

common/iServer/ServerGeometry.js, line 105

将服务端几何对象 ServerGeometry 转换为客户端几何对象 Geometry。

Returns:
Type Description
Geometry 转换后的客户端几何对象。

toGeoPoint(){Geometry}

common/iServer/ServerGeometry.js, line 133

将服务端的点几何对象转换为客户端几何对象。包括 Point、MultiPoint。

Returns:
Type Description
Geometry 转换后的客户端几何对象。

toGeoRegion(){Geometry}

common/iServer/ServerGeometry.js, line 251

将服务端的面几何对象转换为客户端几何对象。类型为 GeometryPolygon。

Returns:
Type Description
Geometry 转换后的客户端几何对象。

toGeoRegionEPS(){Geometry}

common/iServer/ServerGeometry.js, line 356

将服务端的面几何对象转换为客户端几何对象。类型为 Polygon。

Returns:
Type Description
Geometry 转换后的客户端几何对象。