# ginkgoch-geom

> This project provides the basic functions for geometries. It allows to convert between `wkt`, `wkb`, `json` and our `well formatted geometry classes` to construct `Point`, `LineString`, `Polygon`, `MultiPoint`, `MultiLineString`, `MultiPolygon` and `Geome

Latest version **1.11.1** (published 2020-02-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install ginkgoch-geom
pnpm add ginkgoch-geom
yarn add ginkgoch-geom
bun add ginkgoch-geom
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.11.1 |
| Published | 2020-02-21 |
| First published | 2019-07-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 958.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Ginkgoch |
| Maintainers | ginkgoch-dev |

## Links

- npm: https://www.npmjs.com/package/ginkgoch-geom
- Repository: https://github.com/ginkgoch/node-geom
- npm.io page: https://npm.io/package/ginkgoch-geom

## Dependencies (6)

- [jsts](https://npm.io/package/jsts.md) ^2.0.6
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [@types/jsts](https://npm.io/package/@types/jsts.md) ^0.17.0
- [@types/node](https://npm.io/package/@types/node.md) ^12.6.8
- [@types/lodash](https://npm.io/package/@types/lodash.md) ^4.14.136
- [ginkgoch-buffer-io](https://npm.io/package/ginkgoch-buffer-io.md) ^1.1.3

## Recent versions

- 1.11.1 (latest) — 2020-02-21
- 1.11.0 — 2020-02-18
- 1.10.0 — 2020-02-17
- 1.9.0 — 2020-02-15
- 1.8.0 — 2020-01-29
- 1.7.8 — 2019-08-29
- 1.7.7 — 2019-08-27
- 1.7.6 — 2019-08-27
- 1.7.5 — 2019-08-17
- 1.7.4 — 2019-08-17
- 1.7.3 — 2019-08-17
- 1.7.2 — 2019-08-17
- 1.7.1 — 2019-08-17
- 1.7.0 — 2019-08-16
- 1.6.2 — 2019-08-13
- … 25 more at https://npm.io/package/ginkgoch-geom/versions

## README

# Ginkgoch Geometries for Node.js
This project provides the basic functions for geometries.

1. Construct `Point`, `LineString`, `Polygon`, `MultiPoint`, `MultiLineString`, `MultiPolygon` and `GeometryCollection` with will defined APIs.
1. Calculate geometry self information such as area, perimeter etc.
1. Converts geometry format between `wkt`, `wkb`, `json` and Ginkgoch geometry classes.
1. Support popular geo-spatial analyzing methods.

## Install
```
yarn add ginkgoch-geom
```

## Docs
Visit [https://ginkgoch.github.io/node-geom](https://ginkgoch.github.io/node-geom) for detail.

## Demo

Full demo, please play on RunKit at: https://runkit.com/ginkgoch/geometry-demo

This is about how to use `ginkgoch-geom` library to create your own geometries and convert to various formats. The first on is about location. I will create a point that is located to a city in LA. It is easy to convert to GeoJSON format.

```javascript
const geom = require("ginkgoch-geom")
const point = new geom.Point(-119.698189, 34.420830);
point.toJSON();
```

![geom demo simple point](./images/geom-demo-simple-point.png)

Except point, it is also allow to create other geometries such as line, polygon or multi-point, multi-line, multi-polygon etc.

```javascript
const getJSON = require("async-get-json");

const geomURL = 'https://github.com/ginkgoch/map-data-demo/raw/master/json/geometries.json';
const geomJson = (await getJSON(geomURL));
geom.FeatureCollection.create(geomJson).toJSON();
```

![geom demo various geometries](./images/geom-demo-various-geoms.png)

For more demos about converting to well-known text (WKT), well-known binary (WKB) or spatial analyzing, please try on [RunKit](https://runkit.com/ginkgoch/geometry-demo) directly. If anything interesting, feel free to contact me with [ginkgoch@outlook.com](mailto:ginkgoch@outlook.com), I'm glad to help.

The is the low-level library in my `mapping echo system`. Please watch me on github for more function with map support on Node.js. 

Happy Mapping!

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