public final class

Line

extends Segment
implements Serializable
java.lang.Object
   ↳ com.esri.core.geometry.Geometry
     ↳ com.esri.core.geometry.Segment
       ↳ com.esri.core.geometry.Line

Class Overview

A straight line between a pair of points.

Summary

[Expand]
Inherited Fields
From class com.esri.core.geometry.Geometry
Public Constructors
Line()
Creates a line segment.
Public Methods
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.
Geometry.Type getType()
Returns the geometry type.
int intersectionWithAxis2D(boolean bAxisX, double ordinate, double[] resultOrdinates, 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.
void queryEnvelope(Envelope env)
Gets the axis aligned bounding box of the geometry.
[Expand]
Inherited Methods
From class com.esri.core.geometry.Segment
From class com.esri.core.geometry.Geometry
From class java.lang.Object

Public Constructors

public Line ()

Creates a line segment.

Public Methods

public void applyTransformation (Transformation2D transform)

Applies 2D affine transformation in XY plane.

Parameters
transform The affine transformation to be applied to this geometry.

public double calculateLength2D ()

Calculates the length of the geometry. If the spatial reference is a Geographic Coordinate System (a system where coordinates are defined using angular units such as longitude and latitude) then the 2D distance calculation is returned in angular units. In cases where length must be calculated on a Geographic Coordinate System consider the using the geodeticLength method in GeometryEngine.

Returns
  • A double value representing the 2D length of the geometry.

public Geometry createInstance ()

Creates an instance of an empty geometry of the same type.

public Geometry.Type getType ()

Returns the geometry type.

Returns
  • Returns the geometry type.

public int intersectionWithAxis2D (boolean bAxisX, double ordinate, double[] resultOrdinates, double[] parameters)

Calculates intersection points of this segment with an infinite line, parallel to one of the axes.

Parameters
bAxisX 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).
resultOrdinates 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.
Returns
  • The number of intersection points, 0 when no intersection points exist, -1 when the segment coincides with the line (infinite number of intersection points).

public boolean isCurve ()

Indicates if the line segment is a curve.

public void queryEnvelope (Envelope env)

Gets the axis aligned bounding box of the geometry.

Parameters
env The envelope to return the result in.