interface Geodesy {

reference: null | CoordinateReference;

area(shape): number;

distance(point1, point2, lineType?): number;

distance3D(point1, point2, lineType?): number;

forwardAzimuth(point1, point2, lineType?): number;

interpolate(startPoint, endPoint, fraction, lineType?): Point;

interpolate(point, distance, azimuth, lineType?): Point;

shortestDistanceToLine(fromPoint, linePointOne, linePointTwo, options, resultPointSFCT): number;

}

reference: null | CoordinateReference;

area(shape): number;

distance(point1, point2, lineType?): number;

distance3D(point1, point2, lineType?): number;

forwardAzimuth(point1, point2, lineType?): number;

interpolate(startPoint, endPoint, fraction, lineType?): Point;

interpolate(point, distance, azimuth, lineType?): Point;

shortestDistanceToLine(fromPoint, linePointOne, linePointTwo, options, resultPointSFCT): number;

}

The reference in which this geodesy performs its calculations

- area(shape): number
Calculates the area of the given shape.

Beware: this method calculates the 2D area of the passed shape. I.e. it ignore the z-values of the shape that is passed to this method.

As an additional consequence, using a shape defined in a geocentric (3D cartesian) reference can not work correctly when using a cartesian geodesy. In that case, a ProgrammingError is thrown.

Note: Currently only polygons are supported.

#### Parameters

- shape: Shape
The shape for which to calculate the area.

#### Returns number

The area of the shape in m^2.

- shape: Shape

- distance(point1, point2, lineType?): number
Calculates the distance between two points in meters in 2D space.

If the reference of a point is

`null`

it will be assumed to be the same as this instance's calculation reference.#### Parameters

- point1: Point
the first point

- point2: Point
the second point

`Optional`

lineType: LineTypethe type of line along which to calculate the distance (LineType.SHORTEST_DISTANCE if not specified)

#### Returns number

the distance between the two points in meters

- point1: Point

- distance3D(point1, point2, lineType?): number
Calculates the distance between two points in 3D space expressed in meters (Cartesian Geodesy only).

This method can be used only on Geodesy instances created by createCartesianGeodesy. Invoking this method on other types of Geodesy results in throwing a ProgrammingError.

#### Parameters

- point1: Point
the first point

- point2: Point
the second point

`Optional`

lineType: LineTypethe type of line along which to calculate the distance (LineType.SHORTEST_DISTANCE if not specified)

#### Returns number

the distance between two points in 3D space expressed in meters.

#### Throws

ProgrammingError if method invoked on incorrect Geodesy instance.

- point1: Point

- forward
Azimuth (point1, point2, lineType?): number Calculates the forward azimuth between two points.

If the reference of a point is null it will be assumed to be the same as this instances calculation reference.

#### Parameters

- point1: Point
the first point

- point2: Point
the second point

`Optional`

lineType: LineTypethe type of line along which to calculate the distance (LineType.SHORTEST_DISTANCE if not specified)

#### Returns number

the forward azimuth between the two points in degrees

- point1: Point

- interpolate(startPoint, endPoint, fraction, lineType?): Point
Interpolate a point at the fraction of the segment defined by the two points.

If the reference of the input point(s) is null it will be assumed to be the same as this instance's calculation reference.

#### Parameters

- startPoint: Point
the starting point

- endPoint: Point
the end point.

- fraction: number
a fraction between 0.0 and 1.0.

`Optional`

lineType: LineTypethe line type along which to compute the point (LineType.SHORTEST_DISTANCE if not specified)

#### Returns Point

an interpolated point specified with respect to the calculation reference

- startPoint: Point
- interpolate(point, distance, azimuth, lineType?): Point
Computes the point at a given distance and azimuth from the given point.

If the reference of the input point(s) is null it will be assumed to be the same as this instance's calculation reference.

If the distance is negative, this will result in an interpolation in the opposite direction.

#### Parameters

- point: Point
the starting point

- distance: number
the distance in meters

- azimuth: number
the azimuth (this is an angle in degrees)

`Optional`

lineType: LineTypethe line type along which to compute the point (LineType.SHORTEST_DISTANCE if not specified)

#### Returns Point

an interpolated point specified with respect to the calculation reference

- point: Point

- shortest
Distance (fromPoint, linePointOne, linePointTwo, options, resultPointSFCT): numberTo Line Calculates the shortest distance from point

`fromPoint`

to the line`linePointOne-linePointTwo`

. Puts the result in the given point as a side effect, and returns the distance from`fromPoint`

to that calculated point.#### Parameters

- fromPoint: Point
The point from which to calculate the distance to the line.

- linePointOne: Point
The first point of the line

- linePointTwo: Point
The second point of the line

- options: ShortestDistanceToLineOptions
The options for the calculation

- resultPointSFCT: Point
Point on the line

`linePointOne-linePointTwo`

that is calculated to be at the shortest distance from`fromPoint`

. This point may be clipped onto the line segment depending on the value of`clipToSegment`

property in the`options`

.

#### Returns number

The distance to the line (or line segment) in meters

- fromPoint: Point

Provides geodesy calculations. Use the factory methods in the GeodesyFactory module to create instances of this interface. For boolean operations on shapes see the ConstructiveGeometryFactory module.