CityGMLは、地理空間データのため標準データフォーマットです。 XMLベースで定義されているCityGMLは、中間データフォーマットと言われているように利用サイドが使いやすい形式に変換して利用することを想定されている。 手軽にCityGMLファイルを変換できるツールを作成した
コードは出来るだけシンプルにしたかったので、サンプルコードとしてバッサリとコードは簡潔にしてます。
エラー処理やテスト等も省略している部分があります。何かの参考にしていただければ幸いです
$ python cct.py --version
CityGML convert tools (CCT) v0.0.1
※1 2D座標系に変換する場合も3D座標で[longitude, latitude, height]に変換します
$ python cct.py --help
Usage: cct.py [OPTIONS] COMMAND [ARGS]...
CityGML convert tools (CCT) v0.0.1
Options:
--version Show the version and exit.
-d, --debug / --no-debug debug mode
-v, --verbose verbose mode
--help Show this message and exit.
Commands:
geojson Convert CityGML file to GeoJSON file
ply Convert CityGML file to PLY file
$ python cct.py ply --help
Usage: cct.py ply [OPTIONS] FILENAME
Convert CityGML file to PLY file
Options:
-o, --output TEXT output path name
-s, --to-srid TEXT output SRID(EPSG)
-l, --lod INTEGER RANGE output lod type [0<=x<=2]
-sp, --separate separate the building data
--help Show this message and exit.
Examples
$ python cct.py ply 53392633_bldg_6697_2_op.gml --lod=2 --to-srid=6677
$ python cct.py geojson --help
Usage: cct.py geojson [OPTIONS] FILENAME
Convert CityGML file to GeoJSON file
Options:
-o, --output TEXT output path name
-s, --to-srid TEXT output SRID(EPSG)
-l, --lod INTEGER RANGE output lod type [0<=x<=2]
-sp, --separate separate the building data
-lonlat, --lonlat swap lon lat order
--help Show this message and exit.
Examples
$ python cct.py geojson 53392633_bldg_6697_2_op.gml --lod=2 --to-srid=4326
Pythonとpoetryを利用します。
$ git clone [email protected]:GeoPythonJP/citygml-convert-tools.git
$ poetry install
$ poetry shell
see the changelog.
3D都市モデル(Project PLATEAU)東京都23区のCityGMLの東京都大田区羽田空港三丁目データ ”53392633_bldg_6697_2_op.gml” のみで動作確認
MIT See thelicense document for the full text.
下記のモジュールを参考、使用しています。 各々のライセンスに従ってください。
| GitHub | |
|---|---|
| homata | @homata |
| nokonoko1203 | @nokonoko_1203 |
CityGMLファイルを表示させる下記のツールがあります。
座標系の変換等をする場合の参考情報を記述します
EPSG:6697というのは「JGD2011 + JGD2011 (vertical) height」という座標参照系でEPSG:6668(JGD2011)とEPSG:6695(JGD2011 (vertical) height)からなる座標系である
系 EPSG (JGD2011) 区域
1 6669 長崎県、鹿児島県の一部
2 6670 福岡県、佐賀県、熊本県、大分県、宮崎県、鹿児島県の一部
3 6671 山口県、島根県、広島県
4 6672 香川県、愛媛県、徳島県、高知県
5 6673 兵庫県、鳥取県、岡山県
6 6674 京都府、大阪府、福井県、滋賀県、三重県、奈良県、和歌山県
7 6675 石川県、富山県、岐阜県、愛知県
8 6676 新潟県、長野県、山梨県、静岡県
9 6677 東京都の一部、福島県、栃木県、茨城県、埼玉県、千葉県、群馬県、神祭川県
10 6678 青森県、秋田県、山形県、岩手県、宮城県
11 6679 北海道の一部
12 6680 北海道の一部
13 6681 北海道の一部
14 6682 東京都の一部
15 6683 沖縄県の一部
16 6684 沖縄県の一部
17 6685 沖縄県の一部
18 6686 東京都の��部
19 6687 東京都の一部
PLATEAU関連情報のメモ
TBD
TBD
関連情報のメモ
3D都市空間モデルビューワーのサンプルです