A tool for fast conversion of Japanese "MOJ Map XML" (land registration polygons) into geospatial formats.
Project description
mojxml-py
法務省登記所備付地図データ(地図XML)を各種GISデータ形式 (GeoJSON, GeoPackage, FlatGeobuf, etc.) に変換するコマンドラインツールです。Pythonライブラリとしても使用できます。
A tool for fast conversion of Japanese "MOJ Map XML" (land registration polygons) into geospatial format, written in Python.
特徴:
- デジタル庁のリファレンス実装 (mojxml2geojson) よりも高速に変換できます(XMLパーサとして lxml (libxml2) を使用しています)。
- XMLファイルだけなく、配布されているZIPファイルをそのまま入力することができます。
- GeoJSON以外の効率的かつコンパクトな形式 (GeoPackage, FlatGeobuf, etc.) でも出力できます。
インストール
Ubuntu/Debian:
apt install libgdal-dev
pip3 install mojxml
macOS (Homebrew):
brew install gdal
pip3 install mojxml
コマンドラインインタフェース
Usage: mojxml2ogr [OPTIONS] DST_FILE SRC_FILES...
Convert MoJ XMLs to GeoJSON/GeoPackage/FlatGeobuf/etc.
DST_FILE: output filename (.geojson, .gpkg, .fgb, etc.)
SRC_FILES: one or more .xml/.zip files
Options:
--worker [multiprocess|thread|single]
[default: multiprocess]
-a, --arbitrary Include 任意座標系
-c, --chikugai Include 地区外 and 別図
- 出力フォーマットは、出力ファイル名の拡張子から自動で判断されます。
-aオプションを指定すると、任意座標系のXMLファイルも変換されます。-cオプションを指定すると、地番が「地区外」「別図」の地物も出力されます。
使用例
# XMLファイルをGeoJSONに変換する
❯ mojxml2ogr output.geojson 15222-1107-1553.xml
# 複数のXMLファイルを1つのGeoJSONに変換する
❯ mojxml2ogr output.geojson 15222-1107-1553.xml 15222-1107-1554.xml
# 配布用ZIPファイルに含まれる全XMLをFlatGeobufに変換する
❯ mojxml2ogr output.fgb 15222-1107.zip
# 3つのZIPファイルをまとめて1つのFlatGeobufに変換する
❯ mojxml2ogr output.fgb 01202-4400.zip 01236-4400.zip 01337-4400.zip
# ZIPファイルを1段階展開して出てくるZIPファイルも入力できる
❯ mojxml2ogr output.fgb 15222-1107-15*.zip
License
MIT License
テスト用データについて
./testdata/ に含まれるZIPファイルおよびXMLファイルは、「登記所備付地図データ」(法務省)を、登記所備付地図データ利用規約に基づいて複製したものです。
Authors
- Taku Fukada (@ciscorn) - Original Author
- MIERUNE Inc.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mojxml-0.5.4.tar.gz.
File metadata
- Download URL: mojxml-0.5.4.tar.gz
- Upload date:
- Size: 4.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1450d7eb5c458fdb310f5d44e48e85c4eba362b75ee4f1944396387f924bf919
|
|
| MD5 |
55e5181be426a038089d9865c55678a5
|
|
| BLAKE2b-256 |
341ecf4069071f05d9a55f739ffd6e54d29d7b8671b0cb91e1a1c80a433488a0
|
File details
Details for the file mojxml-0.5.4-py3-none-any.whl.
File metadata
- Download URL: mojxml-0.5.4-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.9.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc86709ef12356777e2eeededce587c3b21e2f2ef2f4136b81174547b91541d4
|
|
| MD5 |
1add192764bb7b7dad67d292c4f75674
|
|
| BLAKE2b-256 |
173040e1137a1d377e9dd4d67a7f061e2d3ad742876811a20b9a569bed504342
|