# is-wkt

> Small Function to Check if a String is Probably Well-Known Text

Latest version **0.2.0** (published 2023-06-30) · CC0-1.0 license · 0 weekly downloads

## Install

```sh
npm install is-wkt
pnpm add is-wkt
yarn add is-wkt
bun add is-wkt
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2023-06-30 |
| First published | 2021-11-12 |
| Weekly downloads | 0 |
| License | CC0-1.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Daniel J. Dufour |
| Maintainers | danieljdufour |
| Keywords | esri, ogc, projection, wkt |

## Links

- npm: https://www.npmjs.com/package/is-wkt
- Repository: https://github.com/DanielJDufour/is-wkt
- Homepage: https://github.com/DanielJDufour/is-wkt#readme
- Issues: https://github.com/DanielJDufour/is-wkt/issues
- npm.io page: https://npm.io/package/is-wkt

## Recent versions

- 0.2.0 (latest) — 2023-06-30
- 0.1.0 — 2023-05-13
- 0.0.1 — 2021-11-12

## README

# is-wkt
Small Library to Check if a String is Probably [Well-Known Text](https://en.wikipedia.org/wiki/Well-known_text_representation_of_coordinate_reference_systems)

# background
Most of the algorithm and the code is taken from the [testWKT](https://github.com/proj4js/proj4js/blob/315398ea924c3169a257e3cf9796bc3d120039ee/lib/parseCode.js#L12) function in [proj4js](https://github.com/proj4js/proj4js) whose license is found [here](https://github.com/proj4js/proj4js/blob/master/LICENSE.md).

# install
```bash
npm install is-wkt
```

# usage
```js
import isWKT from "is-wkt";

isWKT(`PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs"],AUTHORITY["EPSG","3857"]]`);
// true

isWKT("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext  +no_defs");
// false
```

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