Mutable Part
Represents a single part of a multipart builder. Multipart builder is the base class of PolygonBuilder or PolylineBuilder. A part is made up of a collection of segments making the edge of the multipart. Additionally access and modified using the points (vertexes) of segments is available. Adjacent segments which share an end point and a start point are connected and the shared vertex is not duplicated when accessing points. The mutable part can represent gaps between one end point and an adjacent start. However, this is only recommended as a temporary state while modifying a multipart builder, when using GeometryBuilder.toGeometry() the gaps are closed with line segments.
Prior to v100.12, the only supported segment type was LineSegment.
From v100.12, curve segments can be added to a MutablePart and used build polygon and polyline geometries. A part may contain a mix of linear and curve segments.
Since
200.1.0
See also
Properties
Indicates if the part contains any curve segments. Prior to v100.12, only LineSegment linear segments were available to be added to mutable parts when building geometries.
The count of points in the part. The points in the part are the start and end points of segments. Segments can share a point if the end point of one segment matches the start point of the next.
The count of segments in the part.
The spatial reference for the part. If the mutable_part does not have a spatial reference null is returned.
The start point of the first segment in the part. Returns null if the collection is empty.
Functions
Inserts a segment into the part at the specified index. The new segment is inserted at the specified index. This index may be equal to the segment count which is equivalent to adding to the end of the collection. The number of points in the part increases to connect in the new segment.
Add a new point to the end of the part. A new line segment is added to connect the new point to the previous. The points in the part are the start and end points of segments. A new line segment is added to connect the new point to the previous point. If this is the first point in an empty segment, a single closed segment is added using the same start and end point. Adding a second point updates this line segment to gain a distinct end point. Adding subsequent points adds new line segments.
Add a new point to the end of the part by specifying the points x,y coordinates. A new line segment is added to connect the new point to the previous. The points in the part are the start and end points of segments. A new line segment is added to connect the new point to the previous point. If this is the first point in an empty segment, a single closed segment is added using the same start and end point. Adding a second point updates this line segment to gain a distinct end point. Adding subsequent points adds new line segments.
Inserts a point into the part at the specified point index. Line segments are added to connect the point to adjacent segments. The point index can be equal to the point count and this is equivalent to adding a point to the end of the collection. The points in the part are the start and end points of segments. An existing segment connection the point before or after the point index is removed. Inserting a new point inserts new line segments connecting the adjacent points.
Add a new point to the end of the part by specifying the points x,y,z coordinates. A new line segment is added to connect the new point to the previous. The points in the part are the start and end points of segments. A new line segment is added to connect the new point to the previous point. If this is the first point in an empty segment, a single closed segment is added using the same start and end point. Adding a second point updates this line segment to gain a distinct end point. Adding subsequent points adds new line segments.
Inserts a point specified by its x,y coordinates into the part at the specified point index. Line segments are added to connect the point to adjacent segments. The point index can be equal to the point count and this is equivalent to adding a point to the end of the collection. The points in the part are the start and end points of segments. An existing segment connection the point before or after the point index is removed. Inserting a new point inserts new line segments connecting the adjacent points.
Inserts a point specified by its x,y,z coordinate into the part at the specified point index. Line segments are added to connect the point to adjacent segments. The point index can be equal to the point count and this is equivalent to adding a point to the end of the collection. The points in the part are the start and end points of segments. An existing segment connection the point before or after the point index is removed. Inserting a new point inserts new line segments connecting the adjacent points.
For a segment at a specified segmentIndex the method returns the point index of the segment's end point.
Converts from a point index to a segment index that uses the given point as an end point. If the point is not an end point then -1 is returned.
Converts from a point index to a segment index that uses the given point as a start point. If the point is not a start point then -1 is returned.
For a segment at a specified segmentIndex the method returns the point index of the segment's start point.
Removes a point from the part. Segments connecting to this point are removed and the gap filled with a new line segment. The points in the part are the start and end points of segments. Removing a point can remove the two adjacent segments. A new line segment reconnects the gap.
Replace a point in the part at the specified point index. Segments that use this point are changed. The points in the part correspond to start and end points of segments. Setting a new point affects 1 or 2 segments using the point at the specified index. The type of affected segment(s) (LineSegment, CubicBezierSegment or EllipticArcSegment) remains the same.