The geometry objects in SuperMap iServer are represented by id, parts, style and type, etc. Among them,
Id is the unique identifier for geometry object;
Parts is an integer array. The elements describe the number of vertices contained by each parts of the geometry object;
1.Geometry objects can be divided into simple geometry objects and complex geometry objects. A simple geometry object is usually a single object. While a complex geometry object consists of several simple geometry objects or is generated based on certain spatial operations. For instance, a rectangle is a simple geometry object, however, a hollow rectangle is a complex geometry object.
2.Normally, the part of a simple geometry object is itself. So, for a simple geometry object, parts is an integer array with the length of 1, and the element value is the number of vertices of this simple geometry object. If a geometry object consists several simple geometry objects, such as an island-shape geometry object composed of three simple polygons, the element values indicates the numbers of vertices of the three polygons.
Points is the coordinates array for the nodes constituting the geometry object.
Style describes the style of geometry object, used to define the marker, line, or fill style for display.
Type indicates the type of geometry object.
Below is the introduction for the construction of the simple point, line object, and region objects.
For a simple point object, parts is an integer array at the length of 1, and the value of the single element in the array is 1. The value of type is POINT.
Below is a simple point object in JSON format:
{
"id": 1,
"parts": [1],
"points": [{
"x": 25.27596664428711,
"y": 54.688568115234375
}],
"style": null,
"type": "POINT"
}
A line object is consisted of a set of points. The value of type is LINE.
Below is a simple line object in JSON format:
{
"id": 1,
"parts": [4],
"points": [{
"x": 96.37172516065249,
"y": 399.73448202810533
},
{
"x": 127.60869053503754,
"y": 290.4051032177577
},
{
"x": 397.3824824047266,
"y": 362.8180684038321
},
{
"x": 357.05839983052044,
"y": 279.0462067179813
}],
"style": null,
"type": "LINE"
}
A region object is consisted of a set of points, with the starting and ending points coincide.
Below is a simple region object in JSON format:
{
"id": 1,
"parts": [4],
"points": [{
"x": -12.908614415006994,
"y": 407.37026387547877
},
{
"x": -2.916359855276923,
"y": 248.49341637577055
},
{
"x": 250.22075565788498,
"y": 305.782342518223
},
{
"x": 185.2711010196395,
"y": 413.3656166113168
},
{
"x": -12.908614415006994,
"y": 407.37026387547877
}],
"style": null,
"type": "REGION"
}