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)
Constructorprotected
LineString(GeometryType type, boolean hasZ, boolean hasM)
ConstructorLineString(LineString lineString)
Copy Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPoint(Point point)
Add a pointvoid
addPoints(List<Point> points)
Add pointsGeometry
copy()
Copy the geometryPoint
endPoint()
Get the end Point of this Curveboolean
equals(Object obj)
Point
getPoint(int n)
Returns the Nth pointList<Point>
getPoints()
Get the pointsint
hashCode()
boolean
isEmpty()
Is the Geometry emptyboolean
isSimple()
Determine if this Geometry has no anomalous geometric points, such as self intersection or self tangencyint
numPoints()
Get the number of pointsvoid
setPoints(List<Point> points)
Set the pointsPoint
startPoint()
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:
startPoint
in 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
-
-