Skip to main content

Function: metersPerUnit()

metersPerUnit(unit, semiMajorAxis?): number

Defined in: utils.ts:18

Coefficient to convert the coordinate reference system (CRS) units into meters (metersPerUnit).

From note g in http://docs.opengeospatial.org/is/17-083r2/17-083r2.html#table_2:

If the CRS uses meters as units of measure for the horizontal dimensions, then metersPerUnit=1; if it has degrees, then metersPerUnit=2pa/360 (a is the Earth maximum radius of the ellipsoid).

Parameters

unit

The unit of the CRS.

"m" | "metre" | "meter" | "meters" | "foot" | "us survey foot" | "degree"

semiMajorAxis?

The semi-major axis of the ellipsoid, required if unit is 'degree'.

semiMajorAxis?

number

Returns

number

The meters per unit conversion factor.