Skip to main content

国土基本図図郭コード計算ライブラリ(平面直角座標系 JGD2011 ベース)

Project description

jzukaku

国土基本図図郭コード計算ライブラリ。 緯度経度から平面直角座標系(JGD2011)を基準とした図郭コードの算出を行います。 図郭コードは、標準地域メッシュ(緯度経度ベース)とは異なる体系です。

図郭コード構成

レベル 桁数 区画サイズ
50000 4桁(系2桁+区画名2文字) 30km×40km
5000 6桁(+図葉2桁) 3km×4km
2500 7桁(+分割1桁 1–4) 1.5km×2km
1000 8桁(+分割 数字+英字) 600m×800m
500 8桁(+分割 00–99) 300m×400m

参考: 国土基本図の図郭と図郭コード

インストール

pip install jzukaku

開発用(uv を使う場合):

uv sync --extra dev

使い方

ライブラリとして

from jzukaku import latlon_to_zukaku, xy_to_zukaku, ZukakuInfo

# 緯度経度から図郭コード(系番号は自動推定)
info = latlon_to_zukaku(35.681236, 139.767125, level=500)
print(info.code)   # 例: 09EB4203
print(info.x_min, info.x_max, info.y_min, info.y_max)

# 系番号を指定
info = latlon_to_zukaku(35.681236, 139.767125, zone=9, level=5000)

# 平面直角座標から
info = xy_to_zukaku(10000.0, 20000.0, zone=9, level=500)

平面直角座標への変換

from jzukaku import latlon_to_jprcs, get_zone_for_location

zone = get_zone_for_location(35.68, 139.77)  # 緯度経度から系番号推定
x, y = latlon_to_jprcs(35.681236, 139.767125, zone)

CLI

# uv で実行(uv sync 後)
uv run jzukaku
# または
uv run python main.py

対応レベル

50000, 5000, 2500, 1000, 500。定数は jzukaku.LEVEL_50000 などで参照できます。

開発

uv sync --extra dev
uv run pytest
uv run ruff check src/

ライセンス

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jzukaku-0.1.3.tar.gz (9.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jzukaku-0.1.3-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file jzukaku-0.1.3.tar.gz.

File metadata

  • Download URL: jzukaku-0.1.3.tar.gz
  • Upload date:
  • Size: 9.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jzukaku-0.1.3.tar.gz
Algorithm Hash digest
SHA256 d66f7acddcd6ffbe69b66730d114e23b8e8dc80199a2d3c9b74275aabe1b103b
MD5 359e8ef6e5131fc9b349465257d9c0a5
BLAKE2b-256 c81597ac7953b375c3e0fd8c038fd0e764735328e2c8d9f62754797b9354f6f1

See more details on using hashes here.

Provenance

The following attestation bundles were made for jzukaku-0.1.3.tar.gz:

Publisher: publish.yml on tlasu/jzukaku

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jzukaku-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: jzukaku-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for jzukaku-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e5ec5826f80ac7d599cc5b5ed8eb023e47c768419250ff42d558a2e5a6ef3330
MD5 389ad9881e4b653571f7dff8ae912823
BLAKE2b-256 8d71d5fdf8f42788d0f689e134f5a7b2bbcb1b4921389567d30af9026bb8340f

See more details on using hashes here.

Provenance

The following attestation bundles were made for jzukaku-0.1.3-py3-none-any.whl:

Publisher: publish.yml on tlasu/jzukaku

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page