Take in any polygon or polyline argument and return array of coordinates. The returned array is always a copy of initial argument.
const parsePoly = require('parse-poly')
parsePoly('10 20 30 40 50 60')
parsePoly(10, 20, 30, 40, 50, 60)
parsePoly([10, 20, 30, 40, 50, 60])
parsePoly([10, 20], [30, 40], [50, 60])
parsePoly([[10, 20], [30, 40], [50, 60]])
parsePoly(new Float32Array([10, 20, 30, 40, 50, 60]))
parsePoly([new Float32Array([10, 20]), new Float32Array([30, 40]), new Float32Array([50, 60])])
parsePoly([{x: 10, y: 20}, {x: 30, y: 40}, {x: 50, y: 60}])
parsePoly({
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [[10, 20], [30, 40], [50, 60]]
}
})
(c) 2018 Dmitry Yv. MIT License