Package mil.nga.grid.features
Class Line
- java.lang.Object
-
- mil.nga.sf.Geometry
-
- mil.nga.sf.Curve
-
- mil.nga.sf.LineString
-
- mil.nga.sf.Line
-
- mil.nga.grid.features.Line
-
- All Implemented Interfaces:
Serializable
public class Line extends Line
Line between two points- Author:
- osbornb
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Line
copy()
Copy the linePoint
getPoint1()
Get the first pointPoint
getPoint2()
Get the second pointUnit
getUnit()
Get the unitPoint
intersection(Line line)
Get the intersection between this line and the provided lineboolean
isDegrees()
Is this line in degreesboolean
isMeters()
Is this line in metersboolean
isUnit(Unit unit)
Is in the provided unit typestatic Line
line(Line line)
Copy a linestatic Line
line(Point point1, Point point2)
Create a linevoid
setPoint1(Point point1)
Set the first pointvoid
setPoint2(Point point2)
Set the second pointvoid
setPoints(Point point1, Point point2)
Set the pointsLine
toDegrees()
Convert to degreesLine
toMeters()
Convert to metersLine
toUnit(Unit unit)
Convert to the unit-
Methods inherited from class mil.nga.sf.LineString
addPoint, addPoints, endPoint, equals, getPoint, getPoints, hashCode, isEmpty, isSimple, numPoints, startPoint
-
Methods inherited from class mil.nga.sf.Geometry
expandEnvelope, getCentroid, getDegreesCentroid, getDimension, getEnvelope, getGeometryType, hasM, hasZ, is3D, isMeasured, setHasM, setHasZ, updateZM
-
-
-
-
Method Detail
-
line
public static Line line(Point point1, Point point2)
Create a line- Parameters:
point1
- first pointpoint2
- second point- Returns:
- line
-
getPoint1
public Point getPoint1()
Get the first point- Returns:
- first point
-
setPoint1
public void setPoint1(Point point1)
Set the first point- Parameters:
point1
- first point
-
getPoint2
public Point getPoint2()
Get the second point- Returns:
- second point
-
setPoint2
public void setPoint2(Point point2)
Set the second point- Parameters:
point2
- second point
-
setPoints
public void setPoints(Point point1, Point point2)
Set the points- Parameters:
point1
- first pointpoint2
- second point
-
getUnit
public Unit getUnit()
Get the unit- Returns:
- unit
-
isUnit
public boolean isUnit(Unit unit)
Is in the provided unit type- Parameters:
unit
- unit- Returns:
- true if in the unit
-
isDegrees
public boolean isDegrees()
Is this line in degrees- Returns:
- true if degrees
-
isMeters
public boolean isMeters()
Is this line in meters- Returns:
- true if meters
-
toUnit
public Line toUnit(Unit unit)
Convert to the unit- Parameters:
unit
- unit- Returns:
- line in units, same line if equal units
-
toDegrees
public Line toDegrees()
Convert to degrees- Returns:
- line in degrees, same line if already in degrees
-
toMeters
public Line toMeters()
Convert to meters- Returns:
- line in meters, same line if already in meters
-
intersection
public Point intersection(Line line)
Get the intersection between this line and the provided line- Parameters:
line
- line- Returns:
- intersection
-
-