# geo-identify-position-format

> Identifies geometry position format as flat array, array of arrays, typed array, or 1D ndarray.

Latest version **1.0.2** (published 2015-12-27) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install geo-identify-position-format
pnpm add geo-identify-position-format
yarn add geo-identify-position-format
bun add geo-identify-position-format
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-12-27 |
| First published | 2015-12-27 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Rye Terrell |
| Maintainers | wwwtyro |
| Keywords | stackgl, geometry |

## Links

- npm: https://www.npmjs.com/package/geo-identify-position-format
- Repository: https://github.com/wwwtyro/geo-identify-position-format
- Homepage: https://github.com/wwwtyro/geo-identify-position-format#readme
- Issues: https://github.com/wwwtyro/geo-identify-position-format/issues
- npm.io page: https://npm.io/package/geo-identify-position-format

## Dependencies (2)

- [isndarray](https://npm.io/package/isndarray.md) ^1.0.0
- [is-typedarray](https://npm.io/package/is-typedarray.md) ^1.0.0

## Recent versions

- 1.0.2 (latest) — 2015-12-27
- 1.0.1 — 2015-12-27
- 1.0.0 — 2015-12-27

## README

# geo-identify-position-format

Identifies a few common geometry position formats.

## Install

```sh
npm install geo-identify-position-format
```

## Use
```js
var geoid = require('geo-identify-position-format');
```

#### `geoid.identify(positions)`

returns one of:

* `geoid.FLAT_ARRAY`
* `geoid.ARRAY_OF_ARRAYS`
* `geoid.TYPED_ARRAY`
* `geoid.ARRAY_OF_TYPED_ARRAYS`
* `geoid.NDARRAY`

when `positions` has one of the following formats:

* Flat arrays `[1,2,3,4,5,6]`
* Array of arrays `[[1,2,3], [4,5,6]]`
* Array of TypedArrays `[new Float32Array([1,2,3]), new Float32Array([4,5,6])]`
* TypedArray `new Float32Array([1,2,3,4,5,6])`
* [ndarray](https://www.npmjs.com/package/ndarray) `ndarray(new Float32Array([1,2,3,4,5,6]))`

If `positions` does not have one of the previously listed formats, `geoid.identify`
will throw an error.

## Credits

Extracted from [@hughsk](https://twitter.com/hughskennedy)'s [gl-geometry](https://github.com/hughsk/gl-geometry).

---
_Source: https://npm.io/package/geo-identify-position-format · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
