Part

Represents a single part of a multipart geometry (polygon or polyline). A collection of Segment objects that together represent a part in a Multipart geometry. You can also access the Point objects that represent the vertices of the geometry (that is, the ends of each segment), using point-based helpers such as Part.getPoint(Int).

Prior to v100.12, the only supported segment type was LineSegment. If the underlying geometry contained curve segments (Geometry.hasCurves is true) then the curve information was lost when iterating through the segments in that part.

From v100.12, curve segments may be returned from Part.getSegment(Int). A part may contain a mix of linear and curve segments.

Since

200.1.0

Properties

Link copied to clipboard

The end point of the last segment in the part. Returns null if the collection is empty.

Link copied to clipboard

Indicates if the part contains any curve segments. Prior to v100.12, if this property returned true, there was no way to access the curve segment information contained by the part. Retrieving the Segment instances of the part would return only LineSegment instances.

Link copied to clipboard

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.

Link copied to clipboard

An Iterable for iterating over the points in the part.

Link copied to clipboard

The count of segments in the part.

Link copied to clipboard
open override val size: Int

The count of segments in the part.

Link copied to clipboard

The spatial reference for the immutable part. If the collection does not have a spatial reference null is returned.

Link copied to clipboard

The start point of the first segment in the part. Returns null if the collection is empty.

Functions

Link copied to clipboard
open operator override fun get(index: Int): Segment

Gets a segment at a specified segment index.

Link copied to clipboard

For a segment at a specified segmentIndex the method returns the point index of the segment's end point.

Link copied to clipboard
fun getPoint(pointIndex: Int): Point

Returns a point at a specified point index. 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.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

For a segment at a specified segmentIndex the method returns the point index of the segment's start point.

Link copied to clipboard
open override fun isEmpty(): Boolean

Indicates if the part contains no segments.

Inherited functions

Link copied to clipboard
open operator override fun contains(element: Segment): Boolean
Link copied to clipboard
open override fun containsAll(elements: Collection<Segment>): Boolean
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun forEach(p0: Consumer<in Segment>)
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun indexOf(element: Segment): Int
Link copied to clipboard
open operator override fun iterator(): Iterator<Segment>
Link copied to clipboard
open override fun lastIndexOf(element: Segment): Int
Link copied to clipboard
open override fun listIterator(): ListIterator<Segment>
open override fun listIterator(index: Int): ListIterator<Segment>
Link copied to clipboard
Link copied to clipboard
open override fun spliterator(): Spliterator<Segment>
Link copied to clipboard
open fun stream(): Stream<Segment>
Link copied to clipboard
open override fun subList(fromIndex: Int, toIndex: Int): List<Segment>
Link copied to clipboard
open fun <T : Any> toArray(p0: IntFunction<Array<T>>): Array<T>
Link copied to clipboard
open override fun toString(): String