Package com.luciad.geometries
Class Polyline
java.lang.Object
com.luciad.geometries.Geometry
com.luciad.geometries.Curve
com.luciad.geometries.CompositeCurve
com.luciad.geometries.Polyline
- All Implemented Interfaces:
- AutoCloseable
Represents a polyline.
- See Also:
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()protected voidfinalize()Returns the interpolation type of the line segment.getPoint(long index) Returns the coordinate for the requested index.longReturns the number of points in the polyline.List<@NotNull Coordinate> Returns the list of points of this polyline.insertPoint(long index, Coordinate newLocation) Creates a newPolylinewith an newly inserted control point.movePoint(long index, Coordinate newLocation) Creates a newPolylinewith a moved control point.removePoint(long index) Creates a newPolylinewith a control point removed.translate(Coordinate translation) Translates the entire polyline.Methods inherited from class com.luciad.geometries.CompositeCurvegetCurveAt, getCurveCountMethods inherited from class com.luciad.geometries.CurvecomputePoint, getLength2DMethods inherited from class com.luciad.geometries.GeometrygetBounds, getReference
- 
Method Details- 
finalizeprotected void finalize()- Overrides:
- finalizein class- CompositeCurve
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
- Overrides:
- closein class- CompositeCurve
 
- 
getPointCountpublic long getPointCount()Returns the number of points in the polyline.- Returns:
- the number of points in the polyline.
 
- 
getPointReturns the coordinate for the requested index.- Parameters:
- index- the index of the requested point.
- Returns:
- the point at the index.
- Throws:
- IllegalArgumentException- when requesting an invalid index.
 
- 
getPointsReturns the list of points of this polyline.- Returns:
- the list of points of this polyline.
 
- 
getInterpolationTypeReturns the interpolation type of the line segment.One of - Returns:
- the interpolation type of the line segment.
 
- 
translateTranslates the entire polyline.Note: when the polyline is defined in a geodetic reference and uses geodetic interpolation, the translation is not performed by translating the points one by one. Instead, a translation method is used that better preserves the shape of the polyline when moving it towards (or away from) the poles. - Parameters:
- translation- the translation vector
- Returns:
- a new, translated geometry
 
- 
movePoint@NotNull public Polyline movePoint(long index, @NotNull Coordinate newLocation) throws IllegalArgumentException Creates a newPolylinewith a moved control point.- Parameters:
- index- the index of the point to move. Should be in- [0,.- getPointCount()- 1]
- newLocation- the new location of the point
- Returns:
- a new geometry
- Throws:
- IllegalArgumentException- for an invalid index
 
- 
insertPoint@NotNull public Polyline insertPoint(long index, @NotNull Coordinate newLocation) throws IllegalArgumentException Creates a newPolylinewith an newly inserted control point.- Parameters:
- index- the index of the newly inserted control point. Should be in- [0,. For index 0, a new point will be added at the start of the- getPointCount()]- Polyline. For index- getPointCount(), a new point will be added at the end of the- Polyline. For other index values, a point will be added between 2 other points.
- newLocation- the location of the new point
- Returns:
- a new geometry
- Throws:
- IllegalArgumentException- for an invalid index
 
- 
removePointCreates a newPolylinewith a control point removed.This methods returns a copy of the polyline if its point count is less or equal to 2. - Parameters:
- index- the index of the point to be removed. Should be in- [0,.- getPointCount()- 1]
- Returns:
- a new geometry
- Throws:
- IllegalArgumentException- for an invalid index
 
 
-