public final class Line extends Segment implements Serializable
Geometry.GeometryAccelerationDegree, Geometry.GeometryType, Geometry.Type| Constructor and Description |
|---|
Line()
Creates a line segment.
|
Line(double x1,
double y1,
double x2,
double y2) |
| Modifier and Type | Method and Description |
|---|---|
void |
applyTransformation(Transformation2D transform)
Applies 2D affine transformation in XY plane.
|
double |
calculateLength2D()
Calculates the length of the geometry.
|
Geometry |
createInstance()
Creates an instance of an empty geometry of the same type.
|
Segment |
cut(double t1,
double t2)
Returns subsegment between parameters t1 and t2.
|
boolean |
equals(Object other) |
long |
estimateMemorySize()
Returns an estimate of this object size in bytes.
|
double |
getAttributeAsDbl(double t,
int semantics,
int ordinate)
Returns the attribute on the segment for the given parameter value.
|
double |
getClosestCoordinate(Point2D inputPt,
boolean bExtrapolate)
Finds a closest coordinate on this segment.
|
void |
getCoord2D(double t,
Point2D pt)
Returns the coordinate of the point on this segment for the given
parameter value (segments are parametric curves).
|
Geometry.Type |
getType()
Returns the geometry type.
|
int |
intersectionWithAxis2D(boolean b_axis_x,
double ordinate,
double[] result_ordinates,
double[] parameters)
Calculates intersection points of this segment with an infinite line,
parallel to one of the axes.
|
boolean |
isCurve()
Indicates if the line segment is a curve.
|
boolean |
isIntersecting(Point2D pt,
double tolerance)
Returns True if point and the segment intersect (not disjoint) for the
given tolerance.
|
void |
queryEnvelope(Envelope env)
Returns the axis aligned bounding box of the geometry.
|
void |
queryEnvelope2D(Envelope2D env)
Returns tight bbox of the Geometry in X, Y plane.
|
void |
replaceNaNs(int semantics,
double value)
Replaces NaNs in the attribute with the given value.
|
String |
toString()
The output of this method can be only used for debugging.
|
_assignVertexDescriptionImpl, calculateArea2D, copyTo, distance, getBoundary, getCoord2D, getDimension, getEndAttributeAsDbl, getEndAttributeAsInt, getEndX, getEndXY, getEndXY, getEndXYZ, getEndY, getStartAttributeAsDbl, getStartAttributeAsInt, getStartX, getStartXY, getStartXY, getStartXYZ, getStartY, isEmpty, isEmptyImpl, isIntersecting, queryEnd, queryInterval, queryStart, setEmpty, setEnd, setEndAttribute, setEndAttribute, setEndXY, setEndXY, setEndXYZ, setEndXYZ, setStart, setStartAttribute, setStartAttribute, setStartXY, setStartXY, setStartXYZ, setStartXYZ_getImpl, addAttribute, addID, addM, assignVertexDescription, copy, dropAllAttributes, dropAttribute, estimateMemorySize, getDescription, getDimensionFromType, getStateFlag, hasAttribute, hasID, hasM, hasZ, isArea, isLinear, isMultiPath, isMultiVertex, isPoint, isSegment, mergeVertexDescription, queryLooseEnvelope2D, vertex_countpublic Line()
public Line(double x1,
double y1,
double x2,
double y2)
public Geometry.Type getType()
Geometrypublic long estimateMemorySize()
Geometry
This estimate doesn't include the size of the VertexDescription object
because instances of VertexDescription are shared among
geometry objects.
estimateMemorySize in class Geometrypublic double calculateLength2D()
GeometryGeometryEnginecalculateLength2D in class Geometrypublic boolean isCurve()
public void queryEnvelope(Envelope env)
GeometryqueryEnvelope in class Geometryenv - The envelope to return the result in.public void queryEnvelope2D(Envelope2D env)
GeometryqueryEnvelope2D in class Geometryenv - The envelope to return the result in.public void applyTransformation(Transformation2D transform)
GeometryapplyTransformation in class Geometrytransform - The affine transformation to be applied to this geometry.public Geometry createInstance()
GeometrycreateInstance in class Geometrypublic void getCoord2D(double t,
Point2D pt)
SegmentgetCoord2D in class Segmentt - the parameter coordinate along the segment from 0.0 to 1.0.
Value of 0 returns the start point, 1 returns end point.pt - the coordinate where result will be placed.public Segment cut(double t1, double t2)
Segmentpublic double getAttributeAsDbl(double t,
int semantics,
int ordinate)
SegmentgetAttributeAsDbl in class Segmentpublic double getClosestCoordinate(Point2D inputPt, boolean bExtrapolate)
SegmentgetClosestCoordinate in class SegmentinputPt - The 2D point to find the closest coordinate on this segment.bExtrapolate - TRUE if the segment is extrapolated at the end points along
the end point tangents. Otherwise the result is limited to
values between 0 and 1.public int intersectionWithAxis2D(boolean b_axis_x,
double ordinate,
double[] result_ordinates,
double[] parameters)
SegmentintersectionWithAxis2D in class Segmentb_axis_x - TRUE if the function works with the line parallel to the axis
X.ordinate - The ordinate value of the line (x for axis Y, y for axis X).result_ordinates - The value of ordinate in the intersection points One ordinate
is equal to the ordinate parameter. This parameter can be
NULL.parameters - The value of the parameter in the intersection points (between
0 and 1). This parameter can be NULL.public boolean isIntersecting(Point2D pt, double tolerance)
isIntersecting in class Segmentpublic void replaceNaNs(int semantics,
double value)
GeometryreplaceNaNs in class Geometrysemantics - The semantics for which to replace the NaNs.value - The value to replace NaNs with.Copyright © 2018. All rights reserved.