Closed DenisCarriere closed 6 years ago
Having both methods lonlatsToCoords & coordsToLonlats allows to convert Geometry coordinates in both directions.
lonlatsToCoords
coordsToLonlats
/** * Converts GeoJSON LineString Coords to lonlats * * @param {Array<Array<number, number>>} coords GeoJSON LineString coordinates * @returns {Array<number>} lonlats Single Array of paired longitudes & latitude * @example * const lonlats = coordsToLonlats([[110, 45], [120, 55]]); * lonlats // => [110, 45, 120, 55] */ export function coordsToLonlats(coords: number[][]) {
Having both methods
lonlatsToCoords
&coordsToLonlats
allows to convert Geometry coordinates in both directions.