Package mil.nga.sf
Class LineString
- java.lang.Object
-
- mil.nga.sf.Geometry
-
- mil.nga.sf.Curve
-
- mil.nga.sf.LineString
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
CircularString,Line,LinearRing
public class LineString extends Curve
A Curve that connects two or more points in space.- Author:
- osbornb
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description LineString()ConstructorLineString(boolean hasZ, boolean hasM)ConstructorLineString(List<Point> points)ConstructorprotectedLineString(GeometryType type, boolean hasZ, boolean hasM)ConstructorLineString(LineString lineString)Copy Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPoint(Point point)Add a pointvoidaddPoints(List<Point> points)Add pointsGeometrycopy()Copy the geometryPointendPoint()Get the end Point of this Curvebooleanequals(Object obj)PointgetPoint(int n)Returns the Nth pointList<Point>getPoints()Get the pointsinthashCode()booleanisEmpty()Is the Geometry emptybooleanisSimple()Determine if this Geometry has no anomalous geometric points, such as self intersection or self tangencyintnumPoints()Get the number of pointsvoidsetPoints(List<Point> points)Set the pointsPointstartPoint()Get the start Point of this Curve-
Methods inherited from class mil.nga.sf.Geometry
expandEnvelope, getCentroid, getDegreesCentroid, getDimension, getEnvelope, getGeometryType, hasM, hasZ, is3D, isMeasured, setHasM, setHasZ, updateZM
-
-
-
-
Constructor Detail
-
LineString
public LineString()
Constructor
-
LineString
public LineString(boolean hasZ, boolean hasM)Constructor- Parameters:
hasZ- has zhasM- has m
-
LineString
public LineString(LineString lineString)
Copy Constructor- Parameters:
lineString- line string to copy
-
LineString
protected LineString(GeometryType type, boolean hasZ, boolean hasM)
Constructor- Parameters:
type- geometry typehasZ- has zhasM- has m
-
-
Method Detail
-
addPoint
public void addPoint(Point point)
Add a point- Parameters:
point- point
-
numPoints
public int numPoints()
Get the number of points- Returns:
- number of points
-
getPoint
public Point getPoint(int n)
Returns the Nth point- Parameters:
n- nth point to return- Returns:
- point
-
startPoint
public Point startPoint()
Get the start Point of this Curve- Specified by:
startPointin classCurve- Returns:
- start point
-
endPoint
public Point endPoint()
Get the end Point of this Curve
-
isSimple
public boolean isSimple()
Determine if this Geometry has no anomalous geometric points, such as self intersection or self tangency
-
copy
public Geometry copy()
Copy the geometry
-
isEmpty
public boolean isEmpty()
Is the Geometry empty
-
-