long createPolygon(string ck, string fc, string xList, string yList)
This method creates a new polygon feature with CARIS Key and Feature Code given by ck and fc, respectively, and with boundary given by xList and yList. The arguments xList and yList must be comma-separated lists of corresponding x and y locations, respectively, in the current Exchange Coordinate System, unless the map type is NRMR (See Map Types).
If the given coordinate arrays do not close, i.e. if (x0, y0) does not equal (xn-1, yn-1), an extra vertex, identical to the 0th vertex, is added to close the polygon. However, other necessary attributes of the given coordinate arrays must be set properly, i.e.
The boundary cannot contain duplicate points.
The boundary cannot cross itself.
This method can also be used in conjunction with the helper method presetPolygonHole to create a complex polygon, i.e. a polygon with any number of holes. Call the helper method once for each hole, prior to calling createPolygon. Any holes so defined at the time createPolygon is called are incorporated into the new polygon. A hole must lie entirely within the parent polygon.
The polygon feature is created with the current defaults for line weight, line style, fill style, and color, as well as the current default restriction. These defaults can be modified by the ShapeAPI methods:
respectively, by calling one or more of them prior to createPolygon.
The method returns 0 upon success, and returns error codes for the following conditions:
xList and yList do not have the same number of elements
The given coordinates are invalid
Placement is restricted (the default) and the given polygon lies outside the map’s cover
Placement is restricted and the map has no cover (this occurs if the map has no features)
Invalid polygon, i.e. duplicate points, boundary crosses itself, and/or hole boundary crosses itself or outer boundary
A CSF error occurred when trying to create the feature. (This should normally not occur, and would most likely indicate a corrupted map dataset.)