JSPM

parse-poly

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q14833F
  • License MIT

Parse any input polygon or polyline format

Package Exports

  • parse-poly

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (parse-poly) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

parse-poly experimental Build Status

Take in any polygon or polyline argument and return array of coordinates. The returned array is always a copy of initial argument.

npm install parse-poly

const parsePoly = require('parse-poly')

// [[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([[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]]
  }
})

License

(c) 2018 Dmitry Yv. MIT License