- Direct Known Subclasses:
public abstract class Segment extends java.lang.ObjectA segment represents an edge of a multipart geometry, connecting a start to an end point.
A segment describes a continuous line between a start location and an end location. The ArcGIS Platform, including ArcGIS Runtime, supports both linear segments (represented by
LineSegment) and curve segments,(represented by
GeometryEngine.densify(Geometry, double)can translate curve segments into multiple
LineSegmentinstances to approximate the curve.
Multipartgeometry is a collection of
Segmentinstances, where the end of one segment is at exactly the same location as the start of the following segment.
Multipartgeometries can be composed from and decomposed into their constituent segments if required.
Because a single location is shared by adjacent segments, a single
Pointobject is used to represent the shared location when you iterate through the points in a part. As a result, when iterating through the points in a part of a polyline or polygon, there will be one more point than the number of segments in that same part.
Segments are immutable so you can not change a segment's shape once it is created. For workflows that involve geometry editing, create a new segment with the properties you require.
From v100.12, curve segments are supported in geometry editing workflows. You can add curve segments to a
MultipartBuilder, and if a geometry has curves (
Geometry.hasCurves()is true) then curve segments will be returned where applicable from the
ImmutablePartcollections that comprise the multipart geometry. Curve and linear segments can be mixed together in the same geometry.
Like the geometries they comprise, a
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
getEndPoint()Gets a Point representing the end of this Segment.
getSpatialReference()Gets the SpatialReference of this Segment.
getStartPoint()Gets a Point representing the start of this Segment.
isClosed()Indicates if this segment is closed, that is it has a matching start and end point.
isCurve()Indicates if this Segment is curved.
public Point getStartPoint()Gets a Point representing the start of this Segment.
- the start point
public Point getEndPoint()Gets a Point representing the end of this Segment.
- the end point
public SpatialReference getSpatialReference()Gets the SpatialReference of this Segment.
- the SpatialReference of this Segment.
public boolean isCurve()Indicates if this Segment is curved. Prior to v100.12, only
LineSegmentinstances were supported when creating new geometries using a
MultipartBuilderor iterating the
Segmentinstances in an existing
From v100.12, you can add curve segments when using a
MultipartBuilder, and get them back from an existing
- false if the object is a
LineSegment; true otherwise
- See Also:
public boolean isClosed()Indicates if this segment is closed, that is it has a matching start and end point.
- true if the segment is closed, false otherwise