# projzh

> Utilities for working with Chinese coordinate reference systems

Latest version **1.0.0** (published 2019-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install projzh
pnpm add projzh
yarn add projzh
bun add projzh
```

## 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.0 |
| Published | 2019-01-29 |
| First published | 2016-03-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 23.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 96 |
| Maintainers | tschaub |
| Keywords | baidu, mercator, bd-09, gcj-02, projection, datum, transform, china |

## Links

- npm: https://www.npmjs.com/package/projzh
- Repository: https://github.com/tschaub/projzh
- Homepage: https://github.com/tschaub/projzh#readme
- Issues: https://github.com/tschaub/projzh/issues
- npm.io page: https://npm.io/package/projzh

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-01-29
- 0.5.0 — 2016-03-11
- 0.4.0 — 2016-03-09

## README

# projzh

This package provides utilities for working with coordinate reference systems used by Baidu maps.  The algorithms are ported from the [`proj4m` project](https://github.com/MapTalks/proj4m) which is licensed under the GPL v3.

# Rough details

As far as I understand, the coordinate reference system for Baidu Maps uses a custom Mercator projection and the BD-09 datum.  The BD-09 datum applies additional transforms on top of the GCJ-02 datum.

So, to transform a point in geographic coordinates and the WGS-84 datum to the CRS used by Baidu, first transform from WGS-84 to BD-09 (which itself uses the GCJ-09 transform), and then do the forward transform to Baidu Mercator.

```js
baiduMercator.forward(bd09.fromWGS84(point))
```

To transform a point in the CRS used by Baidu to geographic/WGS-84, first do the inverse transform from Baidu Mercator, then do the transform from BD-09 to WGS-84 (which itself uses the GCJ-09 transform).

```js
bd09.toWGS84(baiduMercator.inverse(point))
```

This package exports the functions above in the `datum/bd-09` and `projection/baidu-mercator` modules.  Additional functions for transforms to/from Spherical Mercator are available in the `index` module.

# Installation

    npm install projzh

The utility functions can be used in Node or in browsers with a module bundler.

# License

This package is derived from the [`proj4m` project](https://github.com/MapTalks/proj4m) and is distributed under the [MIT license](https://tldrlegal.com/license/mit-license).

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