IPixelMultiPolygonGeometry
Extends IPixelGeometry.
Interface for the "Multipolygon" pixel geometry.
Constructor | Fields | Methods
Constructor
IPixelMultiPolygonGeometry()
Fields
Name |
Type |
Description |
Event manager. Inherited from IEventEmitter. |
Methods
Name |
Returns |
Description |
Boolean |
Checks whether the passed point is located inside the multipolygon. |
|
Boolean |
Returns true if the passed geometry is equivalent to the given one. Inherited from IPixelGeometry. |
|
Number[][]|null |
Returns coordinates of the two opposite corners of the area that surrounds the geometry. The first item in the array is the corner with the smallest coordinate values relative to the rest of the points in the area; the second item is the corner with the largest coordinate values. Inherited from IBaseGeometry. |
|
Object |
Searches for the point nearest to "anchorPosition" on the multipolygon contour. |
|
Number[][][][] |
Returns coordinates of the multipolygon. |
|
String |
Returns the string ID that defines the multipolygon fill rule. The ID can have one of two values:
|
|
Integer |
Returns the number of polygons in the multipolygon. |
|
Object |
Returns metadata of the pixel geometry. Inherited from IPixelGeometry. |
|
getType() |
String |
Returns ID of the geometry type. Inherited from IBaseGeometry. |
Creates a scaled copy of the geometry. Inherited from IPixelGeometry. |
||
Creates a copy of the geometry that is shifted by the specified amount. Inherited from IPixelGeometry. |
Methods details
contains
{Boolean} contains(position)
Checks whether the passed point is located inside the multipolygon.
Returns indicator for whether the point belongs to the multipolygon.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[] Coordinates of a point. |
* Mandatory parameter/option.
getClosest
{Object} getClosest(anchorPosition)
Searches for the point nearest to "anchorPosition" on the multipolygon contour.
Returns an object with the following fields:
- position - The point on the multipolygon contour that is nearest to "anchorPosition".
- distance - Distance from "anchorPosition" to "position".
- closestPointIndex - Index of the multipolygon vertex closest to "position".
- nextPointIndex - Index of the multipolygon vertex that follows "position".
- prevPointIndex - Index of the multipolygon vertex that precedes "position".
- pathIndex - Index of the multipolygon contour that the found point is associated with.
The "nextPointIndex" and "prevPointIndex" fields may be omitted if "position" coincides with one of the multipolygon vertexes.
Parameters:
Parameter |
Default value |
Description |
— |
Type: Number[] Coordinates of a point for which the nearest vertex on the polygon contour is calculated. |
* Mandatory parameter/option.
getCoordinates
{Number[][][][]} getCoordinates()
Returns coordinates of the multipolygon.
getFillRule
{String} getFillRule()
Returns the string ID that defines the multipolygon fill rule. The ID can have one of two values:
- evenOdd - Algorithm that checks whether a point is located in the fill area by drawing a ray from this point to infinity in any direction, and counting the number of contour segments in this shape that are crossed by this ray. If the number is odd, the point is inside it; if even, the point is outside it.
- nonZero - Algorithm that checks whether a point is located in the fill area by drawing a ray from this point to infinity in any direction, and checking the points at which a segment of the shape crosses this ray. Starting from zero, one is added each time a segment crosses the ray from left to right, and one is subtracted each time a segment crosses the ray from right to left. If the result equals zero, the point is inside the contour. Otherwise, it is outside it.
getLength
{Integer} getLength()
Returns the number of polygons in the multipolygon.
Mandatory parameter/option.