Line
Static Method Summary
Static Public Methods | ||
public static |
get a new Line that is a copy (clone) of the otherLine passed has parameter |
Constructor Summary
Public Constructor | ||
public |
constructor(startPoint: Point, endPoint: Point, params: Object) Creates a line |
Member Summary
Public Members | ||
public get |
Get the endPoint value. |
|
public set |
Set the endPoint value |
|
public get |
startPoint: Point: * Get the starting Point. |
|
public set |
startPoint(otherPoint: Point) Set the starting Point. |
Private Members | ||
private |
_endPoint: * |
|
private |
_options: * |
|
private |
_startPoint: * |
Method Summary
Public Methods | ||
public |
give the length of the line |
|
public |
gives the slope of the line or m defined as Δy/Δx in the line equation y = m*x + b (b is y-intercept) |
|
public |
give the array [deltaX, deltaY] corresponding to difference in cartesian coordinates of this line |
|
public |
gives the y-intercept of the line or b in the line equation y = m*x + b (m is the Slope defined as Δy/Δx) |
|
public |
give an array representation of this Line class instance, you can use Array.flatten() to convert to [x1, y1, x2, y2] if flatten is not implemented use reduce instead : arrResult.reduce((acc, val) => acc.concat(val), []); |
|
public |
give an Postgis Extended Well-known text (EWKT) representation of this class instance https://postgis.net/docs/using_postgis_dbmanagement.html#EWKB_EWKT |
|
public |
give a GeoJSON geometry (http://geojson.org/) representation of this class instance geometry |
|
public |
give a string representation of this Line class instance |
|
public |
give an OGC Well-known text (WKT) representation of this class instance https://en.wikipedia.org/wiki/Well-known_text |
Static Public Methods
Public Constructors
Public Members
Private Members
private _endPoint: * source
private _options: * source
private _startPoint: * source
Public Methods
public getSlope(): number source
gives the slope of the line or m defined as Δy/Δx in the line equation y = m*x + b (b is y-intercept)
public getVectorArray(): number source
give the array [deltaX, deltaY] corresponding to difference in cartesian coordinates of this line
public getYIntercept(): number source
gives the y-intercept of the line or b in the line equation y = m*x + b (m is the Slope defined as Δy/Δx)
public toArray(): Array source
give an array representation of this Line class instance, you can use Array.flatten() to convert to [x1, y1, x2, y2] if flatten is not implemented use reduce instead : arrResult.reduce((acc, val) => acc.concat(val), []);
public toEWKT(srid: number): string source
give an Postgis Extended Well-known text (EWKT) representation of this class instance https://postgis.net/docs/using_postgis_dbmanagement.html#EWKB_EWKT
Params:
Name | Type | Attribute | Description |
srid | number | is the Spatial reference systems identifier EPSG code default is 21781 for Switzerland MN03 |
public toGeoJSON(): string source
give a GeoJSON geometry (http://geojson.org/) representation of this class instance geometry
public toWKT(): string source
give an OGC Well-known text (WKT) representation of this class instance https://en.wikipedia.org/wiki/Well-known_text