Metadata-Version: 2.5
Name: tky2jgd
Version: 0.2.0
Summary: Python port of TKY2JGD to transform coordinates from Tokyo Datum (EPSG:4301) to JGD2000 (EPSG:4612)
Project-URL: Repository, https://github.com/shuuji3/TKY2JGD
Author-email: TAKAHASHI Shuuji <shuuji3@gmail.com>
Maintainer-email: TAKAHASHI Shuuji <shuuji3@gmail.com>
License-Expression: BSD-3-Clause
License-File: LICENSE
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# TKY2JGD

[![PyPI - tky2jgd](https://img.shields.io/pypi/v/tky2jgd)](https://pypi.org/project/tky2jgd/)
![pytest status](https://img.shields.io/github/actions/workflow/status/shuuji3/tky2jgd/main.yaml?branch=main)

> [!NOTE]
> This repository is a fork of original https://github.com/mugwort-rc/TKY2JGD. It updates and refactors codes, and publishes it as a PyPI package.

国土地理院のTKY2JGDをPythonに移植したものです。

オリジナルのTKY2JGDはhttps://www.gsi.go.jp/sokuchikijun/tky2jgd_download.htmlからダウンロードできます。

座標変換パラメータファイル`data/TKY2JGD.par`はv2.1.1 (2002-04-01) を使用しています。

## Usage

### CLI

```
$ tky2jgd 36.103774791666666 140.08785504166664
36.10696628160147 140.08457686629436
```

### Python

```python
import tky2jgd

tky2jgd.load_parameter('data/TKY2JGD.par')

# Original First-class Triangulation Point at the Japan GSI Tsukuba
lat, lon = 36.100578889, 140.091149167
dB, dL = tky2jgd.bilinear(lat, lon)
lat += dB / 3600
lon += dL / 3600
assert (lat, lon) == (36.10377077065109, 140.08787082896106)
```

## References

- Original application TKY2JGD developed by Japan GSI: [TKY2JGDバージョンアップ履歴 | 国土地理院](https://www.gsi.go.jp/sokuchikijun/tky2jgd_version.html)
- Japan GSI continue improving the new conversion data. The latest information is available at [測量計算サイト トップページ](https://vldb.gsi.go.jp/sokuchi/surveycalc/main.html).
