Module: src/getCentroid

Methods

(static) getCentroid(gr, toProjection) → {object}

Given a grid reference (British National Grid, Irish Grid or UTM zone 30N shorthand), and a two-letter code defining the requested output projection, this function returns the centroid of the grid reference.
Parameters:
Name Type Description
gr string the grid reference
toProjection string two letter code specifying the required output CRS.
Source:
Returns:
- of the form {centroid: [x, y], proj: 'code'}; x and y are coordinates in CRS specified by toProjection. The proj code indicates the source projection.
Type
object